Differentiate the outside function, keep the inside unchanged, then multiply by the derivative of the inside.
\[\left(f \circ g\right)' = f'(g)\,g'\]
What it says
When one function is applied to another, the rates of change multiply. If \(y\) changes three times as fast as \(u\), and \(u\) changes twice as fast as \(x\), then \(y\) changes six times as fast as \(x\). In Leibniz notation the statement is almost self-evident: \(\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}\).
The practical procedure is: identify the outer function and the inner one, differentiate the outer while leaving the inner argument exactly as it is, then multiply by the derivative of the inner. The factor \(g'\) is the part most often forgotten.
Chains can nest to any depth. For \(\sin\!\left(\sqrt{x^{2}+1}\right)\) you peel one layer at a time, multiplying a new factor at each step.
When it applies
A function is applied to something more complicated than the bare variable.
Any composite: \(\sin(3x)\), \(e^{x^{2}}\), \(\ln(1 + x^{2})\), \((2x + 1)^{5}\).
Whenever an inner expression would need a rule of its own to differentiate.
Five worked examples
Every line is the step the calculator would show, in the order it applies them. Each graph
is live: hover it to read both curves and see the tangent whose slope is the derivative,
drag to pan, scroll to zoom.
1
Example 1
\[\frac{d}{dx}\left[\sin\left(3 x\right)\right]\]
Outer is \(\sin\), inner is \(u = 3x\). Differentiate the outer, keeping \(3x\) inside.
Three full oscillations of f in the space \(\sin x\) would take for one, and a derivative reaching \(\pm 3\) rather than \(\pm 1\). The two curves stay a quarter of a compressed period apart the whole way along.
Without the factor \(3\) the answer would be wrong by a factor of three — the classic chain-rule slip.