The Chain Rule

⚡ Key Takeaways

The Chain Rule is the differentiation rule for composite functions: if yy depends on uu, and uu depends on xx, then dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}. In words: the rate of change of a composition is the product of the rates of change of each link. Where it applies: any nested or "function-inside-a-function" expression in calculus, physics, economics, and machine learning. Who/when: rooted in the work of Leibniz (1670s) and given rigorous form by Cauchy and later analysts in the 19th century.

💡 The Core Insight

A composite function is a relay race of dependence. If a small nudge in xx changes uu at rate dudx\frac{du}{dx}, and a small nudge in uu changes yy at rate dydu\frac{dy}{du}, then the nudge in xx ripples through uu to yy at the product of those rates. Sensitivities compose by multiplication.

Formal Statement

DefinitionComposite Function

Given two functions gg and ff, the composite function f∘gf \circ g is defined by

1
(f∘g)(x)=f(g(x))\quad (f \circ g)(x) = f\big(g(x)\big)

Derivation hint: substitute the output of gg as the input of ff; the domain is all xx where g(x)g(x) lies in the domain of ff. Here gg is the inner function, ff is the outer function. If we write u=g(x)u = g(x), then y=f(u)y = f(u), and yy depends on xx through the intermediate variable uu.

TheoremThe Chain Rule

Let gg be differentiable at xx and let ff be differentiable at u=g(x)u = g(x). Then the composite f∘gf \circ g is differentiable at xx, and

2
(f∘g)′(x)=f′(g(x))⋅g′(x)\quad (f \circ g)'(x) = f'\big(g(x)\big)\cdot g'(x)

Derivation hint: differentiate the outer function with the inner left intact, then multiply by the derivative of the inner. In Leibniz notation, with y=f(u)y = f(u) and u=g(x)u = g(x):

3
dydx=dydu⋅dudx\quad \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}

Derivation hint: read each factor as a local rate of change; the dudu's "cancel" symbolically, though they are not genuine fractions.

Symbols: xx is the independent variable; u=g(x)u = g(x) is the intermediate quantity; y=f(u)y = f(u) is the final output; f′f' and g′g' denote derivatives; dydu\frac{dy}{du} is evaluated at u=g(x)u = g(x), while dudx\frac{du}{dx} is evaluated at xx.

⚠️ Common mistake

The phrase "dudu cancels" is a mnemonic, not a proof. The differentials dudu in dydu\frac{dy}{du} and dudx\frac{du}{dx} are not ordinary numbers being divided. A correct proof must handle the case where g′(x)≠0g'(x) \neq 0 separately from where the difference quotient's denominator could vanish.

Why It Holds / Derivation

ProofSketch via Difference Quotients

We want dydx\frac{dy}{dx} where y=f(g(x))y = f(g(x)). Start from the limit definition.

Step 1. Write the difference quotient for the composite at xx:

4
f(g(x+h))−f(g(x))h\quad \frac{f(g(x+h)) - f(g(x))}{h}

Derivation hint: this is the increment in yy divided by the increment in xx, before taking h→0h \to 0.

Step 2. Let Δu=g(x+h)−g(x)\Delta u = g(x+h) - g(x), the change in the inner function. Multiply and divide by Δu\Delta u (assuming Δu≠0\Delta u \neq 0):

5
f(g(x)+Δu)−f(g(x))Δu⋅Δuh\quad \frac{f(g(x)+\Delta u) - f(g(x))}{\Delta u}\cdot\frac{\Delta u}{h}

Derivation hint: insert ΔuΔu=1\frac{\Delta u}{\Delta u}=1 and regroup so each factor is a recognizable difference quotient.

Step 3. As h→0h \to 0, continuity of gg forces Δu→0\Delta u \to 0. The first factor tends to f′(g(x))f'(g(x)) and the second to g′(x)g'(x):

6
lim⁡h→0Δyh=f′(g(x))⋅g′(x)\quad \lim_{h\to 0}\frac{\Delta y}{h} = f'(g(x))\cdot g'(x)

Derivation hint: the limit of a product is the product of the limits when both exist.

Step 4 (the gap). The division by Δu\Delta u fails if Δu=0\Delta u = 0 for hh near 00. A rigorous proof replaces the first factor by a patched function E(Δu)E(\Delta u) that equals the difference quotient when Δu≠0\Delta u \neq 0 and equals f′(g(x))f'(g(x)) when Δu=0\Delta u = 0, restoring continuity. This is Carathéodory's clean approach. The conclusion (f∘g)′(x)=f′(g(x))g′(x)(f\circ g)'(x) = f'(g(x))g'(x) then holds in all cases. ■\blacksquare

∎
mathematician · Gottfried Wilhelm Leibniz | 1646–1716

