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

Domain, Absolute Value, and the Natural Log

  • The natural logarithm ln⁡x\ln x is only defined for positive inputs (domain x>0x>0).
  • To extend logarithmic expressions to negative inputs we use the absolute-value form ln⁡∣x∣\ln|x|, whose domain is x≠0x \neq 0.
  • Piecewise definition of the absolute value that was recalled:
    • ∣x∣=x|x| = x if x>0x>0
    • ∣x∣=−x|x| = -x if x<0x<0
  • Consequences for the logarithm:
    • ln⁡∣x∣=ln⁡x\ln|x| = \ln x when x>0x>0
    • ln⁡∣x∣=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 ln⁡∣x∣\ln|x|

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

General Logarithmic‐Chain Formula

  • For any differentiable function f(x)>0f(x)>0:
    ddx [ln⁡f(x)]=f′(x)f(x).\boxed{\displaystyle \frac{d}{dx}\,[\ln f(x)] = \frac{f'(x)}{f(x)}}.
  • Special cases discussed:
    • ddx [ln⁡(−x)]=−1−x=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)′=u′v+uv′.(uv)' = u'v + uv'.
  • Quotient rule: (uv)′=u′v−uv′v2.\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=(ln⁡x)xy=(\ln x)\sqrt{x}

First derivative

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

First derivative (chain rule)

  • Let u=1+ln⁡x.u = 1+\ln x.
    • y=ln⁡u,u′=1x.y = \ln u,\quad u' = \dfrac1x.
  • Chain rule: y′=1u u′=11+ln⁡x⋅1x=1x(1+ln⁡x).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+ln⁡x)]−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+ln⁡x).g(x)=x\,(1+\ln x).
  • Compute g′(x):g'(x):
    g′(x)=1⋅(1+ln⁡x)+x⋅1x=(1+ln⁡x)+1=ln⁡x+2.g'(x)=1\cdot(1+\ln x)+x\cdot\frac1x = (1+\ln x)+1 = \ln x+2.
  • Therefore
    y′′=−ln⁡x+2x2 (1+ln⁡x)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 ln⁡∣x∣\ln|x| and the “inside derivative” whenever 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 1x\dfrac1x naturally yields 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)), 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.