Differentiation: Advanced Technique

Logarithmic
Differentiation

When a variable sits in the exponent, or a function is a tangle of products and quotients, the power and quotient rules fall short. Taking a logarithm first turns multiplication into addition, and makes the impossible derivative easy.

Variable exponents Products & quotients 8 worked examples
Share this page

§ 01Why Do We Need This?

The power rule differentiates x raised to a constant. It cannot handle a variable raised to a variable, and that is exactly where logarithmic differentiation steps in.

Consider the function y = xx. It looks similar to xn, but the exponent itself depends on x. Neither the power rule (which needs a constant exponent) nor the exponential rule (which needs a constant base) applies directly. The same problem shows up whenever you must differentiate a product or quotient of many factors, since repeatedly applying the product rule becomes long and error-prone.

The core idea Taking the natural log of both sides converts a product into a sum, a quotient into a difference, and a power into a coefficient — all of which are far easier to differentiate term by term.
The three situations where it shines
1) y = f(x)g(x)    (variable base and variable exponent)
2) y = f₁(x)·f₂(x)···fₙ(x)    (long products)
3) y = f(x)/g(x)    when several quotients or roots are nested together

None of these are new functions to learn, logarithmic differentiation is a technique for organising work you already know how to do (implicit differentiation and the chain rule), applied after taking a logarithm.

§ 02Derivation — Why Taking Logarithms Works

The method relies on one identity from logarithms and one application of implicit differentiation.

Start with any positive function y = f(x) and take the natural log of both sides:

Step 1 — take ln of both sides
ln y = ln[f(x)]

Now differentiate both sides with respect to x. The left side needs the chain rule, since y is itself a function of x:

Derivation Differentiating ln y implicitly
d/dx[ln y] = (1/y)·y′
chain rule: derivative of ln(u) is u′/u, with u = y
(1/y)·y′ = d/dx[ln f(x)]
right side differentiated normally
y′ = y · d/dx[ln f(x)]
multiply both sides by y
y′ = f(x) · d/dx[ln f(x)]
substitute y = f(x) back in

That last line is the entire trick in one formula: differentiate the log of the function, then multiply by the original function. The payoff comes from log rules, which turn the right-hand side into something simple before you differentiate it.

The three log rules that do the heavy lifting ln(ab) = ln a + ln b   •   ln(a/b) = ln a − ln b   •   ln(an) = n·ln a. Apply these to ln f(x) before differentiating, and a nightmare product or a variable exponent becomes a short sum you can differentiate term by term.

§ 03The 3-Step Method

Every logarithmic differentiation problem follows the same three moves, regardless of how complicated f(x) looks.

Logarithmic Differentiation — 3 Steps

  1. Take ln of both sides and expand using log rules. ln y = ln f(x)  →  expand products, quotients, and powers into sums
  2. Differentiate both sides with respect to x. The left side always gives y′/y (chain rule). Differentiate the expanded right side term by term.
  3. Multiply both sides by y, then substitute the original f(x) back in. y′ = y · [expanded derivative] = f(x) · [expanded derivative] The final answer should be written entirely in terms of x, not y.
⚠ Domain reminder ln y is only defined when y > 0. If f(x) can be negative, work with ln|y| = ln|f(x)| instead — the derivative formula that follows is identical, since d/dx[ln|u|] = u′/u just like d/dx[ln u].

§ 04The Variable-Exponent Case: y = f(x)g(x)

This is the signature use of logarithmic differentiation, a case the power rule and exponential rule cannot touch on their own.

Applying the log rule ln(an) = n·ln a to y = f(x)g(x) gives:

Step 1
ln y = g(x)·ln[f(x)]

Differentiating the right side now needs the product rule (since g(x) and ln f(x) are both functions of x), plus the chain rule on ln f(x):

