← Skill tree MathScape MATH162

Logarithmic Differentiation

Reference: Stewart §6.4

When Standard Techniques Fail

Try differentiating this function using the quotient and chain rules:

$$y = \frac{x^{2/3}(x^2 + 9)^{1/4}}{(5x - 1)^3}$$

You can do it, but it's a nightmare of nested applications. Now consider this:

$$y = x^x$$

Here, both the base AND the exponent are variable. The power rule doesn't apply (it needs a constant exponent). The exponential rule doesn't apply (it needs a constant base). What do we do?

Logarithmic differentiation handles both situations elegantly. By taking the natural log of both sides first, we transform:

This simplifies the differentiation dramatically.


Prerequisite Map

Prerequisitesentry point
This skillLogarithmic Differentiation
Leads tono further branch yet

Before You Start

Can you expand logarithms?

Test: Expand $\ln\left(\frac{x^3 \sqrt{y}}{z^2}\right)$.

Answer: $3\ln x + \frac{1}{2}\ln y - 2\ln z$

Remember:

  • $\ln(ab) = \ln a + \ln b$
  • $\ln(a/b) = \ln a - \ln b$
  • $\ln(a^n) = n \ln a$
Can you differentiate implicitly?

Test: If $\ln y = x^2$, find $\frac{dy}{dx}$.

Answer: Differentiating both sides: $\frac{1}{y}\frac{dy}{dx} = 2x$, so $\frac{dy}{dx} = 2xy$.


Quick Reference

The Four Steps of Logarithmic Differentiation:

Step Action Example
1 Take $\ln$ of both sides $\ln y = \ln[x^x]$
2 Expand using log rules $\ln y = x \ln x$
3 Differentiate implicitly $\frac{1}{y}\frac{dy}{dx} = \ln x + 1$
4 Solve for $\frac{dy}{dx}$ $\frac{dy}{dx} = y(\ln x + 1) = x^x(\ln x + 1)$

When to use it:


Key Concepts

The Method in Detail

Given: $y = f(x)$ (some complicated function)

Step 1: Take natural log of both sides $$\ln y = \ln f(x)$$

(If $f(x)$ can be negative, use $\ln\vert y\vert = \ln\vert f(x)\vert $ instead.)

Step 2: Simplify using logarithm properties $$\ln(ab) = \ln a + \ln b$$ $$\ln(a/b) = \ln a - \ln b$$ $$\ln(a^n) = n \ln a$$

Step 3: Differentiate both sides implicitly

The left side always becomes $\frac{1}{y}\frac{dy}{dx}$.

Step 4: Solve for $\frac{dy}{dx}$ $$\frac{dy}{dx} = y \cdot (\text{what you got from differentiating})$$

Then substitute back $y = f(x)$.

The Four Cases of Bases and Exponents

Case Form Rule Example
1 $b^n$ (both constant) Derivative is 0 $\frac{d}{dx}(5^3) = 0$
2 $[f(x)]^n$ (variable base, constant exponent) Power rule $\frac{d}{dx}[(\sin x)^3] = 3(\sin x)^2 \cos x$
3 $b^{g(x)}$ (constant base, variable exponent) Exponential rule $\frac{d}{dx}(2^x) = 2^x \ln 2$
4 $[f(x)]^{g(x)}$ (both variable) Logarithmic differentiation $\frac{d}{dx}(x^x) = x^x(\ln x + 1)$

Case 4 is the new territory. Neither the power rule nor the exponential rule applies when both base and exponent vary.

Why It Works

Logarithmic differentiation exploits the fact that $\frac{d}{dx}(\ln y) = \frac{1}{y}\frac{dy}{dx}$.

This means: the derivative of a function divided by the function itself equals the derivative of its logarithm.

