DerivativesTopic #10 of 32

Logarithmic Differentiation

Using logarithms to simplify differentiation of complex expressions.

When to Use

Logarithmic differentiation is useful when:

  • The function has variable bases AND variable exponents: f(x)g(x)f(x)^{g(x)}
  • The function is a complicated product or quotient
  • You want to simplify before differentiating

The Method

  1. Take the natural log of both sides: ln(y)=ln(f(x))\ln(y) = \ln(f(x))
  2. Use logarithm properties to simplify
  3. Differentiate implicitly
  4. Solve for dydx\frac{dy}{dx}
  5. Substitute back the original yy

Logarithm Properties

ln(ab)=ln(a)+ln(b)\ln(ab) = \ln(a) + \ln(b)

ln(ab)=ln(a)ln(b)\ln\left(\frac{a}{b}\right) = \ln(a) - \ln(b)

ln(an)=nln(a)\ln(a^n) = n \cdot \ln(a)

Examples

Example 1: Variable base and exponent

Find dydx\frac{dy}{dx} for y=xxy = x^x:

ln(y)=ln(xx)=xln(x)\ln(y) = \ln(x^x) = x \cdot \ln(x)

1ydydx=x1x+ln(x)1=1+ln(x)\frac{1}{y} \cdot \frac{dy}{dx} = x \cdot \frac{1}{x} + \ln(x) \cdot 1 = 1 + \ln(x)

dydx=y(1+ln(x))=xx(1+ln(x))\frac{dy}{dx} = y(1 + \ln(x)) = x^x(1 + \ln(x))

Example 2: General form f(x)^g(x)

Find dydx\frac{dy}{dx} for y=(sinx)xy = (\sin x)^x:

ln(y)=xln(sinx)\ln(y) = x \cdot \ln(\sin x)

1ydydx=xcos(x)sin(x)+ln(sinx)1\frac{1}{y} \cdot \frac{dy}{dx} = x \cdot \frac{\cos(x)}{\sin(x)} + \ln(\sin x) \cdot 1

=xcot(x)+ln(sinx)= x \cot(x) + \ln(\sin x)

dydx=(sinx)x[xcot(x)+ln(sinx)]\frac{dy}{dx} = (\sin x)^x [x \cot(x) + \ln(\sin x)]

Example 3: Complicated quotient

Find dydx\frac{dy}{dx} for y=(x2+1)3(x1)4(x+2)5y = \frac{(x^2 + 1)^3(x - 1)^4}{(x + 2)^5}:

ln(y)=3ln(x2+1)+4ln(x1)5ln(x+2)\ln(y) = 3\ln(x^2 + 1) + 4\ln(x - 1) - 5\ln(x + 2)

1ydydx=32xx2+1+41x151x+2\frac{1}{y} \cdot \frac{dy}{dx} = 3 \cdot \frac{2x}{x^2 + 1} + 4 \cdot \frac{1}{x - 1} - 5 \cdot \frac{1}{x + 2}

=6xx2+1+4x15x+2= \frac{6x}{x^2 + 1} + \frac{4}{x - 1} - \frac{5}{x + 2}

dydx=y[6xx2+1+4x15x+2]\frac{dy}{dx} = y\left[\frac{6x}{x^2 + 1} + \frac{4}{x - 1} - \frac{5}{x + 2}\right]

Example 4: x to a function power

Find dydx\frac{dy}{dx} for y=xsinxy = x^{\sin x}:

ln(y)=sin(x)ln(x)\ln(y) = \sin(x) \cdot \ln(x)

1ydydx=sin(x)1x+ln(x)cos(x)\frac{1}{y} \cdot \frac{dy}{dx} = \sin(x) \cdot \frac{1}{x} + \ln(x) \cdot \cos(x)

=sin(x)x+cos(x)ln(x)= \frac{\sin(x)}{x} + \cos(x) \ln(x)

dydx=xsinx[sin(x)x+cos(x)ln(x)]\frac{dy}{dx} = x^{\sin x} \left[\frac{\sin(x)}{x} + \cos(x) \ln(x)\right]

Example 5: Tower of exponents

Find dydx\frac{dy}{dx} for y=xxxy = x^{x^x}:

Let u=xxu = x^x, so y=xuy = x^u.

First find dudx\frac{du}{dx} (from Example 1):

dudx=xx(1+ln(x))\frac{du}{dx} = x^x(1 + \ln(x))

Now for y=xuy = x^u:

ln(y)=uln(x)=xxln(x)\ln(y) = u \cdot \ln(x) = x^x \cdot \ln(x)

1ydydx=xx1x+ln(x)xx(1+ln(x))\frac{1}{y} \cdot \frac{dy}{dx} = x^x \cdot \frac{1}{x} + \ln(x) \cdot x^x(1 + \ln(x))

=xx1+xxln(x)(1+ln(x))= x^{x-1} + x^x \ln(x)(1 + \ln(x))

dydx=xxxxx[1x+ln(x)(1+ln(x))]\frac{dy}{dx} = x^{x^x} \cdot x^x\left[\frac{1}{x} + \ln(x)(1 + \ln(x))\right]

Alternative Formula

For y=f(x)g(x)y = f(x)^{g(x)}:

dydx=f(x)g(x)[g(x)ln(f(x))+g(x)f(x)f(x)]\frac{dy}{dx} = f(x)^{g(x)} \cdot \left[g'(x) \cdot \ln(f(x)) + g(x) \cdot \frac{f'(x)}{f(x)}\right]

This comes directly from logarithmic differentiation.