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
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.
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.
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.
| \(\Delta x\) | \(\Delta u/\Delta x\) | \(\Delta y/\Delta u\) | \(\Delta y/\Delta x\) |
|---|
Four widths only suggest where the factors are heading. The derivatives themselves are limits as Δx → 0.
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
Let \(h\) be differentiable at \(x\). With the outer functions \(e^u\), \(\ln u\) and \(u^r\):
\[ \big(e^{h(x)}\big)' = e^{h(x)}\,h'(x), \] \[ \big(\ln h(x)\big)' = \frac{h'(x)}{h(x)} \quad (h(x) \gt 0), \] \[ \big(h(x)^r\big)' = r\,h(x)^{r-1}\,h'(x) \]for a constant \(r\) and \(h(x) \gt 0\); for \(r = 2, 3, 4, \ldots\) the condition \(h(x) \gt 0\) can be dropped. For example \(\big(e^{3x^2}\big)' = 6x\,e^{3x^2}\) and \(\big(\sqrt{1 + x^2}\big)' = \dfrac{x}{\sqrt{1 + x^2}}\).
Logarithmic differentiation
For \(x^x\) neither the power rule nor the rule for \(b^x\) applies, since both the base and the exponent move.
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?
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.
Problems
Each problem has hints and a full solution.
More problems
Next in Calculus: what the fundamental theorem of calculus connects (in preparation).
Further reading
- J. Stewart, Calculus: Early Transcendentals, 8th ed. (Cengage, 2016), sections 3.4, “The Chain Rule,” 3.6, “Derivatives of Logarithmic Functions,” and 3.9, “Related Rates.”
- M. Spivak, Calculus, 4th ed. (Publish or Perish, 2008), chapter 10, “Differentiation,” for a proof of the chain rule that also covers a zero inner change.
- G. Strang, Calculus, 3rd ed. (Wellesley-Cambridge Press, 2017; on MIT OpenCourseWare as RES.18-001), chapter 4, “Derivatives by the Chain Rule.”
- J. C. Hull, Options, Futures, and Other Derivatives, 10th ed. (Pearson, 2018), chapter 4, “Interest Rates,” on continuous compounding and zero-coupon yields.