Leibniz co-invented calculus and, crucially, designed the notation dydx\frac{dy}{dx} that makes the Chain Rule look almost self-evident. His differentials dydy, dudu, dxdx were conceived as "infinitely small" increments, and within that framework dydu⋅dudx\frac{dy}{du}\cdot\frac{du}{dx} reads as honest fraction cancellation. Though his infinitesimals were later replaced by limits, the notation survived precisely because it encodes the Chain Rule so transparently. The form in equation [3] is sometimes called the Leibniz form of the rule.

Building Intuition

🧠 Intuition

Imagine a chain of gears. Turn the input gear (variable xx); it spins a middle gear (uu) which is, say, 3 times faster; that middle gear spins the output gear (yy) which is 2 times faster than the middle one. How fast does yy spin compared to xx? 2×3=62 \times 3 = 6 times. Each link multiplies its gear ratio. Equivalently, think of unit conversions. If you travel 60 miles per hour and there are 1.6 kilometres per mile, you travel 60×1.6=9660 \times 1.6 = 96 km/h. The mileshour\frac{\text{miles}}{\text{hour}} and kmmile\frac{\text{km}}{\text{mile}} multiply, with "miles" cancelling — exactly the Chain Rule pattern.

Figure
A composite function as a relay: a nudge in x ripples through u to y, with rates multiplying.
x u = g(x) y = f(u) du/dx dy/du dy/dx = (dy/du)·(du/dx) Rates multiply along the chain

Worked Examples

ExampleDifferentiating a Power of a Polynomial

Given: y=(3x2+5)4y = (3x^2 + 5)^4. Find dydx\frac{dy}{dx}.

Step 1 — Identify the links. Inner: u=g(x)=3x2+5u = g(x) = 3x^2 + 5. Outer: y=f(u)=u4y = f(u) = u^4.

Step 2 — Differentiate each.

7
dydu=4u3,dudx=6x\quad \frac{dy}{du} = 4u^3, \qquad \frac{du}{dx} = 6x

Derivation hint: apply the power rule to u4u^4 and to 3x2+53x^2+5 term-by-term.

Step 3 — Multiply (Chain Rule).

8
dydx=4u3⋅6x=24x(3x2+5)3\quad \frac{dy}{dx} = 4u^3 \cdot 6x = 24x(3x^2+5)^3

Derivation hint: substitute u=3x2+5u = 3x^2+5 back in and combine constants.

Check at x=1x = 1: u=8u = 8, so dydx=24(1)(8)3=24×512=12288\frac{dy}{dx} = 24(1)(8)^3 = 24 \times 512 = 12288.

dydx=24x (3x2+5)3(dimensionless)\boxed{\dfrac{dy}{dx} = 24x\,(3x^2+5)^3 \quad(\text{dimensionless})}
ExampleA Physical Rate: Expanding Balloon

Given: A spherical balloon's radius grows at drdt=2 cm/s\frac{dr}{dt} = 2\ \text{cm/s}. How fast is its volume growing when r=10 cmr = 10\ \text{cm}? Volume V=43πr3V = \frac{4}{3}\pi r^3.

Step 1 — Identify the chain. VV depends on rr; rr depends on tt. We want dVdt\frac{dV}{dt}.

Step 2 — Differentiate the outer link.

9
dVdr=4πr2\quad \frac{dV}{dr} = 4\pi r^2

Derivation hint: power rule on 43πr3\frac{4}{3}\pi r^3.

Step 3 — Chain Rule.

10
dVdt=dVdr⋅drdt=4πr2⋅drdt\quad \frac{dV}{dt} = \frac{dV}{dr}\cdot\frac{dr}{dt} = 4\pi r^2 \cdot \frac{dr}{dt}

Derivation hint: this is "related rates" — multiply the geometric rate by the time rate.

Step 4 — Substitute numbers. r=10 cmr = 10\ \text{cm}, drdt=2 cm/s\frac{dr}{dt} = 2\ \text{cm/s}:

11
dVdt=4π(10)2(2)=800π≈2513 cm3/s\quad \frac{dV}{dt} = 4\pi (10)^2 (2) = 800\pi \approx 2513\ \text{cm}^3/\text{s}

Derivation hint: square the radius, multiply through, keep π\pi exact then approximate.

dVdt=800π≈2513 cm3/s\boxed{\dfrac{dV}{dt} = 800\pi \approx 2513\ \text{cm}^3/\text{s}}

Common Misconceptions

⚠️ Common mistake

