Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Logarithmic differentiation

Logarithmic differentiation means taking the natural log of both sides before differentiating. It's the way to differentiate functions like x^x, and it turns messy products and quotients into simple sums.

By the Calcist team · Updated October 26, 2026 · About a 5-minute read

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:

ln(ab) = ln a + ln b    ln(a/b) = ln a − ln b    ln(ar) = r ln a

Differentiating ln y with the chain rule gives (1/y) · dy/dx, which you then multiply by y.

The steps

  1. Take the natural log of both sides: ln y = ln(h(x)).
  2. Expand the right side with log rules as much as possible.
  3. Differentiate both sides. The left side becomes (1/y) dy/dx.
  4. Multiply both sides by y.
  5. Replace y with the original function.

Example 1: the derivative of xx (x > 0)

  1. y = xx, so ln y = ln(xx) = x ln x.
  2. Differentiate with the product rule: (1/y) dy/dx = 1 · ln x + x · (1/x) = ln x + 1.
  3. Multiply by y: dy/dx = y(ln x + 1).
  4. 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

  1. ln y = tan x · ln(2x4 + 1).
  2. Differentiate with the product and chain rules: (1/y) dy/dx = sec²x · ln(2x4 + 1) + tan x · 8x³/(2x4 + 1).
  3. Multiply by y: dy/dx = (2x4 + 1)tan x [sec²x · ln(2x4 + 1) + 8x³ tan x / (2x4 + 1)].

Example 3: a messy quotient

y = x√(2x + 1) / (ex sin³x)
  1. 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).
  2. 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.
  3. 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.

Questions people ask

What is logarithmic differentiation?

Taking the natural log of both sides of y = f(x), simplifying with log rules, differentiating implicitly, then multiplying by y.

When should I use logarithmic differentiation?

When a variable is in both the base and the exponent, like x^x, or for long products and quotients of functions.

What is the derivative of x^x?

x^x(ln x + 1), for positive x.

Why can't I use the power rule on x^x?

The power rule only works when the exponent is a constant. In x^x the exponent changes with x.