Calculus 1Differentiation Rules

Chain Rule with Several Layers

Peel a composition from the outside in.

Not started Jump to practice

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

For $y = f\big(g(h(x))\big)$: $$y' = f'\big(g(h(x))\big)\cdot g'\big(h(x)\big)\cdot h'(x).$$ One factor per layer. Each layer is differentiated at whatever sits inside it, and the inside is copied unchanged.

Why it works

Group the layers in two: $y = f(v)$ with $v = g(h(x))$. The chain rule gives $y' = f'(v)\cdot v'$. Now $v$ is itself a composition, so the chain rule again gives $v' = g'(h(x))\cdot h'(x)$. Substituting produces the three-factor product. In rate language: three gears in a row, three ratios multiplied.
Peeling $\sin^3(2x) = \big(\sin(2x)\big)^3$: multiply the last column.
Layer (outside in)FunctionIts derivative, at its inside
outer$(\,\cdot\,)^3$$3\sin^2(2x)$
middle$\sin(\,\cdot\,)$$\cos(2x)$
inner$2x$$2$
$x \to u = \sin(2x) \to y = u^3$. The middle stretch already contains two layers ($\sin$ and $2x$), so the total is three factors.

Worked example: Three layers

Differentiate $\sin^3(2x)$.
  1. Rewrite: $\big(\sin(2x)\big)^3$. Layers: cube, sine, $2x$.
  2. $3\sin^2(2x)\cdot\cos(2x)\cdot 2$.

Answer: $6\sin^2(2x)\cos(2x)$

Worked example: A power inside a power

Differentiate $\big(1 + (2x + 1)^3\big)^4$.
  1. Layers: $(\,\cdot\,)^4$, then $1 + (\,\cdot\,)^3$, then $2x + 1$.
  2. $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

Differentiate $\cos\left(\sqrt{x^2 + 1}\right)$.
  1. Layers: cosine, square root, $x^2 + 1$.
  2. $-\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

Stopping after two layers, for example $\frac{d}{dx}\sin^3(2x) = 3\sin^2(2x)\cos(2x)$ (the factor 2 is missing), or differentiating the same layer twice. Check: count the layers before you start, and make sure your answer has exactly that many factors.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Calculus 1: Limits and Derivatives.

Sources and further reading

  • OpenStax Calculus Volume 1, 3.6 The Chain Rule
@teddyrookbook GitHub