Skip to content

Chain Rule

Proposition

Let X,X\text{,} YY be subsets of R,\mathbb{R}\text{,} let x∈Xx \in X and y∈Y,y \in Y\text{,} and let f ⁣:X→Yf \colon X \to Y be a function such that f(x)=y,f(x) =y\text{,} and such that ff is differentiable at x.x\text{.} Suppose that g ⁣:Y→Rg\colon Y \to \mathbb{R} is a function which is differentiable at y.y\text{.} Then the composition function g∘f ⁣:X→Rg\circ f\colon X \to \mathbb{R} is differentiable at x,x\text{,} and its derivative is given by

(g∘f)′(x)=g′(y)f′(x)=g′(f(x))f′(x).(g\circ f)'(x)=g'(y)f'(x) =g'(f(x))f'(x).

Interpretation

The chain rule describes how differentiation behaves under composition: if yy depends on uu and uu depends on xx, the rate of change of yy with respect to xx is the product of the two intermediate rates. It formalizes the propagation of rates of change through intermediate variables.

A chain of maps from x to u = f(x) to y = g(u), with the rates f'(x) and g'(u) on the arrows and the composite rate g'(f(x)) times f'(x) on a curved arrow from x to y.

The figure reads the formula from left to right. A small change in xx is multiplied by f′(x)f'(x) to give the change in u=f(x)u=f(x), and that change is multiplied by g′(u)g'(u) to give the change in yy. The composite rate on the curved arrow is the product g′(f(x)) f′(x)g'(f(x))\,f'(x), with g′g' evaluated at u=f(x)u=f(x), the point that xx is sent to, not at xx.

The tangent slopes multiply: f′(x)f'(x) in the first panel times g′(f(x))g'(f(x)) in the second gives the slope of g∘fg\circ f in the third.

In Leibniz notation, with u=f(x)u=f(x) and y=g(u)y=g(u), the rule reads

dydx=dydu dudx.\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{\mathrm{d}y}{\mathrm{d}u}\,\frac{\mathrm{d}u}{\mathrm{d}x}.

It looks like cancelling du\mathrm{d}u, which is a useful memory aid but not a proof: the derivatives are limits, not fractions. The hypotheses ask for differentiability of ff at xx and of gg at the point f(x)f(x) that is actually used. They are sufficient, not necessary: g(u)=∣u∣g(u)=|u| is not differentiable at 00, yet g(x2)=x2g(x^2)=x^2 is differentiable at x=0x=0.

A common slip is to forget the inner derivative: (e−x2)′=−2x e−x2(\mathrm{e}^{-x^2})'=-2x\,\mathrm{e}^{-x^2}, not e−x2\mathrm{e}^{-x^2}.

The rule returns later: it gives the derivative of an inverse function in the inverse function theorem, read backwards it becomes integration by substitution, and Math IV extends it to functions of several variables in the multivariable chain rule.


Key Results

  • The composition of differentiable functions is differentiable.
  • The derivative of a composition is the product of derivatives evaluated at appropriate points.

Examples

  • If f(x)=x2f(x)=x^2 and g(y)=sin⁡y,g(y)=\sin y\text{,} then (g∘f)′(x)=2xcos⁡(x2).(g\circ f)'(x)=2x\cos(x^2)\text{.}
  • If f(x)=exf(x)=\mathrm{e}^x and g(y)=y3,g(y)=y^3\text{,} then (g∘f)′(x)=3e3x.(g\circ f)'(x)=3\mathrm{e}^{3x}\text{.}

Differentiating a function with three layers

Find h′(x)h'(x) for h(x)=esin⁡(x2)h(x)=\mathrm{e}^{\sin(x^2)}, x∈Rx\in\mathbb{R}.

Name the layers, from the inside out

Write hh as a composition of three functions that are differentiable on R\mathbb{R}:

u(x)=x2,v(u)=sin⁡u,w(v)=ev,h=w∘v∘u.u(x)=x^2,\quad v(u)=\sin u,\quad w(v)=\mathrm{e}^{v},\qquad h=w\circ v\circ u.
Differentiate each layer

u′(x)=2xu'(x)=2x, v′(u)=cos⁡uv'(u)=\cos u and w′(v)=evw'(v)=\mathrm{e}^{v}.

Apply the chain rule twice and substitute back

Each derivative is evaluated at the layer inside it:

h′(x)=w′(v(u(x))) v′(u(x)) u′(x)=esin⁡(x2)cos⁡(x2)⋅2x.h'(x)=w'(v(u(x)))\,v'(u(x))\,u'(x)=\mathrm{e}^{\sin(x^2)}\cos(x^2)\cdot2x.

So h′(x)=2xcos⁡(x2) esin⁡(x2)h'(x)=2x\cos(x^2)\,\mathrm{e}^{\sin(x^2)}.

Takeaway. Work from the outside in, one factor per layer, and evaluate each outer derivative at the inner expression, not at xx: the middle factor is cos⁡(x2)\cos(x^2), not cos⁡x\cos x.


Prerequisites

Sources

Symbols: element of, real numbers

Last updated: 27 October 2026 11:52