Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Use Logarithmic Differentiation

Take the natural logarithm of both sides, let the log rules turn products, quotients and powers into sums, differentiate implicitly, then multiply back by yy. It is the only route when the variable sits in both the base and the exponent.

Recognize the task

The variable is in the exponent and in the base: xxx^x, (sin⁡x)cos⁡x(\sin x)^{\cos x}, xln⁡xx^{\ln x}. Or the function is a long product or quotient of powers: x2x+1(x−3)4\frac{x^2\sqrt{x+1}}{(x-3)^4}. Test: is there no rule for the exponent, or would you need the product and quotient rules three times over? Then take logs. You do not need it for axa^x (constant base) or xnx^n (constant exponent): those have their own rules.
The log rules used in step 2 are collected under expanding logarithmic expressions in the algebra lesson.

Two ways to do it

Take logs of both sidesusual choice
y′=y ddx[ln⁡f(x)]y' = y\,\frac{d}{dx}\big[\ln f(x)\big]
Works in every case. The logarithmic differentiation formula is exactly this: differentiate the log, multiply back by yy.
Rewrite as an exponentialfor f(x) to the power g(x)
f(x)g(x)=e g(x)ln⁡f(x)f(x)^{g(x)} = e^{\,g(x)\ln f(x)}
Then differentiate with the chain rule and the product rule. Same answer, no implicit step, but it only covers the variable-exponent case.

Steps

StepOn y=xxy = x^x
1Take ln of both sides. This needs y>0y > 0; for a function that changes sign, use ln⁡∣y∣\ln|y|, the steps are identical.ln⁡y=ln⁡(xx)\ln y = \ln(x^x)
2Expand the right side with the log rules. Powers come down as factors by the power rule for logarithms, products become sums (product rule), quotients become differences (quotient rule).ln⁡y=xln⁡x\ln y = x\ln x
3Differentiate both sides. The left side is implicit: ddxln⁡y=1y y′\frac{d}{dx}\ln y = \frac{1}{y}\,y' by the chain rule. The right side is now a sum of simple terms; here it needs one product rule.Product rule ↗1y y′=ln⁡x+x⋅1x=ln⁡x+1\frac{1}{y}\,y' = \ln x + x\cdot\frac{1}{x} = \ln x + 1
4Multiply by y and substitute y back in terms of xx. The answer is not finished while a yy is still in it.y′=xx(ln⁡x+1)y' = x^x(\ln x + 1)

Worked examples

Example 1 · variable base and exponent

the classic
y=xxy = x^x
no rule fits directly
ln⁡y=xln⁡x\ln y = x\ln x
take logs; exponent comes down
y′y=ln⁡x+1\frac{y'}{y} = \ln x + 1
product rule on xln⁡xx\ln x
y′=xx(ln⁡x+1)y' = x^x(\ln x + 1)
multiply by y=xxy = x^x

Example 2 · long quotient of powers

saves three rules
y=x2x+1(x−3)4y = \frac{x^2\sqrt{x+1}}{(x-3)^4}
product, root and quotient at once
ln⁡y=2ln⁡x+12ln⁡(x+1)−4ln⁡(x−3)\ln y = 2\ln x + \tfrac{1}{2}\ln(x+1) - 4\ln(x-3)
log rules: a plain sum
y′y=2x+12(x+1)−4x−3\frac{y'}{y} = \frac{2}{x} + \frac{1}{2(x+1)} - \frac{4}{x-3}
each term is 1u⋅u′\frac{1}{u}\cdot u'
y′=x2x+1(x−3)4(2x+12(x+1)−4x−3)y' = \frac{x^2\sqrt{x+1}}{(x-3)^4}\left(\frac{2}{x} + \frac{1}{2(x+1)} - \frac{4}{x-3}\right)
multiply by yy

Example 3 · trig base and exponent

variable exponent
y=(sin⁡x)cos⁡xy = (\sin x)^{\cos x}
both vary; take logs
ln⁡y=cos⁡x ln⁡(sin⁡x)\ln y = \cos x\,\ln(\sin x)
exponent comes down
y′y=−sin⁡x ln⁡(sin⁡x)+cos⁡x⋅cos⁡xsin⁡x\frac{y'}{y} = -\sin x\,\ln(\sin x) + \cos x\cdot\frac{\cos x}{\sin x}
product rule, chain rule on ln⁡(sin⁡x)\ln(\sin x)
y′=(sin⁡x)cos⁡x(cos⁡2xsin⁡x−sin⁡x ln⁡(sin⁡x))y' = (\sin x)^{\cos x}\left(\frac{\cos^2 x}{\sin x} - \sin x\,\ln(\sin x)\right)
multiply by yy

See it happen

Two wrong rules add up to the right one. Treating xxx^x as a power gives x⋅xx−1=xxx\cdot x^{x-1} = x^x; treating it as an exponential gives xxln⁡xx^x\ln x. Neither is the derivative, but their sum xx(ln⁡x+1)x^x(\ln x + 1) is: when base and exponent both vary, each contributes its own change, and logarithmic differentiation adds the two automatically.

Common mistakes

Forgetting to multiply by y

✗ y′=ln⁡x+1y' = \ln x + 1
✓ y′=xx(ln⁡x+1)y' = x^x(\ln x + 1)
At x=2x = 2 the wrong answer is about 1.691.69, the right one about 6.776.77. The left side was y′y\frac{y'}{y}, not y′y'.

Differentiating ln y as 1/y

✗ ddxln⁡y=1y\frac{d}{dx}\ln y = \frac{1}{y}
✓ ddxln⁡y=1y y′\frac{d}{dx}\ln y = \frac{1}{y}\,y'

Using the power rule on a variable exponent

✗ (xx)′=x⋅xx−1(x^x)' = x\cdot x^{x-1}
✓ the exponent is not constant; take logs

Taking the log of a sum

✗ ln⁡(x2+1)=2ln⁡x+ln⁡1\ln(x^2 + 1) = 2\ln x + \ln 1
✓ log rules split products and quotients only; ln⁡(x2+1)\ln(x^2+1) stays as it is