Skip to content
Topos Uranos

The chain rule for the derivative of a composition of functions

Summary

This lesson proves the chain rule: if gg is differentiable at aa and ff is differentiable at g(a)g(a), the composition f∘gf \circ g is differentiable at aa, and its derivative is the product f′(g(a)) g′(a)f'(g(a)) \, g'(a). The proof uses the Carathéodory characterization, which divides by nothing; the lesson explains why the argument that divides by g(x)−g(a)g(x) - g(a) is not enough and in which case it does work. With the rule, compositions of powers, roots, rational functions and trigonometric functions are differentiated in a few lines, which with the earlier rules required long expansions or were out of reach. The lesson also attends to the domain of the composition, which the formula for the derivative does not show, and presents the rule in Leibniz notation, where it looks like a cancellation of fractions without being one.

Learning objectives

  1. Prove the chain rule with the Carathéodory characterization, and explain why the proof that divides by g(x)−g(a)g(x) - g(a) fails when g′(a)=0g'(a) = 0.
  2. Differentiate compositions of two or more known functions, evaluating each derivative at the point that corresponds to it.
  3. Determine the domain of a composition before differentiating it, and recognize that the hypotheses of the rule are sufficient, but not necessary.
  4. Write and read the chain rule in Leibniz notation.

The derivative of a composition

With the rules from the lesson on differentiation rules and the formulas from the lesson on the derivatives of the elementary functions, one can differentiate (2x2+1)12\left(2x^2 + 1\right)^{12}, but only by expanding the power into a polynomial of degree 2424, or by applying the product rule over and over. And one cannot yet differentiate sin⁡(cos⁡x)\sin(\cos x) or 1+x2\sqrt{1 + x^2}: no rule says what to do with a function applied to another. Both expressions are compositions: (2x2+1)12\left(2x^2 + 1\right)^{12} is the power t12t^{12} evaluated at t=2x2+1t = 2x^2 + 1, and sin⁡(cos⁡x)\sin(\cos x) is the sine evaluated at t=cos⁡xt = \cos x.

Two particular cases are already known. Solved problem 2 of the lesson on the elementary functions showed that f(cx+b)f(cx + b) has at aa the derivative cf′(ca+b)c f'(ca + b): the inner function is linear, with slope cc, and the derivative of the outer function is evaluated at the point ca+bca + b, not at aa. And proposed problem 4 of the lesson on differentiation rules obtained, by induction, that (f(x))n\left(f(x)\right)^n has at aa the derivative n(f(a))n−1f′(a)n \left(f(a)\right)^{n - 1} f'(a). In both cases the derivative is a product: the derivative of the outer function, evaluated at the value of the inner one, times the derivative of the inner one. The idea is that of rates of change: if t=g(x)t = g(x) changes g′(a)g'(a) times as fast as xx, and f(t)f(t) changes f′(g(a))f'(g(a)) times as fast as tt, then f(g(x))f(g(x)) changes f′(g(a)) g′(a)f'(g(a)) \, g'(a) times as fast as xx.

TheoremChain rule

Let gg be a function defined on AA, differentiable at a point aa of AA that is an accumulation point of AA, and ff a function defined on a set BB that contains the values of gg, differentiable at b=g(a)b = g(a). Then f∘gf \circ g is differentiable at aa, and

(f∘g)′(a)=f′(g(a)) g′(a)(f \circ g)'(a) = f'(g(a)) \, g'(a)

The two increments are factored with the Carathéodory characterization and then combined: the increment of ff is evaluated at t=g(x)t = g(x), and that of gg replaces t−bt - b. The figure shows, with g(x)=x2g(x) = x^2, f(t)=sin⁡tf(t) = \sin t and a=1a = 1, the secant and the tangent of gg, those of ff at b=1b = 1 and, at the end, those of sin⁡(x2)\sin\left(x^2\right), whose slope at 11 is the product cos⁡1⋅2\cos 1 \cdot 2.

Proof

  1. g(x)−g(a)=ψ(x)(x−a),x∈A,f(t)−f(b)=φ(t)(t−b),t∈Bg(x) - g(a) = \dato{psi}{\psi(x)(x - a)}, \quad x \in A, \qquad f(t) - f(b) = \dato{fi}{\varphi(t)(t - b)}, \quad t \in B

    By the theorem on the characterizations of the derivative, from the lesson on the derivative as a limit, there exist ψ ⁣:A→R\psi \colon A \to \mathbb{R}, continuous at aa with ψ(a)=g′(a)\psi(a) = g'(a), and φ ⁣:B→R\varphi \colon B \to \mathbb{R}, continuous at bb with φ(b)=f′(b)\varphi(b) = f'(b), such that:

  2. f(g(x))−f(g(a))=φ(g(x))(g(x)−g(a))=φ(g(x)) ψ(x)(x−a)f(g(x)) - f(g(a)) = \varphi(g(x)) \left(g(x) - g(a)\right) = \resaltar{\varphi(g(x)) \, \psi(x)}(x - a)

    Let xx be in AA. The number t=g(x)t = g(x) is in BB, and the second equality holds for it, whether or not it equals bb; then t−b=g(x)−g(a)t - b = g(x) - g(a) is replaced by the first factorization.

  3. γ(a)=φ(g(a)) ψ(a)=φ(b) ψ(a)=f′(g(a)) g′(a)\gamma(a) = \varphi(g(a)) \, \psi(a) = \varphi(b) \, \psi(a) = \resaltar{f'(g(a)) \, g'(a)}

    Since gg is differentiable at aa, it is continuous at aa, by the theorem that differentiable implies continuous; and φ\varphi is continuous at b=g(a)b = g(a). By the theorem on the composition of continuous functions, from the lesson on limit and continuity, φ∘g\varphi \circ g is continuous at aa, and the factor γ=(φ∘g) ψ\gamma = (\varphi \circ g) \, \psi is continuous there too, by the product rule for operations with continuous functions. Since aa is an accumulation point of AA, which is the domain of f∘gf \circ g, the Carathéodory characterization gives the derivative.

If gg is differentiable on all of AA and ff on all of BB, the rule holds at every accumulation point of AA, and it is written as an equality between functions: (f∘g)′=(f′∘g) g′(f \circ g)' = (f' \circ g) \, g'. The derivative of the outer function is evaluated at g(x)g(x), not at xx; this is the most frequent error in applying the rule. The advantage of the proof lies in its second move: the factorization of ff also holds at t=bt = b, where both of its sides are zero, so it does not matter whether gg repeats its value g(a)g(a) near aa.