The chain rule
Theory
The chain rule differentiates a composite function — a function of a function. If \(y=g(u)\) where \(u=f(x)\), then \(\dfrac{dy}{dx}=\dfrac{dy}{du}\times\dfrac{du}{dx}\): differentiate the outer function, then multiply by the derivative of the inside. It extends every standard derivative to powers, exponentials, logarithms and trig composites — the one thing never to forget is the inner factor \(f'(x)\).
A composite function is built in two stages: first \(x\mapsto u=f(x)\) (the inner function), then \(u\mapsto y=g(u)\) (the outer function). For example \(y=(3x^2+1)^5\) has inner \(u=3x^2+1\) and outer \(y=u^5\); \(y=e^{x^2}\) has inner \(x^2\) and outer \(e^{u}\).
The chain rule says the overall rate of change is the product of the rate of each stage: \(\dfrac{dy}{dx}=\dfrac{dy}{du}\times\dfrac{du}{dx}\). In practice this means: differentiate the outer function (leaving the inside alone), then multiply by the derivative of the inside, \(f'(x)\).
Applied to the standard functions it gives \(\dfrac{d}{dx}(f)^n=n(f)^{n-1}f'\), \(\dfrac{d}{dx}e^{f}=f'e^{f}\), \(\dfrac{d}{dx}\ln f=\dfrac{f'}{f}\), \(\dfrac{d}{dx}\sin f=f'\cos f\) and \(\dfrac{d}{dx}\cos f=-f'\sin f\). Answers should be written in simplest and factorised form.
The chain rule (Leibniz form) for a composite \(y=g(u)\), \(u=f(x)\):
Power of a function (reduce the index, then multiply by \(f'\)):
Exponential and logarithmic composites:
Trigonometric composites:
How to apply the chain rule
- Spot the composite. Identify the inner function \(u=f(x)\) and the outer function \(y=g(u)\).
- Differentiate the outer. Find \(\dfrac{dy}{du}\), leaving the inside unchanged (e.g. \(\dfrac{d}{du}u^{n}=nu^{n-1}\), \(\dfrac{d}{du}e^{u}=e^{u}\)).
- Differentiate the inner. Find \(\dfrac{du}{dx}=f'(x)\) — this is the factor most often forgotten.
- Multiply and factorise. \(\dfrac{dy}{dx}=\dfrac{dy}{du}\times\dfrac{du}{dx}\); write \(u\) back in terms of \(x\) and take out any common factor.
Composite: inner \(u=3x^2+1\), outer \(y=u^{5}\).
| \(\dfrac{du}{dx}\) | \(=\) | \(6x\) |
| \(\dfrac{dy}{du}\) | \(=\) | \(5u^{4}\) |
| \(=\) | \(5(3x^2+1)^{4}\) |
| \(\dfrac{dy}{dx}\) | \(=\) | \(5(3x^2+1)^{4}\times 6x\) |
| \(=\) | \(30x(3x^2+1)^{4}\) |
Composite: inner \(u=x^{2}\), outer \(y=e^{u}\).
| \(\dfrac{du}{dx}\) | \(=\) | \(2x\) |
| \(\dfrac{dy}{du}\) | \(=\) | \(e^{u}\) |
| \(=\) | \(e^{x^2}\) |
| \(\dfrac{dy}{dx}\) | \(=\) | \(e^{x^2}\times 2x\) |
| \(=\) | \(2x\,e^{x^2}\) |
Composite: inner \(u=4x^{2}+1\), outer \(y=\ln u\).
| \(\dfrac{du}{dx}\) | \(=\) | \(8x\) |
| \(\dfrac{dy}{du}\) | \(=\) | \(\dfrac{1}{u}\) |
| \(=\) | \(\dfrac{1}{4x^2+1}\) |
| \(\dfrac{dy}{dx}\) | \(=\) | \(\dfrac{1}{4x^2+1}\times 8x\) |
| \(=\) | \(\dfrac{8x}{4x^2+1}\) |
Composite: inner \(u=2x\), outer \(y=\sin u\).
| \(\dfrac{du}{dx}\) | \(=\) | \(2\) |
| \(\dfrac{dy}{du}\) | \(=\) | \(\cos u\) |
| \(=\) | \(\cos(2x)\) |
| \(\dfrac{dy}{dx}\) | \(=\) | \(\cos(2x)\times 2\) |
| \(=\) | \(2\cos(2x)\) |
| \(\left.\dfrac{dy}{dx}\right|_{x=0}\) | \(=\) | \(2\cos 0\) |
| \(=\) | \(2\) |
| \(y-0\) | \(=\) | \(2(x-0)\) |
| \(y\) | \(=\) | \(2x\) |
Common pitfalls
Frequently asked questions
What is the chain rule?
It differentiates a composite \(y=g(u)\), \(u=f(x)\): \(\dfrac{dy}{dx}=\dfrac{dy}{du}\times\dfrac{du}{dx}\). Differentiate the outer function, then multiply by the derivative of the inside.
How do you differentiate a power of a polynomial?
Use \(\dfrac{d}{dx}(f)^n=n(f)^{n-1}f'\). For example \(\dfrac{d}{dx}(3x^2+1)^5=5(3x^2+1)^4\times 6x=30x(3x^2+1)^4\).
How do you differentiate \(e^{f(x)}\)?
\(\dfrac{d}{dx}e^{f(x)}=f'(x)e^{f(x)}\): the exponential is unchanged and you multiply by the derivative of the exponent, e.g. \(\dfrac{d}{dx}e^{x^2}=2x\,e^{x^2}\).
How do you differentiate \(\ln(f(x))\)?
\(\dfrac{d}{dx}\ln(f(x))=\dfrac{f'(x)}{f(x)}\), e.g. \(\dfrac{d}{dx}\ln(4x^2+1)=\dfrac{8x}{4x^2+1}\).
How do you differentiate \(\sin\) and \(\cos\) of a function?
\(\dfrac{d}{dx}\sin(f)=f'\cos(f)\) and \(\dfrac{d}{dx}\cos(f)=-f'\sin(f)\), e.g. \(\dfrac{d}{dx}\sin(2x)=2\cos(2x)\).
What is the most common mistake?
Forgetting the inner factor \(f'(x)\). Always multiply by the derivative of the inside, and then factorise the result.