For $y = f(x)$: $$\frac{y'}{y} = \frac{d}{dx}(\ln y)$$

Rearranging: $y' = y \cdot \frac{d}{dx}(\ln y)$


Practice Problems

Level 2 Variable Base and Exponent

Find $\frac{dy}{dx}$ if $y = x^x$ for $x > 0$.

Thought Process

This is Case 4: both base ($x$) and exponent ($x$) are variable.

Take $\ln$ of both sides: $\ln y = x \ln x$

Differentiate implicitly using the product rule on the right side.

Show Answer

Step 1: $\ln y = \ln(x^x) = x \ln x$

Step 2: Already simplified.

Step 3: Differentiate implicitly: $$\frac{1}{y}\frac{dy}{dx} = 1 \cdot \ln x + x \cdot \frac{1}{x} = \ln x + 1$$

Step 4: Solve for $\frac{dy}{dx}$: $$\frac{dy}{dx} = y(\ln x + 1) = x^x(\ln x + 1)$$

Verification: At $x = 1$: $y = 1^1 = 1$, $y' = 1(\ln 1 + 1) = 1(0 + 1) = 1$. ✓

Level 3 Complicated Quotient

Find $\frac{dy}{dx}$ if $y = \frac{x^{2/3}(x^2 + 9)^{1/4}}{(5x - 1)^3}$.

Thought Process

This product/quotient would be tedious with standard rules. Logarithmic differentiation turns it into simple addition.

Take $\ln$: $\ln y = \frac{2}{3}\ln x + \frac{1}{4}\ln(x^2+9) - 3\ln(5x-1)$

Now differentiate each term separately using $\frac{d}{dx}[\ln u] = \frac{u'}{u}$.

Show Answer

Step 1: Take ln of both sides: $$\ln y = \ln\left(\frac{x^{2/3}(x^2 + 9)^{1/4}}{(5x - 1)^3}\right)$$

Step 2: Expand using log rules: $$\ln y = \frac{2}{3}\ln x + \frac{1}{4}\ln(x^2 + 9) - 3\ln(5x - 1)$$

Step 3: Differentiate each term: $$\frac{1}{y}\frac{dy}{dx} = \frac{2}{3} \cdot \frac{1}{x} + \frac{1}{4} \cdot \frac{2x}{x^2+9} - 3 \cdot \frac{5}{5x-1}$$

$$= \frac{2}{3x} + \frac{x}{2(x^2+9)} - \frac{15}{5x-1}$$

Step 4: Solve for $\frac{dy}{dx}$: $$\frac{dy}{dx} = \frac{x^{2/3}(x^2 + 9)^{1/4}}{(5x - 1)^3}\left(\frac{2}{3x} + \frac{x}{2(x^2+9)} - \frac{15}{5x-1}\right)$$

Check your work: Verify the domain requires $x > 0$ and $x > \frac{1}{5}$, so $x > \frac{1}{5}$.

Level 3 Trig Function to a Power

Differentiate $y = (\cos x)^x$ for $x$ where $\cos x > 0$.

Thought Process

Both base ($\cos x$) and exponent ($x$) are variable.

$\ln y = x \ln(\cos x)$

Use the product rule when differentiating the right side.

Show Answer

Step 1: $\ln y = x \ln(\cos x)$

Step 3: Differentiate: $$\frac{1}{y}\frac{dy}{dx} = 1 \cdot \ln(\cos x) + x \cdot \frac{-\sin x}{\cos x}$$

$$= \ln(\cos x) - x\tan x$$

Step 4: $$\frac{dy}{dx} = (\cos x)^x[\ln(\cos x) - x\tan x]$$

Level 4 Nested Exponent

Find $\frac{dy}{dx}$ if $y = x^{1/x}$ for $x > 0$.

Thought Process

$\ln y = \frac{1}{x} \ln x = \frac{\ln x}{x}$

Differentiate the right side using the quotient rule.

Show Answer

Step 1: $\ln y = \frac{\ln x}{x}$

Step 3: Differentiate using quotient rule: $$\frac{1}{y}\frac{dy}{dx} = \frac{x \cdot \frac{1}{x} - \ln x \cdot 1}{x^2} = \frac{1 - \ln x}{x^2}$$

Step 4: $$\frac{dy}{dx} = x^{1/x} \cdot \frac{1 - \ln x}{x^2}$$

Note: This equals 0 when $\ln x = 1$, i.e., at $x = e$. This means $y = x^{1/x}$ has a maximum at $x = e$, where $y = e^{1/e} \approx 1.445$.

Level 4 Alternative Method

Differentiate $y = x^{\ln x}$ for $x > 0$ using BOTH: (a) Logarithmic differentiation (b) Rewriting as $e^{(\ln x)^2}$

Verify you get the same answer.

Thought Process

(a) Take $\ln$ of both sides: $\ln y = (\ln x)(\ln x) = (\ln x)^2$. Then differentiate.

(b) Since $a^b = e^{b\ln a}$, write $x^{\ln x} = e^{(\ln x)(\ln x)} = e^{(\ln x)^2}$. Then use the chain rule: $\frac{d}{dx}(e^u) = e^u \cdot u'$.

Show Answer

(a) Logarithmic differentiation:

$\ln y = (\ln x)(\ln x) = (\ln x)^2$

Differentiate using the chain rule on $(\ln x)^2$:

$$\frac{1}{y}\frac{dy}{dx} = 2(\ln x) \cdot \frac{1}{x} = \frac{2\ln x}{x}$$

$$\frac{dy}{dx} = y \cdot \frac{2\ln x}{x} = x^{\ln x} \cdot \frac{2\ln x}{x}$$

(b) Exponential rewriting:

$y = e^{(\ln x)^2}$

Let $u = (\ln x)^2$. Then $y = e^u$, so $\frac{dy}{dx} = e^u \cdot \frac{du}{dx}$.

$$\frac{du}{dx} = 2(\ln x) \cdot \frac{1}{x} = \frac{2\ln x}{x}$$

$$\frac{dy}{dx} = e^{(\ln x)^2} \cdot \frac{2\ln x}{x} = x^{\ln x} \cdot \frac{2\ln x}{x}$$

Same answer!

Interesting observation: At $x = 1$: $y = 1^0 = 1$ and $y' = 1 \cdot \frac{2 \cdot 0}{1} = 0$. At $x = e$: $y = e^1 = e$ and $y' = e \cdot \frac{2 \cdot 1}{e} = 2$.

Level 5 Prove the General Power Rule

Use logarithmic differentiation to prove that $\frac{d}{dx}(x^n) = nx^{n-1}$ for ANY real number $n$ (not just integers).

Thought Process

Let $y = x^n$ where $n$ is any real constant.

Take ln: $\ln y = n \ln x$ (for $x > 0$)

Differentiate and solve for $y'$.

Show Answer

Let $y = x^n$ where $n$ is any real number and $x > 0$.

Step 1: $\ln\vert y\vert = \ln\vert x^n\vert = n\ln\vert x\vert $

Step 3: Differentiate: $$\frac{y'}{y} = \frac{n}{x}$$

Step 4: Solve for $y'$: $$y' = y \cdot \frac{n}{x} = x^n \cdot \frac{n}{x} = nx^{n-1}$$

Why this matters: We originally proved the power rule only for integer $n$, then extended it to rational $n$ using implicit differentiation. Logarithmic differentiation proves it for ALL real $n$ in one step, including irrational exponents like $\pi$ or $\sqrt{2}$.


When to Use Logarithmic Differentiation

Use it when:

  1. Both base and exponent are variable: $[f(x)]^{g(x)}$
  2. Products with many factors: $f_1 \cdot f_2 \cdot f_3 \cdots$
  3. Complex quotients: $\frac{f_1 \cdot f_2}{f_3 \cdot f_4}$
  4. You want to avoid nested chain rules

Don't use it when:

  1. The function is already simple (e.g., $x^3$, $e^x$, $\ln x$)
  2. Only the base OR only the exponent is variable (use power rule or exponential rule)
  3. The function involves addition/subtraction at the outer level ($\ln(a+b) \neq \ln a + \ln b$!)

Common Mistakes

Mistake Why It's Wrong Correct Approach
Using on $y = x^2 + x$ $\ln(x^2 + x) \neq \ln(x^2) + \ln(x)$ Log rules only work for products/quotients
Forgetting to substitute back Answer has $y$ in it Replace $y$ with original function
Missing the $\frac{1}{y}$ on the left Implicit differentiation of $\ln y$ gives $\frac{1}{y} \cdot \frac{dy}{dx}$ Always include the $\frac{1}{y}$ factor
Applying to $f(x) < 0$ without care $\ln$ of negative number undefined Use $\ln\|y\| = \ln\|f(x)\|$ when needed

Mastery Checklist


Mental Model

"Log, Expand, Differentiate, Substitute"

  1. Log: Take $\ln$ of both sides
  2. Expand: Use $\ln(ab) = \ln a + \ln b$, $\ln(a^n) = n\ln a$
  3. Differentiate: Implicitly (remember $\frac{1}{y}\frac{dy}{dx}$ on the left)
  4. Substitute: Replace $y$ with original expression

The key insight: Logarithms convert multiplication to addition and powers to multiplication, both of which are easier to differentiate.


Connections

Looking back:

Looking ahead:

Real-world applications:


Previous Up Next
e as a Limit Section 6.4 Section 6.5

Last updated: 2026-01-23