When you need it
You need the chain rule whenever the thing you're differentiating is a composition — one function wrapped around another.
- sin(x) — just a sine. Derivative is cos(x). No chain rule.
- sin(x²) — a sine wrapped around x². Something sits inside the sine, so the chain rule applies.
The test: if you can point at a piece sitting inside brackets, inside a root, or inside a function, and that piece is anything more complicated than plain x, you need the chain rule.
The rule itself
If y = f(g(x)), then:
In words, and this is the version worth memorising: differentiate the outside, leave the inside alone, then multiply by the derivative of the inside.
That final multiplication is the entire point of the rule, and it's the part people forget. Nearly every chain rule mistake is some version of dropping the g′(x).
Before differentiating, write two lines: "outer = …" and "inner = …". It takes five seconds and makes the rest almost impossible to get wrong. You'll skip it after fifty of these — but not before.
Six worked examples
1. A power of something
Outer is "something to the fifth," inner is 3x + 1. Differentiate the outside: 5(3x+1)4. Derivative of the inside: 3.
2. A trig function of something
Outer is sine, inner is x². Derivative of sine is cosine with the inside untouched: cos(x²). Derivative of the inside: 2x.
This is not cos(2x). A common slip is differentiating the inside and leaving the result inside the outer function. The inside stays exactly as it was.
3. e to the power of something
The derivative of eu is eu — the outer function is unchanged. Then multiply by the derivative of x²:
4. A square root
Rewrite the root as a power first, which turns it into an ordinary version of example 1:
5. A log of something
The derivative of ln(u) is 1/u, giving 1/(5x). Then multiply by the derivative of 5x, which is 5:
The 5 cancels entirely — and that's a useful sanity check in itself, since ln(5x) = ln 5 + ln x, and ln 5 is just a constant.
6. A function inside a trig function
Don't let the look of it put you off. Outer is sine, inner is cos x. Nothing about the method changes.
Functions inside functions inside functions
With three layers, apply the rule twice — the pattern just extends:
Work strictly outside-in, peeling one layer at a time, and multiply everything at the end. Resist simplifying partway through — finish differentiating first, tidy up second.
Three mistakes that lose marks
- Forgetting the inner derivative. Writing d/dx sin(x²) = cos(x²) and stopping. By far the most common error, and exactly the step the rule exists for.
- Differentiating the inside in place. Writing cos(2x) instead of 2x cos(x²). The inner function stays untouched; its derivative appears as a separate multiplying factor.
- Missing a hidden composition. (2x+1)3, √(3x), and e−x are all compositions despite looking simple. e−x differentiates to −e−x, not e−x.
All three are catchable. Differentiation is reversible, so if you're unsure, integrate your answer and see whether you land back where you started — or test the original and your derivative numerically at a convenient value like x = 1. More checks like this in how to check if your answer is right.
Practice problems
Differentiate each. Tap to check.
- d/dx (5x − 2)4
Show answer
20(5x − 2)3
- d/dx cos(3x²)
Show answer
−6x sin(3x²)
- d/dx esin x
Show answer
cos x · esin x
- d/dx ln(x² + 1)
Show answer
2x/(x² + 1)
- d/dx √(4 − x²)
Show answer
−x/√(4 − x²)
Stuck mid-derivative?
Scan the problem with Aheadia for the full working, step by step — and ask follow-up questions when a line doesn't make sense.
Download free on iOS