When to use it
- A variable in both the base and the exponent, like xx or (2x4 + 1)tan x. Neither the power rule (variable base, constant exponent) nor the exponential rule (constant base, variable exponent) applies.
- Long products, quotients and powers, where the product and quotient rules would get messy. Logs turn multiplication into addition and powers into multiples.
Why it works
The log rules do the simplifying:
Differentiating ln y with the chain rule gives (1/y) · dy/dx, which you then multiply by y.
The steps
- Take the natural log of both sides: ln y = ln(h(x)).
- Expand the right side with log rules as much as possible.
- Differentiate both sides. The left side becomes (1/y) dy/dx.
- Multiply both sides by y.
- Replace y with the original function.
Example 1: the derivative of xx (x > 0)
- y = xx, so ln y = ln(xx) = x ln x.
- Differentiate with the product rule: (1/y) dy/dx = 1 · ln x + x · (1/x) = ln x + 1.
- Multiply by y: dy/dx = y(ln x + 1).
- Substitute: d/dx xx = xx(ln x + 1).
Check a value: at x = 2, the slope is 4(ln 2 + 1) ≈ 6.773. At x = 1, it's 1 · (0 + 1) = 1. A common mistake is to answer x · xx−1, which treats the exponent as a constant.
Example 2: y = (2x4 + 1)tan x
- ln y = tan x · ln(2x4 + 1).
- Differentiate with the product and chain rules: (1/y) dy/dx = sec²x · ln(2x4 + 1) + tan x · 8x³/(2x4 + 1).
- Multiply by y: dy/dx = (2x4 + 1)tan x [sec²x · ln(2x4 + 1) + 8x³ tan x / (2x4 + 1)].
Example 3: a messy quotient
- Take logs and expand: ln y = ln x + (1/2) ln(2x + 1) − x ln e − 3 ln(sin x) = ln x + (1/2) ln(2x + 1) − x − 3 ln(sin x).
- Differentiate term by term: (1/y) dy/dx = 1/x + (1/2) · 2/(2x + 1) − 1 − 3 cos x / sin x = 1/x + 1/(2x + 1) − 1 − 3 cot x.
- Multiply by y: dy/dx = [x√(2x + 1) / (ex sin³x)] · [1/x + 1/(2x + 1) − 1 − 3 cot x].
Doing this with the quotient rule would need the product rule inside it twice; logs make it four short terms.
A bonus: the power rule for any exponent
The same method proves the power rule for any real r: if y = xr, then ln y = r ln x, so (1/y) dy/dx = r/x and dy/dx = r xr−1.
Things to watch
- The log of y only exists where y > 0. For functions that can be negative, take ln|y|; the derivative comes out the same.
- Don't forget the final step: multiply by y and write it in terms of x.
Check answers with the derivative calculator, and see the function and its slope on the graphing calculator.
Source: OpenStax Calculus Volume 1, 3.9 Derivatives of Exponential and Logarithmic Functions.
Every worked example on this page was checked with Calcist's own engine and an independent reference.