Calculus – Logarithmic Derivatives, Chain Rule, & Second-Derivative Examples

Domain, Absolute Value, and the Natural Log

  • The natural logarithm lnx\ln x is only defined for positive inputs (domain x>0).
  • To extend logarithmic expressions to negative inputs we use the absolute-value form lnx\ln|x|, whose domain is x0x \neq 0.
  • Piecewise definition of the absolute value that was recalled:
    • x=x|x| = x if x>0
    • x=x|x| = -x if x<0
  • Consequences for the logarithm:
    • lnx=lnx\ln|x| = \ln x when x>0
    • lnx=ln(x)\ln|x| = \ln(-x) when x<0x<0 (notice that x>0-x>0 so the argument of the log is positive).

Derivative of lnx\ln|x|

  • Use the chain rule separately on each branch.
    1. If x>0: ddx[lnx]=1x\dfrac{d}{dx}\,[\ln x] = \dfrac1x.
    2. If x<0x<0: write u=xu=-x (so u>0u>0). Then lnx=lnu\ln|x| = \ln u and
      ddx[lnu]=1ududx=1x(1)=1x.\dfrac{d}{dx}\,[\ln u] = \dfrac1u\,\dfrac{du}{dx}=\dfrac1{-x}\cdot(-1)=\dfrac1x.
  • Result: ddxlnx=1x(x0).\boxed{\displaystyle \frac{d}{dx}\,\ln|x| = \frac1x\qquad (x\neq 0)}.
  • Antiderivative connection: 1xdx=lnx+C.\displaystyle \int \frac1x\,dx = \ln|x|+C.

General Logarithmic‐Chain Formula

  • For any differentiable function f(x)>0:
    ddx[lnf(x)]=f(x)f(x).\boxed{\displaystyle \frac{d}{dx}\,[\ln f(x)] = \frac{f'(x)}{f(x)}}.
  • Special cases discussed:
    • ddx[ln(x)]=1x=1x.\dfrac{d}{dx}\,[\ln(-x)] = \dfrac{-1}{-x}=\dfrac1x.
    • ddx[ln(x3)]=3x2x3=3x.\dfrac{d}{dx}\,[\ln(x^3)] = \dfrac{3x^2}{x^3}=\dfrac3x.

Review of Product, Quotient, and Chain Rules

  • Product rule: (uv)=uv+uv.(uv)' = u'v + uv'.
  • Quotient rule: (uv)=uvuvv2.\left(\dfrac{u}{v}\right)' = \dfrac{u'v - uv'}{v^2}.
  • Chain rule (restated): if y=f(u)y=f(u) and u=g(x)u=g(x), then dydx=f(u)g(x).\dfrac{dy}{dx}=f'(u)\,g'(x).

Example A – First & Second Derivatives of y=(lnx)xy=(\ln x)\sqrt{x}

First derivative

  • Think of y=(lnx)x1/2.y = (\ln x)\,x^{1/2}. Apply the product rule.
  • Derivatives of the factors:
    • ddx[lnx]=1x.\dfrac{d}{dx}[\ln x] = \dfrac1x.
    • ddx[x1/2]=12x1/2=12x.\dfrac{d}{dx}[x^{1/2}] = \dfrac{1}{2}x^{-1/2}=\dfrac1{2\sqrt{x}}.
  • 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 yy' as x1/2(1+12lnx).x^{-1/2}\bigl(1+\tfrac12\ln x\bigr). Let
    • g(x)=x1/2,  g(x)=12x3/2.g(x)=x^{-1/2},\; g'(x)=-\tfrac12x^{-3/2}.
    • h(x)=1+12lnx,  h(x)=12x1.h(x)=1+\tfrac12\ln x,\; h'(x)=\tfrac12\,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+lnx)y=\ln\bigl(1+\ln x\bigr)

First derivative (chain rule)

  • Let u=1+lnx.u = 1+\ln x.
    • y=lnu,u=1x.y = \ln u,\quad u' = \dfrac1x.
  • Chain rule: y=1uu=11+lnx1x=1x(1+lnx).y' = \dfrac1u\,u' = \frac1{1+\ln x}\cdot\frac1x = \boxed{\dfrac1{x\bigl(1+\ln x\bigr)}}.

Second derivative (quotient or “negative‐power” rule)

  • Write y=[x(1+lnx)]1.y' = \bigl[x\,(1+\ln x)\bigr]^{-1}.
  • Differentiate as y=g(x)g(x)2,y'' = -\dfrac{g'(x)}{g(x)^2}, where g(x)=x(1+lnx).g(x)=x\,(1+\ln x).
  • Compute g(x):g'(x):
    g(x)=1(1+lnx)+x1x=(1+lnx)+1=lnx+2.g'(x)=1\cdot(1+\ln x)+x\cdot\frac1x = (1+\ln x)+1 = \ln x+2.
  • Therefore
    y=lnx+2x2(1+lnx)2.\boxed{\displaystyle y'' = -\frac{\ln x + 2}{x^{2}\,(1+\ln x)^{2}}}.

Take-Away Points and Connections

  • Absolute value inside a log allows differentiation across both positive and negative inputs while excluding x=0x=0.
  • The derivative 1x\dfrac1x appears repeatedly; it is both the slope of lnx\ln|x| and the “inside derivative” whenever lnx\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 1x\dfrac1x naturally yields lnx\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)), immediately think “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=x1/2\sqrt{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=xu=-x.