The Chain Rule
State and apply the Chain Rule: d/dx[f(g(x))] = f'(g(x))·g'(x). Recognize composite functions, identify inner and outer functions, and apply the chain rule in multiple layers for deeply nested compositions.
A lesson of Calculus, in The Chain Rule and Advanced Differentiation, about 10 minutes.
By the end of this lesson, you will be able to apply the Chain Rule to differentiate any composition of functions, recognize chains of multiple compositions, and combine the Chain Rule with Product and Quotient Rules.
The Chain Rule
If $h(x) = f(g(x))$, then:
$$h'(x) = f'(g(x)) \cdot g'(x)$$
"Derivative of the outside at the inside, times derivative of the inside."
Leibniz notation: If $y = f(u)$ and $u = g(x)$:
$$\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}$$
This notation makes the Chain Rule look like cancellation of $du$ — intuitive but not literally true.
The Pattern
For $[f(\text{stuff})]'$: apply $f'$ to "stuff", then multiply by the derivative of "stuff."
$$[(\text{stuff})^n]' = n(\text{stuff})^{n-1} \cdot (\text{stuff})'$$
$$[e^{\text{stuff}}]' = e^{\text{stuff}} \cdot (\text{stuff})'$$
$$[\sin(\text{stuff})]' = \cos(\text{stuff}) \cdot (\text{stuff})'$$
$$[\ln(\text{stuff})]' = \frac{1}{\text{stuff}} \cdot (\text{stuff})'$$
Example 1 — Basic Chain Rule
$f(x) = (3x^2 - 5)^7$
$= 7(3x^2-5)^6 \cdot 6x = 42x(3x^2-5)^6$
Example 2 — Chain Rule with Trig
$g(x) = \sin(4x^3)$
$= \cos(4x^3) \cdot 12x^2 = 12x^2\cos(4x^3)$
Example 3 — Nested Chain Rule
$h(x) = e^{\sin(x^2)}$
Outer: $e^u$; middle: $\sin(v)$; inner: $x^2$.
$h'(x) = e^{\sin(x^2)} \cdot \cos(x^2) \cdot 2x$
Example 4 — Chain + Product Rule
$k(x) = x^3 e^{2x}$
Product rule first: $3x^2 e^{2x} + x^3(e^{2x} \cdot 2) = x^2 e^{2x}(3 + 2x)$
Example 5 — Chain + Quotient Rule
$\dfrac{d}{dx}\left[\dfrac{\sin(3x)}{x^2+1}\right]$
$= \dfrac{3\cos(3x)(x^2+1) - \sin(3x)(2x)}{(x^2+1)^2}$
Example 6 — Logarithm of a Function
$\dfrac{d}{dx}[\ln(x^2+1)]$
$= \dfrac{1}{x^2+1} \cdot 2x = \dfrac{2x}{x^2+1}$
General Exponential and Logarithm with Chain Rule
$$\frac{d}{dx}[e^{g(x)}] = e^{g(x)} g'(x)$$
$$\frac{d}{dx}[\ln(g(x))] = \frac{g'(x)}{g(x)}$$
$$\frac{d}{dx}[a^{g(x)}] = a^{g(x)}\ln(a) \cdot g'(x)$$
Identifying the "Stuff"
The hardest part of the Chain Rule is recognizing the composition. Ask: "What is the outermost operation?"
$e^{3x-1}$: outer = $e^u$, inner = $3x-1$ → $(e^{3x-1})' = e^{3x-1} \cdot 3$