The Multivariable Chain Rule

One-line statement: The multivariable chain rule computes the derivative of a composition of functions when intermediate quantities depend on several variables, summing contributions through every dependency path. Key result in words: The total rate of change equals the sum, over all intermediate variables, of (rate of change of the output w.r.t. that intermediate) × (rate of change of that intermediate w.r.t. the input). Where it applies: Functions composed with other multivariable functions; physics, optimization, machine learning (backpropagation), thermodynamics, differential geometry. Who/when: Rooted in Leibniz's and Newton's calculus (1670s); generalized to multiple variables through the 18th–19th century (Euler, Cauchy); formalized via the Jacobian by the late 1800s.

The multivariable chain rule extends the single-variable chain rule to functions where several variables depend on several other variables. In its most compact form, the derivative (Jacobian matrix) of a composition is the matrix product of the individual Jacobians. This matters because almost every quantity in applied mathematics is a composition: temperature depends on position, position depends on time, and we want temperature's rate of change in time. The single most surprising and powerful fact is that the entire structure — no matter how many intermediate layers — collapses to repeated matrix multiplication, which is precisely why backpropagation in deep neural networks works and is computationally efficient. Mastering it requires keeping ruthless track of which variable depends on which.

The Core Insight

A change in an input variable propagates to the output through every chain of dependencies. To find the total derivative, you trace each path from input to output, multiply the local derivatives along that path, and add up all the paths. The "sum over paths" is the heart of the matter; the matrix-product formulation is just this sum written compactly.

Formal Statement

Partial and Total Derivatives

Let be a differentiable function. The partial derivative measures the rate of change of as varies while all other () are held fixed.

If each is a function of a single parameter , then becomes a function of alone, and its total derivative accounts for all the ways influences .

The Jacobian matrix of a map , , is the matrix

1
⟳stack the gradients as rows; entry is the sensitivity of output to input .

Multivariable Chain Rule — Scalar Output, Curve Input

Let be differentiable at a point, and let each be differentiable. Then the composition is differentiable and

2
⟳take the total differential and divide by ; the dot product is gradient times velocity.

Multivariable Chain Rule — Several Independent Variables

Let where each . Then for each ,

3
⟳hold all () fixed and apply equation [2] with playing the role of .

General Form — Jacobian Composition

Let be differentiable at and be differentiable at . Then is differentiable at and its Jacobian factors as a matrix product:

4
⟳the best linear approximation of a composition is the composition of best linear approximations; composing linear maps corresponds to multiplying their matrices.

The dimensions confirm consistency: , exactly the Jacobian of .

Why It Holds / Derivation

Proof via Differentiability and Linear Approximation

We prove equation [2]; the general case [4] follows by applying it component-wise.

Step 1 — Differentiability hypothesis. Since is differentiable at , by definition there is a remainder function with as such that
5
⟳this is precisely the definition of (total) differentiability — linear part plus error vanishing faster than .
Step 2 — Increment from . Let , so . Substituting into [5] and dividing by :
6
⟳divide both sides of [5] by the scalar and identify .
Step 3 — Take the limit. As : each by differentiability of ; the factor stays bounded (it tends to ); and since . Hence the error term vanishes and
7
⟳product of (something bounded) and (something ) is ; the surviving sum is the claim.

Why differentiability — not just partial derivatives — is required

The proof crucially uses the differentiability of (Step 1), which is stronger than mere existence of partial derivatives. A function can have all partials at a point yet fail to be differentiable, and the chain rule can then break. Always verify differentiability (e.g., continuous partials suffice — class ).

Augustin-Louis Cauchy | 1789–1857

While Leibniz and Newton wielded chain-rule reasoning informally, Cauchy is central to the rigorous – foundation that makes the proof above legitimate. His insistence on precise definitions of limit and derivative transformed the chain rule from a symbolic manipulation of differentials into a theorem with hypotheses (differentiability) and a remainder analysis. The Jacobian matrix formulation that crowns the modern statement is named for Carl Gustav Jacob Jacobi (1804–1851), whose 1841 treatise De determinantibus functionalibus systematized functional determinants.

Building Intuition

Sum Over Dependency Paths

Draw a dependency graph: arrows from each input to each intermediate variable, then from each intermediate to the output. To find :

  1. Find every directed path from the input node to the output node.
  2. Along each path, multiply the local derivatives on its edges.
  3. Sum over all paths.

If depends on , and both depend on , there are two paths from to (through , and through ), giving . The single-variable rule is the degenerate case of exactly one path.

Dependency graph for $z=f(u,v)$ with $u=u(s,t),\,v=v(s,t)$. Two paths carry $s$ to $z$.

s t u v z ∂u/∂s ∂v/∂s ∂z/∂u ∂z/∂v Gold paths: the two routes from s to z that are summed.

Worked Examples

A particle's temperature along a path

Given: Temperature field (°C, with in metres). A particle moves along , (metres), with in seconds. Find at s. Step 1 — Partials.
8
⟳differentiate treating the other variable as constant.
Step 2 — Velocities. , . Step 3 — Chain rule [2].
9
⟳substitute the partials and velocities into .
Step 4 — Evaluate at : , , , .
10
⟳plug numbers; both terms vanish.

Polar-coordinate partial derivatives

