Hexa Scholar

Why the chain rule multiplies

When x goes into g and the result goes into f, how fast does f(g(x)) change?

For a short interval starting at the point, the signed ratio (change out)/(change in) tends to the derivative as the interval shrinks; a negative ratio means the image comes out flipped. The composite passes the interval through two functions in a row, and stage 1 asks you to predict the combined ratio before you measure it.

Before you start · 3 quick checks on zoomed-in slopes, linear approximation and composites, about 2 min
Setup

Let \(u = g(x)\) be the inner function and \(y = f(u)\) the outer one, so that the composite \(f \circ g\) sends \(x\) to \((f \circ g)(x) = f(g(x))\): first \(g\), then \(f\). Pick a point \(x_0\), put \(u_0 = g(x_0)\), and take a width \(\Delta x \gt 0\). The interval from \(x_0\) to \(x_0 + \Delta x\) has two images:

\[ \Delta u = g(x_0 + \Delta x) - g(x_0), \] \[ \Delta y = f(u_0 + \Delta u) - f(u_0). \]

The stretch factor of a step is the change out divided by the change in: \(\Delta u/\Delta x\) for \(g\), \(\Delta y/\Delta u\) for \(f\) (only when \(\Delta u \ne 0\)), and \(\Delta y/\Delta x\) for the composite.

Why a stretch factor can be negative

The changes \(\Delta u\) and \(\Delta y\) keep their signs. If \(g\) is decreasing near \(x_0\), then \(g(x_0 + \Delta x) \lt g(x_0)\): the image of the interval runs to the left, so it comes out flipped, and \(\Delta u/\Delta x \lt 0\). Its length is \(\lvert \Delta u\rvert\), so the factor's absolute value says how many times as long the image is, and its sign says whether it is flipped.

On this page the inner function never turns around inside the interval, and the outer one never turns around inside the image. Then the image of an interval is exactly the interval between the images of its two ends.

1 See

Predict the stretch, then measure it

Choose \(g\), \(f\), \(x_0\) and \(\Delta x\), then predict the signed stretch factor \(\Delta y/\Delta x\): how many times as long the \(y\)-interval is as the \(x\)-interval, negative if it comes out flipped. After you commit, the page draws the three intervals on one scale, shows each step's stretch factor, and lets you shrink \(\Delta x\) tenfold at a time.

Inner function u = g(x)
Outer function y = f(u)
Point x₀
Width Δx

A prediction counts as close when it is within 10% of the measured factor, or within 0.05 of it if that allows more. Type a decimal or a fraction such as 7/3.

2 Try

Reading and using the rule

Stage 1 found the chain rule: if \(g\) is differentiable at \(x\) and \(f\) is differentiable at \(g(x)\), then \((f \circ g)'(x) = f'(g(x))\,g'(x)\). Evaluate the outer derivative at the inner value.

Goals: where does sin(x²) flip or stop?

For \(y = \sin(x^2)\), the inner function is \(u = x^2\) with \(du/dx = 2x\), and the outer is \(y = \sin u\) with \(dy/du = \cos u\). Drag the point, or focus it and use the arrow keys. The tiles show both factors at \(x_0\) and their product.

Exponentials, logarithms and powers

Logarithmic differentiation

For \(x^x\) neither the power rule nor the rule for \(b^x\) applies, since both the base and the exponent move.

Key point \(\dfrac{dy}{dx} = \dfrac{dy}{du}\,\dfrac{du}{dx}\) is notation for \(f'(g(x))\,g'(x)\), not a cancellation of fractions. The sign and the zeros of a composite's derivative come from its two factors. Taking \(\ln\) first turns powers with a moving exponent, and products of powers, into sums that the chain rule and the product rule can handle.
3 Prove

A proof that never divides by Δu

The quick argument writes \(\dfrac{\Delta y}{\Delta x} = \dfrac{\Delta y}{\Delta u}\cdot\dfrac{\Delta u}{\Delta x}\) and lets \(\Delta x \to 0\). Stage 1's constant inner function already showed that \(\Delta u\) can be 0. Can that happen for small \(\Delta x\) when \(g\) is not constant?

Theorem (the chain rule)

Let \(I\) and \(J\) be open intervals, \(g\colon I \to J\) and \(f\colon J \to \mathbb{R}\), so \(f(g(x))\) is defined for every \(x\) in \(I\). Let \(x_0\) be in \(I\) and \(u_0 = g(x_0)\). Assume \(g\) is differentiable at \(x_0\) and \(f\) is differentiable at \(u_0\). For \(h \ne 0\) with \(x_0 + h\) in \(I\), write

\[ k(h) = g(x_0+h) - g(x_0), \] \[ \Delta y(h) = f(g(x_0+h)) - f(u_0). \]

Conclusion. \(f \circ g\) is differentiable at \(x_0\), and

\[ (f\circ g)'(x_0) = f'(g(x_0))\,g'(x_0). \]

\(k(h)\) is the change \(\Delta u\) of stage 1, and \(\Delta y(h)/h\) is the difference quotient of \(f \circ g\) at \(x_0\). The proof uses the sum and product laws for limits, and the fact, proved on the page What a derivative measures when you zoom in, that a function with a derivative at a point is continuous there.

Key point Write the change in \(f\) as \(\big(f'(u_0) + \varepsilon(k)\big)\,k\) with \(\varepsilon(0) = 0\). That form is true at \(k = 0\) too, so it can take \(k = \Delta u\) even when \(\Delta u = 0\). Dividing by \(h\) and letting \(h \to 0\), with \(g\) continuous at \(x_0\), leaves \(f'(g(x_0))\,g'(x_0)\).
4 Apply

Problems

Each problem has hints and a full solution.

More problems
Key point To differentiate a chain, peel it from the outside: each layer contributes its derivative evaluated at the value fed into it, and the factors multiply. In a related-rates problem the chain runs through time, so units multiply too. For a bond whose yield moves, \(dP/dt\) combines the price's sensitivity to the yield with how fast the yield and the time to maturity change.
Level Intro (Calculus I) Prerequisites What a derivative measures when you zoom in: derivatives as slopes, linear approximation Time ~35 min

Next in Calculus: what the fundamental theorem of calculus connects (in preparation).

Further reading