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:

Every "sum over paths" version of the chain rule you ever write down is just one entry of this matrix product spelled out.

Formal Statement

Partial Derivative and Jacobian

For , , the partial derivative of component with respect to coordinate is

1
⟳hold all coordinates but fixed; this is an ordinary one-variable difference quotient along the -th axis.

The Jacobian matrix collects these:

2
⟳stack the gradients (row vectors) of each component function; row , column is .
Here is the -th standard basis vector and .

Differentiability (Total Derivative)

is differentiable at if there is a linear map with
3
⟳demand that the linear part captures the change up to an error that vanishes faster than — this is the genuine, basis-free notion of derivative.

Multivariable Chain Rule

Let be differentiable at and differentiable at . Then is differentiable at and

4
⟳the best linear approximation of a composite is the composite of the best linear approximations; in matrix form composition = product.

In coordinates, with a scalar depending on and each :

5
⟳equation [5] is exactly the entry of the matrix product [4]; the sum over runs over the intermediate variables (the inner dimension of the product).

The special case (a single parameter , a curve ) gives the total derivative along a path:

6
⟳set in [5]; the row vector dotted with the velocity vector is the directional rate of change along the curve.

Why It Holds / Derivation

Total-Derivative Chain Rule

We prove [4]. Write , , .

Step 1 — Set up linear approximations. By differentiability of at ,
7
⟳this is definition [3] applied to , with remainder .
Step 2 — Feed into . Let . By differentiability of at ,
8
⟳same definition [3] applied to , with remainder .
Step 3 — Combine. Substitute :
9
⟳; group all non-linear leftovers into .
Step 4 — Error estimate. We must show .
  • by Step 1.
  • For : for small , and .
10
⟳bound each term using operator-norm linearity and the two conditions; the product of a vanishing factor and a bounded factor vanishes.
Conclusion. Equation [9] exhibits as a linear map satisfying definition [3] for . By uniqueness of the total derivative, .

(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:

  1. How steep the mountain is in the east and north directions — the partials , .
  2. 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.

z x y s t t s ∂z/∂x ∂z/∂y ∂x/∂s ∂x/∂t ∂y/∂s ∂y/∂t ∂z/∂t = (∂z/∂x)(∂x/∂t) + (∂z/∂y)(∂y/∂t)

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].
Step 4 — Evaluate at : , .
Check: Substituting first, , ; at this is ✓

Polar change of variables — a Jacobian product

Given: with , . Express and via , then evaluate for at . Step 1 — Jacobian of w.r.t. .
Step 2 — Chain rule [5] (row-vector form).
So
Step 3 — Plug in : , .
Step 4 — Evaluate at .
Sanity check: In polar coordinates , so and exactly — consistent, since is rotationally symmetric. ✓

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:

Also, inside the chain rule is evaluated at the image point , not at . And the symbols on the left vs. the partial of the original "w.r.t. " can mean genuinely different things when appears both directly and through intermediate variables — always specify what is held constant. In thermodynamics this ambiguity is so severe that the held-constant variable is written as a subscript, e.g. .

Partials exist but the chain rule fails — because differentiability fails

Existence of partial derivatives does not imply the chain rule. Let

Both partials exist at the origin: (since on the axes). Now compose with the line . Along it for and , so is discontinuous at and does not exist. The naive chain-rule prediction is meaningless. The fix: the theorem requires to be differentiable (e.g. ) at the point, which this is not — it is not even continuous at the origin along .

Connections

The chain rule is the connective tissue between many areas:

Real-World Applications

  1. 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.
  2. 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 .
  3. Fluid dynamics (material derivative). The rate of change following a fluid parcel, , is precisely the chain rule applied to .
  4. General relativity / differential geometry. Tensor transformation laws under coordinate changes are built from the Jacobians multiplying via the chain rule.
  5. 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.
  6. Robotics — inverse kinematics & Jacobian control. End-effector velocity equals the manipulator Jacobian times joint velocities, , a direct chain-rule statement.
  7. 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.

See Also

Gradient and Directional Derivative · Total Differential · Inverse Function Theorem · Material Derivative · Tensor Transformation Laws · Automatic Differentiation

Before this

Where this leads