The most frequent error is forgetting the inner derivative. Students differentiate sin⁡(x2)\sin(x^2) as cos⁡(x2)\cos(x^2) and stop. The correct answer is cos⁡(x2)⋅2x\cos(x^2)\cdot 2x. The factor g′(x)=2xg'(x) = 2x — the "×\times the derivative of the inside" — is exactly what the Chain Rule supplies. If the inside were just xx, that factor would be 11 and you'd never notice it was missing.

CounterexampleThe Rule Is Not Mere Substitution of Derivatives

One might guess that (f∘g)′(x)=f′(g(x))(f\circ g)'(x) = f'(g(x)) alone, as if differentiating the outer function were enough. Take f(u)=u2f(u) = u^2 and g(x)=5xg(x) = 5x, so f(g(x))=25x2f(g(x)) = 25x^2. The true derivative is 50x50x. But f′(g(x))=2(5x)=10xf'(g(x)) = 2(5x) = 10x — wrong by a factor of 5. The missing factor is exactly g′(x)=5g'(x) = 5, and 10x×5=50x10x \times 5 = 50x ✓. This shows the inner derivative is indispensable, not optional.

⚠️ Common mistake

Do not confuse the Chain Rule with the Product Rule. The Chain Rule is for compositions f(g(x))f(g(x)) — one function fed into another. The Product Rule is for products f(x)⋅g(x)f(x)\cdot g(x) — two functions multiplied. The expression x2sin⁡xx^2\sin x needs the Product Rule; sin⁡(x2)\sin(x^2) needs the Chain Rule. Ask: "Is one function inside the other, or are they side by side?"

Connections

connection

The Chain Rule sits at the heart of differentiation's machinery and links to many neighbours. It is essential for Implicit Differentiation, where we treat yy as a hidden function of xx and differentiate yny^n as nyn−1dydxny^{n-1}\frac{dy}{dx}. It powers Related Rates problems, as in the balloon example, by chaining a geometric derivative to a time derivative. It underlies the Derivative of Inverse Functions via dxdy=1/dydx\frac{dx}{dy} = 1/\frac{dy}{dx}. Combined with the Fundamental Theorem of Calculus, it produces the technique of Integration by Substitution — substitution is the Chain Rule run backwards. Its multivariable cousin generalizes equation [3] to sums of partial-derivative products.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1676 — Leibniz, in private manuscripts, manipulates differentials dydy, dudu, dxdx in ways that effectively use the Chain Rule, though without a formal statement.
- 1684 — Leibniz publishes Nova Methodus, the first calculus paper, establishing the dydx\frac{dy}{dx} notation that makes the rule transparent.
- 1690s — The Bernoulli brothers (Jacob and Johann) and L'Hôpital apply chained differentials freely to curves and mechanics problems.
- 1734 — Berkeley's The Analyst attacks the logical vagueness of infinitesimals, including the loose "cancellation" justifying the rule, spurring demand for rigor.
- 1755 — Euler systematizes differential calculus in Institutiones Calculi Differentialis, treating composite differentiation as routine.
- 1821 — Cauchy's Cours d'analyse recasts derivatives via limits, providing the conceptual basis for a rigorous Chain Rule proof.
- 1860s–1870s — Weierstrass's epsilon–delta formalism allows fully rigorous statements and proofs of the rule.
- 1880s — Carathéodory's "increment" formulation of the derivative yields the clean, gap-free proof now common in textbooks.
- 1986 — Rumelhart, Hinton, and Williams popularize backpropagation, recasting the Chain Rule as the computational core of modern machine learning.

Subtleties & Limits

open-problem

The Chain Rule as stated requires both functions to be differentiable at the relevant points. Subtleties arise at the edges:

  • Non-differentiable inner functions. If gg has a corner (e.g. g(x)=∣x∣g(x) = |x| at x=0x=0), the composite may still be differentiable, but the Chain Rule formula does not directly apply — case-by-case analysis is needed.
  • The "fake fraction" problem. Equation [3] looks like cancellation but isn't; in multivariable calculus the naïve cancellation breaks entirely, replaced by dzdt=∂z∂xdxdt+∂z∂ydydt\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt} — a sum of products.
  • Higher derivatives. The second derivative of a composite is not simply f′′(g) g′2f''(g)\,g'^2; it equals f′′(g)(g′)2+f′(g)g′′f''(g)(g')^2 + f'(g)g'', and the general nn-th derivative is given by the intricate Faà di Bruno's formula, a still-studied combinatorial object.
  • Non-standard analysis. Whether Leibniz's infinitesimals can be rigorously revived (Robinson, 1960s) so that the "cancellation" is literally valid remains a live area of mathematical logic.

See Also

The Derivative · Product Rule · Quotient Rule · Implicit Differentiation · Related Rates · Integration by Substitution · Multivariable Chain Rule · Faà di Bruno's Formula · Derivative of Inverse Functions