The The Chain Rule works for any number of layers: each layer contributes one factor. The skill is bookkeeping, peeling the function from the outside in.
Key idea
Why it works
| Layer (outside in) | Function | Its derivative, at its inside |
|---|---|---|
| outer | $(\,\cdot\,)^3$ | $3\sin^2(2x)$ |
| middle | $\sin(\,\cdot\,)$ | $\cos(2x)$ |
| inner | $2x$ | $2$ |
Worked example: Three layers
- Rewrite: $\big(\sin(2x)\big)^3$. Layers: cube, sine, $2x$.
- $3\sin^2(2x)\cdot\cos(2x)\cdot 2$.
Answer: $6\sin^2(2x)\cos(2x)$
Worked example: A power inside a power
- Layers: $(\,\cdot\,)^4$, then $1 + (\,\cdot\,)^3$, then $2x + 1$.
- $4\big(1 + (2x + 1)^3\big)^3 \cdot 3(2x + 1)^2 \cdot 2$.
Answer: $24(2x + 1)^2\big(1 + (2x + 1)^3\big)^3$
Worked example: Cosine of a root
- Layers: cosine, square root, $x^2 + 1$.
- $-\sin\left(\sqrt{x^2 + 1}\right)\cdot\frac{1}{2\sqrt{x^2 + 1}}\cdot 2x$.
Answer: $-\frac{x\sin\left(\sqrt{x^2 + 1}\right)}{\sqrt{x^2 + 1}}$
How to spot the layers
Imagine computing the function on a calculator for a given $x$. The last button you press is the outer layer; the first is the innermost. For $\cos\left(\sqrt{x^2 + 1}\right)$ you would square, add 1, take the root, then take the cosine. So the layers from outside in are cosine, root, and $x^2 + 1$. Write them in a short list before differentiating, then write one factor per item.
Common mistake