Calculus – Logarithmic Derivatives, Chain Rule, & Second-Derivative Examples Domain, Absolute Value, and the Natural Log The natural logarithm ln x \ln x ln x is only defined for positive inputs (domain x>0). To extend logarithmic expressions to negative inputs we use the absolute-value form ln ∣ x ∣ \ln|x| ln ∣ x ∣ , whose domain is x ≠ 0 x \neq 0 x = 0 . Piecewise definition of the absolute value that was recalled:∣ x ∣ = x |x| = x ∣ x ∣ = x if x>0∣ x ∣ = − x |x| = -x ∣ x ∣ = − x if x<0 Consequences for the logarithm:ln ∣ x ∣ = ln x \ln|x| = \ln x ln ∣ x ∣ = ln x when x>0ln ∣ x ∣ = ln ( − x ) \ln|x| = \ln(-x) ln ∣ x ∣ = ln ( − x ) when x < 0 x<0 x < 0 (notice that − x > 0 -x>0 − x > 0 so the argument of the log is positive). Derivative of ln ∣ x ∣ \ln|x| ln ∣ x ∣ Use the chain rule separately on each branch.If x>0: d d x [ ln x ] = 1 x \dfrac{d}{dx}\,[\ln x] = \dfrac1x d x d [ ln x ] = x 1 . If x < 0 x<0 x < 0 : write u = − x u=-x u = − x (so u > 0 u>0 u > 0 ). Then ln ∣ x ∣ = ln u \ln|x| = \ln u ln ∣ x ∣ = ln u andd d x [ ln u ] = 1 u d u d x = 1 − x ⋅ ( − 1 ) = 1 x . \dfrac{d}{dx}\,[\ln u] = \dfrac1u\,\dfrac{du}{dx}=\dfrac1{-x}\cdot(-1)=\dfrac1x. d x d [ ln u ] = u 1 d x d u = − x 1 ⋅ ( − 1 ) = x 1 . Result: d d x ln ∣ x ∣ = 1 x ( x ≠ 0 ) . \boxed{\displaystyle \frac{d}{dx}\,\ln|x| = \frac1x\qquad (x\neq 0)}. d x d ln ∣ x ∣ = x 1 ( x = 0 ) . Antiderivative connection: ∫ 1 x d x = ln ∣ x ∣ + C . \displaystyle \int \frac1x\,dx = \ln|x|+C. ∫ x 1 d x = ln ∣ x ∣ + C . For any differentiable function f(x)>0: d d x [ ln f ( x ) ] = f ′ ( x ) f ( x ) . \boxed{\displaystyle \frac{d}{dx}\,[\ln f(x)] = \frac{f'(x)}{f(x)}}. d x d [ ln f ( x )] = f ( x ) f ′ ( x ) . Special cases discussed:d d x [ ln ( − x ) ] = − 1 − x = 1 x . \dfrac{d}{dx}\,[\ln(-x)] = \dfrac{-1}{-x}=\dfrac1x. d x d [ ln ( − x )] = − x − 1 = x 1 . d d x [ ln ( x 3 ) ] = 3 x 2 x 3 = 3 x . \dfrac{d}{dx}\,[\ln(x^3)] = \dfrac{3x^2}{x^3}=\dfrac3x. d x d [ ln ( x 3 )] = x 3 3 x 2 = x 3 . Review of Product, Quotient, and Chain Rules Product rule: ( u v ) ′ = u ′ v + u v ′ . (uv)' = u'v + uv'. ( uv ) ′ = u ′ v + u v ′ . Quotient rule: ( u v ) ′ = u ′ v − u v ′ v 2 . \left(\dfrac{u}{v}\right)' = \dfrac{u'v - uv'}{v^2}. ( v u ) ′ = v 2 u ′ v − u v ′ . Chain rule (restated): if y = f ( u ) y=f(u) y = f ( u ) and u = g ( x ) u=g(x) u = g ( x ) , then d y d x = f ′ ( u ) g ′ ( x ) . \dfrac{dy}{dx}=f'(u)\,g'(x). d x d y = f ′ ( u ) g ′ ( x ) . Example A – First & Second Derivatives of y = ( ln x ) x y=(\ln x)\sqrt{x} y = ( ln x ) x First derivative Think of y = ( ln x ) x 1 / 2 . y = (\ln x)\,x^{1/2}. y = ( ln x ) x 1/2 . Apply the product rule. Derivatives of the factors:d d x [ ln x ] = 1 x . \dfrac{d}{dx}[\ln x] = \dfrac1x. d x d [ ln x ] = x 1 . d d x [ x 1 / 2 ] = 1 2 x − 1 / 2 = 1 2 x . \dfrac{d}{dx}[x^{1/2}] = \dfrac{1}{2}x^{-1/2}=\dfrac1{2\sqrt{x}}. d x d [ x 1/2 ] = 2 1 x − 1/2 = 2 x 1 . Product rule gives
\begin{aligned}
y' &= (\ln x)\left(\frac1{2\sqrt{x}}\right) + \sqrt{x}\left(\frac1x\right)\[4pt]
&= \frac{\ln x}{2\sqrt{x}} + \frac1{\sqrt{x}}\[4pt]
&= \frac{1 + \tfrac12\ln x}{\sqrt{x}}.
\end{aligned} Second derivative Rewrite y ′ y' y ′ as x − 1 / 2 ( 1 + 1 2 ln x ) . x^{-1/2}\bigl(1+\tfrac12\ln x\bigr). x − 1/2 ( 1 + 2 1 ln x ) . Letg ( x ) = x − 1 / 2 , g ′ ( x ) = − 1 2 x − 3 / 2 . g(x)=x^{-1/2},\; g'(x)=-\tfrac12x^{-3/2}. g ( x ) = x − 1/2 , g ′ ( x ) = − 2 1 x − 3/2 . h ( x ) = 1 + 1 2 ln x , h ′ ( x ) = 1 2 x − 1 . h(x)=1+\tfrac12\ln x,\; h'(x)=\tfrac12\,x^{-1}. h ( x ) = 1 + 2 1 ln x , h ′ ( x ) = 2 1 x − 1 . Apply the product rule again:
\begin{aligned}
y'' &= g'(x)h(x)+g(x)h'(x)\[4pt]
&=\left(-\frac12x^{-3/2}\right)\Bigl(1+\tfrac12\ln x\Bigr)+x^{-1/2}\left(\frac12x^{-1}\right)\[6pt]
&=x^{-3/2}\Bigl[-\tfrac12!\left(1+\tfrac12\ln x\right)+\tfrac12\Bigr]\[6pt]
&=x^{-3/2}\Bigl[-\tfrac14\ln x\Bigr]\[4pt]
&=\boxed{-\dfrac{\ln x}{4x^{3/2}}}.
\end{aligned} Example B – First & Second Derivatives of y = ln ( 1 + ln x ) y=\ln\bigl(1+\ln x\bigr) y = ln ( 1 + ln x ) First derivative (chain rule) Let u = 1 + ln x . u = 1+\ln x. u = 1 + ln x . y = ln u , u ′ = 1 x . y = \ln u,\quad u' = \dfrac1x. y = ln u , u ′ = x 1 . Chain rule: y ′ = 1 u u ′ = 1 1 + ln x ⋅ 1 x = 1 x ( 1 + ln x ) . y' = \dfrac1u\,u' = \frac1{1+\ln x}\cdot\frac1x = \boxed{\dfrac1{x\bigl(1+\ln x\bigr)}}. y ′ = u 1 u ′ = 1 + l n x 1 ⋅ x 1 = x ( 1 + ln x ) 1 . Second derivative (quotient or “negative‐power” rule) Write y ′ = [ x ( 1 + ln x ) ] − 1 . y' = \bigl[x\,(1+\ln x)\bigr]^{-1}. y ′ = [ x ( 1 + ln x ) ] − 1 . Differentiate as y ′ ′ = − g ′ ( x ) g ( x ) 2 , y'' = -\dfrac{g'(x)}{g(x)^2}, y ′′ = − g ( x ) 2 g ′ ( x ) , where g ( x ) = x ( 1 + ln x ) . g(x)=x\,(1+\ln x). g ( x ) = x ( 1 + ln x ) . Compute g ′ ( x ) : g'(x): g ′ ( x ) : g ′ ( x ) = 1 ⋅ ( 1 + ln x ) + x ⋅ 1 x = ( 1 + ln x ) + 1 = ln x + 2. g'(x)=1\cdot(1+\ln x)+x\cdot\frac1x = (1+\ln x)+1 = \ln x+2. g ′ ( x ) = 1 ⋅ ( 1 + ln x ) + x ⋅ x 1 = ( 1 + ln x ) + 1 = ln x + 2. Thereforey ′ ′ = − ln x + 2 x 2 ( 1 + ln x ) 2 . \boxed{\displaystyle y'' = -\frac{\ln x + 2}{x^{2}\,(1+\ln x)^{2}}}. y ′′ = − x 2 ( 1 + ln x ) 2 ln x + 2 . Take-Away Points and Connections Absolute value inside a log allows differentiation across both positive and negative inputs while excluding x = 0 x=0 x = 0 .The derivative 1 x \dfrac1x x 1 appears repeatedly; it is both the slope of ln ∣ x ∣ \ln|x| ln ∣ x ∣ and the “inside derivative” whenever ln x \ln x ln x is nested in larger functions. The chain rule, product rule, and quotient rule knit together seamlessly when higher-order derivatives are required. Integration of 1 x \dfrac1x x 1 naturally yields ln ∣ x ∣ \ln|x| ln ∣ x ∣ , illustrating the reciprocal relationship between differentiation and antidifferentiation for logarithmic functions. Practical & Pedagogical Notes Always state the domain before differentiating logarithmic expressions. When you see ln ( f ( x ) ) \ln(f(x)) ln ( f ( x )) , immediately think “f ′ ( x ) / f ( x ) f'(x)/f(x) f ′ ( x ) / f ( x ) ,” then decide if further chain-rule steps are needed. For higher derivatives, rewrite expressions with powers (e.g.x = x 1 / 2 \sqrt{x}=x^{1/2} x = x 1/2 ) so exponents can be handled mechanically. A clean algebraic simplification at each step prevents sign errors—especially important when negative signs originate from chain‐rule substitutions like u = − x u=-x u = − x .