Given: with , . Find and at , . Step 1 — Partials of . , . Step 2 — Partials of .
11
⟳differentiate and w.r.t. and .
Step 3 — Chain rule [3].
12
⟳substitute and use .
13
⟳the two terms cancel — consistent with being independent of .
Step 4 — Evaluate at : , .
(Check: . ✓)

Common Misconceptions

Distinguish $\frac{\partial z}{\partial t}$ from $\frac{dz}{dt}$

When has an explicit and also , the total derivative includes both the direct and indirect dependence:

14
⟳ reaches directly (through the explicit slot) and indirectly (through ); sum both paths.
Forgetting the term is the single most common error in physics and economics. The notation (material derivative) in fluid dynamics is precisely this distinction made explicit.

Partials exist but the chain rule fails

Let

15
⟳a classic homogeneous-degree-zero example.
Both partials exist at the origin: (since on both axes). Now take the path , . Then for , so (constant), giving . The naive formula happens to agree here — but is not even continuous at the origin (limit along is , along axes is ), so it is not differentiable, and the chain rule has no theorem to stand on. The agreement is a coincidence, and along other constructions the naive formula misfires. Moral: existence of partials does not license the chain rule.

Connections

Where the chain rule plugs into the wider theory

The multivariable chain rule is the computational engine behind several neighbouring results. The Gradient Vector appears as the row-vector factor in equation [2], and the rule shows , directly yielding the Directional Derivative. The general Jacobian form [4] is the multivariable face of the Single-Variable Chain Rule, with matrix multiplication replacing scalar multiplication. It underlies the Implicit Function Theorem (differentiate a constraint along a curve), the change-of-variables formula in Multiple Integrals (through ), and the transformation of vector fields in Differential Geometry. In its iterated, layered form it is exactly the Backpropagation Algorithm.

Real-World Applications

Concrete uses across science and engineering

  1. Backpropagation (deep learning): Gradients of a loss w.r.t. millions of weights are computed by repeated application of equation [4] backward through network layers — the reverse-mode autodiff that trains every modern neural network.
  2. Thermodynamics: Relating partial derivatives of state functions under different held-fixed variables (e.g., converting between and ) uses chain-rule "triple product" identities.
  3. Fluid dynamics: The material derivative — the acceleration of a fluid parcel — is equation [14] in disguise, central to the Navier–Stokes equations.
  4. Robotics & control: Mapping joint-space velocities to end-effector velocities uses the manipulator Jacobian, the of the forward-kinematics map.
  5. Economics: Comparative statics and the implicit differentiation of equilibrium conditions (e.g., how output responds to a price change through several channels) rely on multivariable chain-rule bookkeeping.
  6. Computer graphics: Transforming surface normals and shading derivatives under coordinate or texture mappings uses Jacobian composition.
  7. General relativity / coordinate changes: Tensor components transform via products of — pure chain-rule Jacobians.

Historical Development

From Leibniz to backpropagation

  • 1676 — Gottfried Wilhelm Leibniz develops differential notation , and manipulates differentials of composite quantities, implicitly using chain-rule reasoning.
  • 1690s — Johann and Jakob Bernoulli apply chain-rule techniques to curves and the brachistochrone, treating differentials of functions of functions.
  • 1755 — Leonhard Euler, in Institutiones calculi differentialis, systematizes partial differentiation and differentials of functions of several variables.
  • 1797 — Joseph-Louis Lagrange introduces functional/prime notation, recasting the chain rule symbolically.
  • 1821 — Augustin-Louis Cauchy's Cours d'analyse supplies rigorous limit definitions, enabling a proper proof with error terms.
  • 1841 — Carl Gustav Jacob Jacobi publishes De determinantibus functionalibus, establishing the Jacobian determinant and matrix as the organizing object for transformations.
  • late 1800s — The matrix-product form of the chain rule [4] becomes standard as linear algebra and vector analysis mature (Gibbs, Heaviside).
  • 1960s–1986 — Reverse-mode automatic differentiation is developed (Linnainmaa, 1970) and popularized as backpropagation (Rumelhart, Hinton, Williams, 1986), recognizing the chain rule as the foundation of neural-network training.

Subtleties & Limits

Edge cases and ongoing care

The clean theorem [4] requires differentiability at the relevant points; weakening to mere directional or partial differentiability invalidates it (see the counterexample). Subtle questions persist in: (a) non-smooth analysis — chain rules for subdifferentials and Clarke generalized gradients of nonsmooth functions require careful constraint qualifications, and a single clean equation does not always hold; (b) infinite dimensions — in Banach/Fréchet spaces the chain rule for Fréchet derivatives holds, but Gâteaux differentiability is too weak, mirroring the finite-dimensional cautions; (c) automatic differentiation correctness — efficiently and exactly differentiating programs with control flow, recursion, and nondifferentiable kinks (ReLU, ) is an active engineering and theoretical area, where the naive chain rule can yield wrong or undefined values at kinks. The conceptual rule is settled; its rigorous reach into nonsmooth and infinite-dimensional settings remains a refined subject.

See Also

Partial Derivatives · The Gradient Vector · Jacobian Matrix · Single-Variable Chain Rule · Implicit Function Theorem · Directional Derivatives · Backpropagation Algorithm · Material Derivative · Change of Variables in Multiple Integrals

Before this

Where this leads