The Chain Rule
Suppose a chemical reaction's temperature depends on time. Suppose also its reaction rate depends on temperature. How fast does the rate change with time? This is a composition problem: rate is a function of temperature, and temperature is a function of time. We want the derivative of the composite. The naive guess — multiply the two derivatives — turns out to be correct. But why it is correct is subtler than it looks. The most tempting proof divides by a quantity that can equal zero infinitely often near the point of interest. The chain rule is the differentiation rule for composite functions . It is arguably the single most-used computational tool in calculus. Nearly every derivative computed in practice — of , of , of — is an application of it. Often it is applied several times nested. Beyond computation, the chain rule expresses a deep structural fact. Linear approximations compose by matrix (here, scalar) multiplication. This is the seed of the multivariable chain rule. It is also the seed of the change-of-variables formula in integration. And it underlies the derivative of an inverse function. The subtlety mentioned above is real. If and , the difference quotient for as a function of factors as
and letting looks like it gives . But this manipulation is illegal whenever for a sequence of . In that case we divide by zero. A correct proof must route around this obstacle entirely. This article gives the precise statement of the chain rule. It also gives a complete, gap-free proof. The proof uses the increment (error-term) formulation of differentiability. This approach sidesteps the division-by-zero trap. We also examine what fails without each hypothesis. We work two nontrivial examples. Finally, we connect the result forward to inverse function differentiation and Taylor's theorem.
- The chain rule computes the derivative of a composite as .
- The naive quotient-splitting proof is invalid because can vanish infinitely often as .
- The fix: write differentiability via an increment equation with an error term that vanishes at the base point, valid even when the increment is zero.
- Hypotheses needed: differentiable at , and differentiable at — nothing more.
- The rule generalizes immediately to chains of any finite length by iteration.
- Key idea: near a point, differentiable functions behave like linear maps, and linear maps compose by multiplying their slopes — the chain rule is this fact made rigorous despite the vanishing-increment obstruction.
Where this lives today
The chain rule is the computational backbone of differentiation itself: nearly every derivative formula for elementary functions built from compositions — , , — relies on it directly. In multivariable calculus it generalizes to the Jacobian chain rule, , a matrix product replacing the scalar product, foundational for Derivatives of Inverse Functions and the inverse and implicit function theorems. In physics, related rates and dimensional analysis in mechanics (e.g. , giving force times velocity as power) are direct chain-rule statements. In machine learning, the backpropagation algorithm that trains neural networks is a systematic, layer-by-layer application of the chain rule to compute gradients of a loss function through many nested compositions of affine maps and activation functions. In probability and statistics, the change-of-variables formula for probability density functions of transformed random variables uses the chain rule (via the derivative of the inverse transform) to convert one density into another. In cryptography and numerical analysis, sensitivity and error-propagation analyses — how small perturbations in an input propagate through a composed algorithm — are chain-rule estimates. The chain rule also underlies the derivation of the derivative of an inverse function, , by differentiating the identity , and it is a key ingredient in building up higher-order Taylor expansions of composite functions, connecting directly to Taylor's Theorem with Remainder.
Ask the tutor: Can you show me how the increment-based chain rule proof adapts when is a left endpoint of the domain, using one-sided derivatives?
Let be intervals (or more generally sets containing an open interval around the relevant point), and let
Define the composite function by
Fix and suppose is an interior point of (so that difference quotients at make sense for from both sides), and suppose is an interior point of . Recall that is differentiable at if
exists as a finite real number, and likewise is differentiable at if
exists finitely. The chain rule asserts that under these hypotheses, is differentiable at and
Intuition
Think of and as zoom factors. Near , the function stretches small displacements by an approximate factor : moving by a tiny amount moves by about . Near , the function stretches displacements by a factor . Composing the two zooms multiplies the factors: a displacement in produces about in , which in turn produces about in . The overall zoom factor of at is the product . The delicate point is that " stretches by " is only an approximate, local statement — it can fail to be exactly true for any particular nonzero increment, and in fact the increment might be exactly zero for some sequence of small even though is not locally constant. The rigorous proof needs a formulation of differentiability robust enough to survive this, which is exactly the increment/error-term formulation introduced below.
Let be intervals, let be an interior point of , let , and let be an interior point of . Let . Assume: 1. is differentiable at , and 2. is differentiable at . Then the composite is differentiable at , and
Let be defined on an interval containing as an interior point. Then is differentiable at with derivative if and only if there exists a function , defined for all sufficiently small (including ), such that
with
() Suppose exists. Define, for in a neighborhood of small enough that is in the domain,
and set . Then by definition of the derivative,
which matches , so is continuous at with , i.e. . Rearranging the definition of (valid for ) gives
For this equation reads , which is trivially true. So the increment equation holds for all small , including . () Suppose such exists with the stated properties. For small, divide the increment equation by :
Since as , the right side tends to , so
i.e. is differentiable at with .
∎Why this lemma matters. The increment equation holds identically for every small , including and including values of where some other quantity we might want to divide by happens to vanish. This is exactly what we need to route around the division-by-zero obstruction in the composite derivative computation.
Proof of the Chain Rule. (Technique: increment/error-term substitution — no division by a possibly-vanishing quantity is ever performed.) By hypothesis (2), is differentiable at . By the increment lemma applied to at , there is a function defined for all sufficiently small (including ), with as and , such that
for all such . By hypothesis (1), is differentiable at . By the increment lemma applied to at , there is a function defined for all sufficiently small (including ), with as and , such that
for all such .
Step 1: substitute. Fix small and nonzero (so that ), and define
Note may be zero for some nonzero — this causes no problem, since equation (1) holds even at . Since by construction (and for small since is interior to ), we may legitimately evaluate at , and apply (1) with :
Step 2: express the increment of . Since , we have and , so from (4),
Substitute (3) for :
Divide by (legitimate since we assumed ):
Step 3: take the limit . We examine each term on the right of (5) as :
- is constant.
- , since as (this is part of the increment lemma for ).
- For the last term, we must show as . First, from (3), as ,
using that is a fixed finite number and , (product and sum of functions with limits, plus continuity of multiplication). So as . Since as (with , so is continuous at ), and as , the composition rule for limits (continuity of at composed with ) gives
This step uses only the continuity of at the single point , established already in the increment lemma — it is not circular, since continuity of at was proved directly from differentiability of at , independent of the chain rule. Also , a finite limit. Hence, by the product rule for limits,
Step 4: combine. By the sum rule for limits, taking in (5):
This limit exists and equals ; by definition of the derivative, is differentiable at and
∎
Let be functions such that is differentiable at , is differentiable at , is differentiable at , and so on, with differentiable at the appropriate iterated image point. Then is differentiable at , and
By induction on , using The Chain Rule (the theorem just proved) as the inductive step. For the claim is vacuous (just ). Assume the result for chains of length ; let , differentiable at by the inductive hypothesis with the stated derivative formula. Then , and applying the two-function chain rule to and (with differentiable at by hypothesis, and differentiable at by the inductive hypothesis) gives
and substituting the inductive formula for yields the claimed product.
∎Worked examples
Example 1: A composite with a non-monotonic inner function. Let
Here (which is not monotonic — it has local extrema, so genuinely vanishes for infinitely many small nonzero near certain points , e.g. near a critical point) and . We have and , both differentiable everywhere (polynomial and sine are differentiable on all of , standard facts from Algebraic Rules of Differentiation and direct computation). By the chain rule, at any ,
Check at (a critical point of , since there): , so , regardless of the cosine factor. This matches intuition: near this , 's increments are rather than , so composing with any differentiable still gives an with zero linear term at . Note also that at exactly this point, is not eventually nonzero for small in general (near a local extremum of a smooth function, the difference can vanish only at isolated points typically, but the point of this example is that the proof method never needed to worry about whether it vanishes — the increment method handles it uniformly regardless). Let's also numerically sanity-check at : , . So
Direct check via difference quotient with : . Then , and . Difference quotient . This does not match — let us recompute carefully. . . Using with : . So . Difference quotient: . This matches well (small discrepancy from linear approximation truncation), confirming the chain-rule computation. (The earlier miscomputation of above used an arithmetic slip; the corrected value is what was used in the second, correct pass.)
Example 2: A chain of three functions, asymmetric at every stage. Let
Write with
Check domains and interiority: for all real , so is applied to a point in , an open set, hence interior; there, so is applied to a point in , again interior. All composition points are interior, satisfying the theorem's hypotheses. Derivatives:
each differentiable on the relevant domain ( on ; on since is not differentiable at but we never land there; on ). By the finite-chain corollary, at any , with and :
Let's verify at : the formula gives . Direct check: (using — an algebraic identity, not a differentiation shortcut, just to cross-check), so , agreeing exactly with the chain-rule computation for all , in particular . Numerically, . Compute , so , , . And . Difference quotient — but this should approximate ; the discrepancy signals an arithmetic check is needed with a smaller step or more precision, since first-order finite differences at carry error only if computed with enough significant digits. Recomputing with more precision: . Then . : since and , . Then . Difference quotient: , which matches closely (the residual is the expected second-order error). This confirms the chain-rule formula.
The chain rule requires to be differentiable at the point , not merely continuous there. Here is what fails if we only assume continuity of at . Let (so for every ) and let
Take , so . The function is continuous everywhere, including at , but is not differentiable at : the right-hand difference quotient while the left-hand one is ; these disagree, so does not exist. The composite is , and likewise fails to exist by the identical one-sided computation. So the conclusion " is differentiable at with " simply cannot hold — there is no value of to plug in, and indeed does not exist either. If one were to naively write "", the right side is undefined since does not exist, consistent with the left side also failing to exist — the theorem's hypothesis (differentiability of at ) was essential, and without it no valid conclusion can be drawn. A second, sharper illustration: let for , (differentiable at with , by a standard squeeze argument), and let again with . Then for , . One can check is not differentiable at : near , takes both signs infinitely often (since oscillates), so oscillates in sign without settling to a single limit as , even though — again driven entirely by 's failure to be differentiable at .
Scope, edge cases & common traps
| Situation | What happens |
|---|---|
| differentiable at , differentiable at | Chain rule holds exactly as stated. |
| differentiable at , only continuous (not differentiable) at | Chain rule can fail; see counterexample. |
| for infinitely many | No problem for the increment-based proof; the naive quotient-splitting proof breaks here. |
| or not an interior point (e.g. an endpoint) | State the rule with one-sided derivatives; the proof adapts by using one-sided increment lemmas. |
| Chain of functions | Handled by induction (see corollary); differentiability needed at each successive image point. |
| or differentiable on a whole interval, not just at one point | Rule then gives for every in that interval, recovering the familiar "for all " formula used in computations. |
The mathematician behind it
Origins · 1 minGottfried Wilhelm Leibniz and how this was discovered
Leibniz developed the differential calculus independently of Newton in the 1670s, and it is his notation — — that makes the chain rule look almost like cancelling fractions, a mnemonic so effective it persists in every calculus classroom today. Leibniz worked as a diplomat, philosopher, and librarian for the House of Hanover while developing calculus, symbolic logic, and early mechanical calculators. The rigorous -based proof of the chain rule given here, however, is a 19th-century achievement, built on the arithmetization of analysis by Cauchy and Weierstrass, since Leibniz's own "infinitesimal" quantities lacked a rigorous logical foundation in his time.
Why can't we just define the derivative of at using the quotient directly?
Because that quotient is undefined whenever , i.e. whenever the denominator is zero, and this can happen for infinitely many arbitrarily close to even when is differentiable and non-constant near (a classic example is with , which vanishes at for every integer ). The increment/error-term formulation avoids this entirely: it expresses as an identity that holds for every small , including , so no division by a possibly-vanishing quantity is ever required.
Does the chain rule require or to be continuous, as a separate hypothesis?
No separate continuity hypothesis is needed, because differentiability at a point already implies continuity at that point — this is a standard consequence of the definition of the derivative (if exists, then as , so is continuous at ). So requiring differentiable at and differentiable at already automatically forces the continuity needed for the composite to even make sense as a function near and for the proof to go through.
Can the chain rule fail if is differentiable at but not differentiable anywhere else nearby?
The theorem as stated only requires differentiability of at the single point and of at the single point — it does not require differentiability on a whole neighborhood. The proof given uses only the increment equations at these two specific points, so pointwise differentiability suffices and the conclusion holds regardless of how badly or behave away from and respectively.
How does the chain rule relate to the derivative of an inverse function?
If is differentiable at with , and exists and is differentiable at , differentiating the identity at via the chain rule gives , hence . This is exactly the formula developed in Derivatives of Inverse Functions; the chain rule is the engine that derives it, though a fully rigorous treatment also needs to separately justify that is differentiable in the first place.
Why does the proof need and to be interior points?
Interiority guarantees that difference quotients make sense for approaching from both sides, matching the two-sided limit definition of the derivative used throughout the proof. If or were an endpoint of the domain, only a one-sided limit would be meaningful there, and the theorem and its proof would need to be restated using one-sided derivatives and one-sided increment lemmas; the logical structure of the argument carries over essentially unchanged, but the interior-point hypothesis keeps the statement and proof clean and matches the two-sided derivative definition assumed in the prerequisites.
Is the chain rule still true if or ?
Yes — the theorem makes no assumption that either derivative is nonzero. If either factor is , the conclusion is simply , and the proof goes through exactly as written, since nowhere in the argument did we divide by or ; we only ever multiplied and took limits of sums and products, operations that are perfectly well-behaved even when one of the derivatives in question is zero.
Does the chain rule extend to functions of several variables?
Yes, and the increment-based proof strategy used here is exactly the one that generalizes: differentiability of at a point is defined via a linear map and an error term that is rather than merely , and composing two such linear approximations gives the multivariable chain rule , a composition (matrix product) of linear maps replacing the scalar product from the one-variable case.