The Chain Rule in Multiple Variables
One-line statement: The multivariable chain rule computes the derivative of a composition of functions by summing the contributions of all intermediate variables through which one variable depends on another. Key result in words: If depends on several intermediate variables, and each of those depends on the true independent variables, the total rate of change of with respect to an independent variable is the sum over every intermediate path of (rate of w.r.t. that intermediate) × (rate of that intermediate w.r.t. the independent variable). Where it applies: Differential calculus of functions , implicit differentiation, change of variables, PDEs, optimization (gradient descent / backpropagation), thermodynamics, differential geometry. Who/when: Roots in Leibniz (1670s) and Euler (1734); the modern total-derivative formulation matured with Cauchy and Jacobi in the 19th century.The chain rule in multiple variables generalizes the single-variable rule to functions of several variables. Precisely, if and are differentiable, then is differentiable and its total derivative (Jacobian matrix) is the matrix product of the individual Jacobians. It matters because almost every quantity in applied mathematics is built by composing maps — coordinate changes, parameterizations, layered models — and the chain rule is the universal bookkeeping device for propagating rates of change through them. The surprising fact: although the rule looks like a sum of products of partial derivatives, that sum is nothing more than ordinary matrix multiplication, and this single observation makes backpropagation in neural networks, the workhorse of modern AI, a direct corollary.
The Core Insight
A differentiable function is, locally, its best linear approximation — encoded by the Jacobian matrix. Composition of functions corresponds to composition of their linear approximations, and composition of linear maps is matrix multiplication. Therefore:
Formal Statement
Partial Derivative and Jacobian
For , , the partial derivative of component with respect to coordinate is
The Jacobian matrix collects these:
Differentiability (Total Derivative)
is differentiable at if there is a linear map withMultivariable Chain Rule
Let be differentiable at and differentiable at . Then is differentiable at and
In coordinates, with a scalar depending on and each :
The special case (a single parameter , a curve ) gives the total derivative along a path:
Why It Holds / Derivation
Total-Derivative Chain Rule
We prove [4]. Write , , .
Step 1 — Set up linear approximations. By differentiability of at ,- by Step 1.
- For : for small , and .
(A subtle point: mere existence of partial derivatives is not enough; the proof crucially uses full differentiability of both maps — see the Counterexample below.)
Leonhard Euler | 1707–1783
Euler, in his Institutiones calculi differentialis and earlier papers (notably from 1734 onward), was among the first to systematically manipulate functions of several variables and the relations among their partial differentials. The notation and the practice of summing partial-differential contributions — the seed of equation [5] — grow directly from Euler's treatment of "functions of functions." His introduction of the symbol for partial differentiation and his fearless symbolic computation made the multivariable chain rule a routine tool a full century before its rigorous – foundation.
Building Intuition
Think of as the elevation on a mountain and imagine you are hiking along a trail parameterized by time , so your position is . Two things determine how fast your altitude changes:
- How steep the mountain is in the east and north directions — the partials , .
- How fast you are moving east and north — the velocities , .
Your altitude rate is the steepness in your direction of travel, obtained by weighting each slope by the corresponding speed and adding them (equation [6]). This is precisely .
The "tree diagram" / sum-over-paths picture: draw at the top, its intermediate variables below, and the true variables at the bottom. Every directed path from down to contributes a product of the derivatives along its edges; the chain rule says sum over all paths. The inner summation index in [5] is literally "which intermediate node did you pass through."
Tree diagram for $z=f(x,y)$, $x=x(s,t)$, $y=y(s,t)$. Each path from $z$ to $t$ contributes a product; sum the paths.
Worked Examples
Altitude rate along a circular path
Given: (units: meters, with in meters). A particle moves along , (meters), with in seconds. Find at . Step 1 — Partials. Step 2 — Velocities. Step 3 — Apply [6].Polar change of variables — a Jacobian product
Given: with , . Express and via , then evaluate for at . Step 1 — Jacobian of w.r.t. .Common Misconceptions
The treacherous "cancellation" of partials
The single-variable mnemonic ", cancel the " does not survive intact. With multiple intermediate variables you must sum over all of them; dropping a path is the most common error:
Partials exist but the chain rule fails — because differentiability fails
Existence of partial derivatives does not imply the chain rule. Let
Connections
The chain rule is the connective tissue between many areas:
- Gradient and Directional Derivative — equation [6], , is the directional derivative; the chain rule along a curve recovers it.
- Jacobian Matrix and Determinant — the rule says Jacobians multiply, , hence Jacobian determinants multiply, the engine of Change of Variables in Multiple Integrals.
- Implicit Function Theorem — differentiating a constraint via the chain rule yields .
- Inverse Function Theorem — applying the rule to gives .
- Backpropagation — reverse-mode automatic differentiation is the chain rule [4] computed right-to-left across a composition of layers.
- Total Differential — is the chain rule in differential-form clothing.
Real-World Applications
- Neural-network training (backpropagation). A deep network is a composition ; gradients of the loss w.r.t. each weight are computed by reverse-mode application of [4]. Frameworks like PyTorch and TensorFlow are, at heart, chain-rule engines.
- Thermodynamics. Relations among state variables — e.g. converting to via the chain rule and Maxwell relations — underlie the entire formalism of heat engines and the triple-product rule .
- Fluid dynamics (material derivative). The rate of change following a fluid parcel, , is precisely the chain rule applied to .
- General relativity / differential geometry. Tensor transformation laws under coordinate changes are built from the Jacobians multiplying via the chain rule.
- Economics — marginal analysis. A firm's output depends on capital and labor, each depending on price; the chain rule propagates a price change to output change through every channel.
- Robotics — inverse kinematics & Jacobian control. End-effector velocity equals the manipulator Jacobian times joint velocities, , a direct chain-rule statement.
- Sensitivity analysis & error propagation. Uncertainty in a derived quantity propagates via , derived from the linearization [3].
Historical Development
- 1670s — Leibniz develops differential notation and manipulates differentials of composite quantities, implicitly using a chain-rule idea via "infinitesimal" substitution.
- 1734 — Euler studies functions of two variables and the relations among their partial differentials, foreshadowing the summed form [5].
- 1755 — Euler's Institutiones calculi differentialis systematizes differentiation, including composite functions of several variables.
- 1797 — Lagrange (Théorie des fonctions analytiques) promotes the functional/derivative viewpoint, refining the notation .
- 1821 — Cauchy (Cours d'analyse) introduces rigorous limits, giving the single-variable chain rule its first sound proof and paving the way for the multivariable case.
- 1841 — Carl Jacobi introduces the functional determinant (the Jacobian), making the matrix structure of multivariable derivatives explicit and central to change of variables.
- 1860s–1880s — Riemann, Beltrami, Christoffel employ chain-rule transformation laws as the foundation of differential geometry and tensor analysis.
- 1900s — Fréchet and Gâteaux generalize the derivative to normed/infinite-dimensional spaces, where the chain rule takes its definitive operator form.
- 1986 — Rumelhart, Hinton & Williams popularize backpropagation, the chain rule's most consequential 20th-century application, igniting modern deep learning.
Subtleties & Limits
The classical theorem is closed and complete, but several boundary issues reward attention:
- Differentiability vs. partial derivatives. As the counterexample shows, (or full Fréchet differentiability) is essentially needed; partials alone can fail. Characterizing the minimal regularity under which a chain-rule identity holds in measure-theoretic or Sobolev settings (the chain rule for Sobolev/BV functions, the Vol'pert chain rule) remains a delicate research area in geometric measure theory.
- Nonsmooth analysis. For convex or merely locally Lipschitz functions, one replaces with the subdifferential or Clarke generalized gradient; the chain rule becomes an inclusion (a set), with equality only under qualification conditions.
- Infinite dimensions. In Banach spaces the Fréchet chain rule holds, but for the weaker Gâteaux derivative the chain rule can fail unless additional continuity is assumed — a genuine subtlety in the calculus of variations and PDE.
- Automatic differentiation accuracy. Reverse-mode AD is exact in exact arithmetic, but the practical question of numerically stable, memory-efficient chain-rule evaluation for very deep or recurrent compositions (checkpointing, vanishing/exploding gradients) is an active engineering frontier.