Step 2
y′/y  =  g′(x)·ln[f(x)] + g(x)·[f′(x)/f(x)]
Step 3 — general formula for f(x)g(x)
y′  =  f(x)g(x) · [ g′(x)ln f(x) + g(x)f′(x)/f(x) ]
Special case: y = xx Here f(x) = x and g(x) = x, so f′ = g′ = 1. Substituting: y′ = xx[1·ln x + x·(1/x)] = xx(ln x + 1). This single result is one of the most commonly tested applications of the method.

§ 05Formula Lookup Tool

Pick a common variable-exponent form and see the differentiated result instantly, derived by the method above.

y = f(x)g(x) — Common Forms

Result

§ 06Worked Examples

Eight examples spanning variable exponents, long products, and quotients with roots.

Example 1 y = x^x — the classic case Pure

Differentiate: y = xx  (x > 0)

Step 1 — take ln, expand
ln y = x ln x
Step 2 — differentiate (product rule on the right)
y′/y = ln x + x·(1/x) = ln x + 1
Step 3 — multiply by y = x^x
y′ = xx(ln x + 1)
y′ = x^x (ln x + 1)
Example 2 y = x^(sin x) — variable base and trig exponent Pure

Differentiate: y = xsin x  (x > 0)

Step 1
ln y = sin x · ln x
Step 2 — product rule
y′/y = cos x · ln x + sin x · (1/x)
Step 3
y′ = xsin x [ cos x · ln x + (sin x)/x ]
y′ = x^(sin x) [cos x ln x + (sin x)/x]
Example 3 y = (sin x)^x — trig base, variable exponent Pure

Differentiate: y = (sin x)x  (0 < x < π)

Step 1
ln y = x · ln(sin x)
Step 2 — product rule; chain rule on ln(sin x)
y′/y = ln(sin x) + x · (cos x/sin x) = ln(sin x) + x·cot x
Step 3
y′ = (sin x)x [ ln(sin x) + x·cot x ]
y′ = (sin x)^x [ln(sin x) + x cot x]
Example 4 A long product of three factors Pure

Differentiate: y = x·(x+1)·(x+2) using logarithmic differentiation.

Step 1 — ln turns the product into a sum
ln y = ln x + ln(x+1) + ln(x+2)
Step 2 — differentiate term by term
y′/y = 1/x + 1/(x+1) + 1/(x+2)
Step 3 — multiply by y
y′ = x(x+1)(x+2) [ 1/x + 1/(x+1) + 1/(x+2) ]
y′ = x(x+1)(x+2)[1/x + 1/(x+1) + 1/(x+2)]

Expanding by the product rule directly would need three applications of the two-factor rule; the log method needs only one differentiation pass.

Example 5 A quotient with a square root Pure

Differentiate: y = √(x²+1) / (x+3)²

Step 1 — write the root as a power, then expand
ln y = ½ln(x²+1) − 2ln(x+3)
Step 2 — differentiate
y′/y = ½·(2x)/(x²+1) − 2/(x+3) = x/(x²+1) − 2/(x+3)
Step 3 — multiply by y
y′ = [ √(x²+1)/(x+3)² ] · [ x/(x²+1) − 2/(x+3) ]
y′ = [√(x²+1)/(x+3)²]·[x/(x²+1) − 2/(x+3)]
Example 6 y = (x²+1)^x — polynomial base Pure

Differentiate: y = (x²+1)x

Step 1
ln y = x · ln(x²+1)
Step 2 — product rule, chain rule on ln(x²+1)
y′/y = ln(x²+1) + x·(2x)/(x²+1) = ln(x²+1) + 2x²/(x²+1)
Step 3
y′ = (x²+1)x [ ln(x²+1) + 2x²/(x²+1) ]
y′ = (x²+1)^x [ln(x²+1) + 2x²/(x²+1)]
Example 7 Numeric evaluation at a point Applied

For y = xx, find y′(1) and y′(e).

Use y′ = x^x(ln x + 1) from Example 1
y′(1) = 1¹(ln 1 + 1) = 1·(0+1) = 1 y′(e) = ee(ln e + 1) = ee(1+1) = 2ee
y′(1) = 1;   y′(e) = 2e^e ≈ 30.19

