Chain Rule

Basis
Last updated: Tags: Calculus, Differentiation

The basic rules handle arithmetic combinations of functions, but they do not tell you how to differentiate a composition like (x3+1)100(x^3+1)^{100} or sin(x2)\sin(x^2). The chain rule fills that gap: it expresses the derivative of fgf \circ g in terms of the individual derivatives of ff and gg.

Statement

Theorem (Chain rule). Let gg be differentiable at xx and ff be differentiable at g(x)g(x). Then hfgh \coloneqq f \circ g is differentiable at xx and

h(x)  =  f(g(x))g(x).(1)h'(x) \;=\; f'(g(x)) \cdot g'(x). \tag{1}

In Leibniz notation, with u=g(x)u = g(x) and y=f(u)y = f(u):

dydx  =  dydududx.\frac{dy}{dx} \;=\; \frac{dy}{du} \cdot \frac{du}{dx}.

Proof

The naive cancellation f(g(x+k))f(g(x))k=f(g(x+k))f(g(x))g(x+k)g(x)g(x+k)g(x)k\dfrac{f(g(x+k))-f(g(x))}{k} = \dfrac{f(g(x+k))-f(g(x))}{g(x+k)-g(x)} \cdot \dfrac{g(x+k)-g(x)}{k} fails when g(x+k)=g(x)g(x+k) = g(x) for some nonzero kk (the first factor is then 0/00/0). The following auxiliary-function argument handles this case cleanly.

Proof. Define ϕ\phi by

ϕ(u)  =  {f(u)f(g(x))ug(x)ug(x),f(g(x))u=g(x).\phi(u) \;=\; \begin{cases} \dfrac{f(u) - f(g(x))}{u - g(x)} & u \neq g(x), \\[6pt] f'(g(x)) & u = g(x). \end{cases}

Since ff is differentiable at g(x)g(x), ϕ\phi is continuous at g(x)g(x).

For any k0k \neq 0, setting u=g(x+k)u = g(x+k):

f(g(x+k))f(g(x))  =  ϕ(g(x+k))(g(x+k)g(x)),f(g(x+k)) - f(g(x)) \;=\; \phi(g(x+k)) \cdot \bigl(g(x+k) - g(x)\bigr),

which holds whether or not g(x+k)=g(x)g(x+k) = g(x) (both sides are 00 when equal). Dividing by kk:

f(g(x+k))f(g(x))k  =  ϕ(g(x+k))g(x+k)g(x)k.\frac{f(g(x+k)) - f(g(x))}{k} \;=\; \phi(g(x+k)) \cdot \frac{g(x+k) - g(x)}{k}.

As k0k \to 0: the right factor converges to g(x)g'(x); since gg is continuous at xx, g(x+k)g(x)g(x+k) \to g(x), so ϕ(g(x+k))ϕ(g(x))=f(g(x))\phi(g(x+k)) \to \phi(g(x)) = f'(g(x)). Therefore (fg)(x)=f(g(x))g(x)(f \circ g)'(x) = f'(g(x)) \cdot g'(x). \square

Examples

Power of a polynomial

((x3+1)5)  =  5(x3+1)43x2  =  15x2(x3+1)4.\bigl((x^3+1)^5\bigr)' \;=\; 5(x^3+1)^4 \cdot 3x^2 \;=\; 15x^2(x^3+1)^4.

Linear substitution

((2x+1)100)  =  100(2x+1)992  =  200(2x+1)99.\bigl((2x+1)^{100}\bigr)' \;=\; 100(2x+1)^{99} \cdot 2 \;=\; 200(2x+1)^{99}.

Abstract composition

If ff is differentiable and g(x)=f(x2+3x)g(x) = f(x^2 + 3x), then g(x)=f(x2+3x)(2x+3)g'(x) = f'(x^2+3x)\cdot(2x+3).

Summary

  • Chain rule: (fg)(x)=f(g(x))g(x)(f \circ g)'(x) = f'(g(x)) \cdot g'(x).
  • The proof uses an auxiliary function ϕ\phi to avoid division by zero when g(x+k)=g(x)g(x+k) = g(x).
  • In Leibniz notation: dydx=dydududx\dfrac{dy}{dx} = \dfrac{dy}{du} \cdot \dfrac{du}{dx}.