Notice y′(1) = 1 confirms the graph of x^x is momentarily as steep as the line y = x at that point.

Example 8 Combined product, quotient, and power Pure

Differentiate: y = [x²(x−1)³] / (x+4)

Step 1
ln y = 2ln x + 3ln(x−1) − ln(x+4)
Step 2
y′/y = 2/x + 3/(x−1) − 1/(x+4)
Step 3
y′ = [x²(x−1)³/(x+4)] · [2/x + 3/(x−1) − 1/(x+4)]
y′ = [x²(x−1)³/(x+4)]·[2/x + 3/(x−1) − 1/(x+4)]

§ 07Common Mistakes

⚠ Using the power rule on a variable exponent Writing d/dx[x^x] = x·x^(x−1) is wrong — the power rule requires a constant exponent. Whenever the exponent contains x, logarithmic differentiation (or the general exponent rule derived from it) is required.
⚠ Forgetting to expand ln f(x) before differentiating The whole benefit of the method disappears if you differentiate ln[x(x+1)(x+2)] directly with the chain rule instead of first expanding it to ln x + ln(x+1) + ln(x+2). Always expand first.
⚠ Leaving y in the final answer The derivative must be expressed in terms of x only. After multiplying by y in Step 3, always substitute the original expression for y back in — do not leave "y′ = y · (...)" as a final answer.
⚠ Sign errors with quotients ln(a/b) = ln a − ln b, not ln a + ln b. A quotient of many factors needs a minus sign on the denominator's log term, and that sign must carry through Step 2 into the derivative.
⚠ Ignoring the domain ln y requires y > 0. If the original function can be negative (e.g. y = x·(x−3) for 0 < x < 3), use ln|y| instead; the derivative formula is unaffected but the domain restriction should be stated.

§ 08Practice Quiz — 10 Questions

Apply the 3-step method. Some questions ask for the intermediate step, others for the final derivative.

Score: 0 / 0
Question 1 — Expanding ln y

For y = x³(x+1)², what is ln y after expansion?

Question 2 — Derivative of ln y

The derivative of ln y with respect to x (where y is a function of x) is:

Question 3 — y = x^x at x = 1

Using y′ = x^x(ln x + 1), find y′(1).

1^1 = 1, and ln 1 = 0.
Question 4 — Log rule

ln(a/b) equals:

Question 5 — General exponent formula

For y = f(x)^g(x), the correct formula for y′/y is:

  1. ln y = g(x)ln f(x)
  2. Differentiate with the product rule on the right: y′/y = g′(x)ln f(x) + g(x)·f′(x)/f(x)
Question 6 — Coefficient from a root

If y = √(x+5), then ln y = ½ln(x+5). What is y′/y?

Differentiate ½ln(x+5): the derivative is ½ · 1/(x+5).
Question 7 — Sign of the quotient term

For y = x/(x+2), logarithmic differentiation gives ln y = ln x − ln(x+2). What is y′/y?

Question 8 — (sin x)^x at a special point

Using y′ = (sin x)^x[ln(sin x) + x·cot x], what happens as x → 0⁺ (does y′ stay finite, or blow up)?

  1. As x → 0⁺, sin x → 0⁺, so ln(sin x) → −∞.
  2. Although (sin x)^x → 1 in that limit, the ln(sin x) term dominates and the product diverges, a reminder to check domains and limits, not just algebra.
Question 9 — Choosing the technique

Which function requires logarithmic differentiation rather than the ordinary power or exponential rule?

Question 10 — Full derivative

For y = (x²+1)x, evaluate y′(0) using y′ = (x²+1)^x[ln(x²+1) + 2x²/(x²+1)].

At x=0: (0+1)^0 = 1, ln(1) = 0, and 2(0)²/(0²+1) = 0.

§ 09What to Study Next

Logarithmic differentiation is the natural companion to implicit differentiation and the chain rule. Continue with:

Cookie Settings