The Chain Rule in Several Variables
Suppose a factory's output depends on capital and labor. Both capital and labor drift with time, following some economic policy. How fast does output change with time? In one-variable calculus, the answer is a single multiplication of derivatives. In several variables, the answer is a matrix product. Understanding why requires taking seriously what a derivative in several variables actually is. It is not a number, but a linear map. This map best approximates a function near a point. The chain rule in several variables is a key theorem. It states that composition of differentiable maps is differentiable. It also states that the derivative of the composition is the composition of the derivatives. Equivalently, this composition is the matrix product of the derivatives. It is the single most-used computational tool in multivariable calculus. It justifies implicit differentiation. It underlies change of variables in partial differential equations. It powers backpropagation in neural networks. It is also the technical engine behind the Implicit Function Theorem and Taylor's Theorem in Several Variables. The subtlety is this. In one variable, "derivative" is a scalar. The chain rule is , ordinary multiplication. In , the derivative of at a point is different. It is a linear transformation. Once bases are fixed, it is represented by the Jacobian Matrix. Composing two differentiable functions composes their best linear approximations. Composition of linear maps corresponds to matrix multiplication. This is not an analogy; it is a theorem. Its proof is a careful piece of – bookkeeping. It is built directly on the definition of the Total Derivative. This article states the precise hypotheses needed. These require differentiability at a point, not merely existence of partial derivatives. It proves the theorem in full using the total-derivative definition. It works two genuinely multivariable examples. It shows exactly what fails if we relax "differentiable" to "partial derivatives exist."
- The multivariable chain rule says , a composition of linear maps.
- In coordinates this composition is the matrix product of the Jacobian matrices: .
- Hypothesis is differentiability (existence of a good linear approximation), not merely existence of partial derivatives.
- The scalar chain rule and all "multivariable chain rule" formulas from calculus courses are special cases of one matrix identity.
- The proof is a direct – estimate: it bounds the composition's remainder using differentiability of both and , plus continuity of .
- Key idea: differentiation linearizes; composing differentiable maps composes their linearizations, and composing linear maps is matrix multiplication.
Where this lives today
The chain rule in matrix form is the computational backbone of backpropagation in machine learning: a neural network is literally a long composition of differentiable maps (affine layers composed with differentiable activation functions), and training requires the gradient of the loss with respect to every parameter, computed by repeatedly multiplying Jacobian matrices (or their transposes acting on vectors) layer by layer — reverse-mode automatic differentiation is precisely a computationally efficient application of this theorem. In physics and engineering, the chain rule underlies change of variables in partial differential equations: converting the heat or wave equation from Cartesian to polar, cylindrical, or curvilinear coordinates requires expressing derivatives with respect to new coordinates in terms of the old ones, exactly via the Jacobian product formula. In continuum mechanics, the deformation gradient of a material (itself a Jacobian matrix) composes according to this rule when successive deformations are applied. In pure mathematics, the theorem is the direct technical ingredient in the proof of the Inverse Function Theorem and the Implicit Function Theorem — both of which analyze compositions of a function with its (candidate) local inverse or with parametrizations of a level set, and both of which are indispensable in differential geometry, dynamical systems, and constrained optimization (Lagrange multipliers). In probability and statistics, the multivariate change-of-variables formula for densities under a smooth transformation uses the Jacobian determinant, and correctly deriving how a transformed random vector's density behaves under composition of transformations again invokes this chain rule.
Ask the tutor: Can you show me how the chain rule proof changes if maps into an infinite-dimensional Banach space instead of ?
Let be open and let . We say is differentiable at if there exists a linear map such that
The linear map , when it exists, is unique, and is called the (total) derivative of at . With respect to the standard bases, is represented by the Jacobian matrix
Now let be open, let , and suppose , so the composition
is well-defined. If is differentiable at and is differentiable at , the chain rule asserts that is differentiable at with derivative
the composite linear map . In matrix form,
an ordinary by matrix product, giving a matrix.
Intuition
The one-variable chain rule says: to first order, zooming in on near , you see two magnifications applied in sequence — stretch by , then stretch by — and sequential stretches multiply. In several variables the "stretch" at a point is not a single number but a linear map that can rotate, shear, and scale different directions differently. Composing two such maps means applying one linear transformation and then the other — and the matrix that represents "first apply , then apply " is exactly the product (applied to a column vector : ). So differentiability packages the intuitive idea "near , looks like an affine function " into a rigorous statement, and the chain rule packages "the best linear approximation to a composition is the composition of the best linear approximations." The content of the theorem is that these local linear pictures glue correctly under composition — that the error terms from approximating and approximating don't conspire to produce a non-negligible error in the composition. That is exactly what the proof below controls. A concrete visual: think of as a coordinate change (say, from polar-like parameters to Cartesian) and as a temperature field. Near a point, 's Jacobian tells you how a little rectangle of parameter-space gets stretched and sheared into a little parallelogram in physical space; 's Jacobian (a gradient, as a matrix) tells you the rate of temperature change per unit displacement in physical space. Multiplying the matrices tells you the rate of temperature change per unit displacement in parameter space — exactly the composite sensitivity.
Let and be open sets. Let
with , so is defined. Let and set . Suppose: 1. is differentiable at , with derivative ; 2. is differentiable at , with derivative . Then is differentiable at , and
Equivalently, writing Jacobian matrices with respect to the standard bases,
Technique. Direct – estimation from the definition of differentiability (the "little-o" definition), using continuity of at (itself a consequence of differentiability of at ) to control the size of the increment fed into 's remainder term.
Step 1: Set up remainder functions. Since is differentiable at , define for with :
By hypothesis (1),
Since is differentiable at , define for with :
By hypothesis (2),
It is convenient to extend continuously at : define for and ; by (2), is continuous at , and
Step 2: Continuity of at . We first record that differentiability of at implies is continuous at . Indeed, by the triangle inequality and the definition of as a linear (hence bounded — every linear map on is bounded) map, there is a constant with for all . Then
as , using (1). Hence as , i.e. is continuous at . This step is essential: it lets us pass and conclude the corresponding increment in 's domain also tends to , which is what allows us to invoke (2).
Step 3: Express the increment of . For small enough that (so that is defined and, by continuity established in Step 2 together with openness of and , lies in for all sufficiently small — since open means some ball , and continuity of at gives small enough that ), define
Then , and
using the definition of from Step 1. Substituting and using linearity of :
Since is linear (composition of linear maps is linear), we may write this as
To prove the theorem it suffices to show the right side of (3), divided by , tends to as .
Step 4: Estimate term (A). Since is linear on , it is bounded: there is with for all . Hence
by (1). So term (A)/.
Step 5: Estimate term (B). By (2'), . Now
Therefore
As : by Step 2 (continuity of at , equivalently ) and continuity of at (Step 1), . Also by (1), so the bracketed factor stays bounded (in fact tends to ). A product of a factor tending to and a bounded factor tends to . Hence term (B)/.
Step 6: Conclude. Combining Steps 4 and 5 with (3),
This is precisely the statement that is differentiable at with derivative . By uniqueness of the derivative (a standard consequence of the definition — if two linear maps both satisfy the defining limit condition, their difference satisfies , and testing along for fixed and forces for every , so ), this is the derivative .
Step 7: Matrix form. The matrix of a composition of linear maps, with respect to standard bases, is the matrix product of the matrices of the two maps (this is a standard fact from linear algebra: if has matrix and has matrix , then has matrix , since , and the coefficient is exactly the entry of ). Applying this with (matrix ) and (matrix ) gives
∎
Under the hypotheses of the theorem, write with components , and with components . Then for each and ,
This is simply the entry of the matrix identity , expanded via the row-times-column rule for matrix multiplication.
Worked examples
Example 1 (asymmetric coordinate change feeding a scalar field). Let be given by
and let be given by
We compute at the point using the chain rule, and check it against direct substitution. Step 1: evaluate at . With :
So . Step 2: Jacobian of at .
(Row 1: , . Row 2: , . Row 3: , .) Step 3: Jacobian of at .
(Since ; ; .) Step 4: multiply. By the theorem,
Entry 1 (the component):
Entry 2 (the component):
So
Check by direct substitution. . Differentiating directly with respect to :
At : , so first term is , matching. Second term: , matching exactly. The computation checks similarly. The chain-rule matrix product reproduces the direct computation, as it must.
Example 2 (a map to itself, second-order check via composition of two nontrivial maps). Let , , and let , . We compute the Jacobian of at . Step 1: . , . So . Step 2: .
Step 3: .
Step 4: product.
Check by direct substitution. . Let , ; the output is . First component : ; at : . Matches entry . ; at : . Matches entry . Second component : ; at : . Matches entry . ; at : . Matches entry . Both entries agree exactly with the matrix-product computation, confirming .
The theorem requires differentiable at and differentiable at — the full total-derivative condition, not just existence of the partial derivatives (which is a strictly weaker condition in several variables). Dropping this to "partial derivatives exist" breaks the conclusion. Let be the classical example
Both partial derivatives of exist at the origin: along , , so ; similarly . But is not differentiable at — indeed is not even continuous there, since along the line , for all , while . Now let , , which is differentiable everywhere (it's linear), with image point, i.e. take the composite variable , . Consider for , and . So is not even continuous at (it jumps from the constant value to ), hence certainly not differentiable there. If one attempted to apply a "chain rule" using only and formally, the naive formula would predict
suggesting is even differentiable with derivative — but is not even continuous at , a contradiction. The failure is entirely attributable to failing to be differentiable (in the total-derivative sense) at , even though both its partial derivatives exist there. This shows the hypothesis "differentiable at the point," not merely "partials exist," is exactly what the theorem needs and cannot be weakened.
Scope, edge cases & common traps
| Situation | What to check | Common pitfall |
|---|---|---|
| both (continuously differentiable) on open sets | differentiable at every point, chain rule applies freely | None — this is the safe, standard case used in most calculus courses |
| Partial derivatives of or exist but are not known to be continuous | Must verify differentiability directly (via the limit definition), not just existence of partials | Assuming existence of partials suffices; see the counterexample above |
| Domains don't compose correctly () | may not even be defined near | Silently plugging in formulas without checking the image lies in 's domain |
| Dimensions mismatched in matrix product | is , is ; inner dimensions () must match | Writing instead of — matrix multiplication is not commutative, and only one order is even conformable in general |
| Chain rule along a curve (implicit differentiation setup) | , : result is , a dot product, which is the case of the matrix product | Forgetting this is literally the same theorem, not a separate rule to memorize |
The mathematician behind it
Origins · 1 minCarl Gustav Jacob Jacobi and how this was discovered
Jacobi was a prodigiously productive 19th-century mathematician working in analysis, algebra, and mechanics. He systematized the study of the determinant of partial derivatives that now bears his name — the Jacobian — in his work on transformations of multiple integrals and systems of differential equations, and his functional-determinant calculus underlies the modern matrix formulation of the multivariable chain rule, though the fully rigorous – formulation of differentiability used in this article is a later, Weierstrass-era refinement.
Why is the multivariable chain rule a matrix product and not just a sum of products?
It is a sum of products entrywise — the corollary's formula is exactly what you get from expanding matrix multiplication entry by entry. The point of stating it as a matrix product rather than as a list of summation formulas is conceptual and practical: it makes clear that the derivative of a composition is the composition of linear maps (this is what "chain" really means — chaining two linear approximations together), it generalizes uniformly to any input/output dimensions without re-deriving index formulas each time, and it connects directly to the definition of the total derivative as a linear map rather than a table of numbers.
Does the chain rule require and to be continuously differentiable (), or just differentiable at a point?
Only differentiability at the relevant single points is required: differentiable at , and differentiable at . The proof given uses only the defining limit of differentiability at those two points (plus the automatic continuity of at that differentiability there implies). is a stronger, global condition (differentiable at every point of an open set with continuously varying derivative) that is often assumed in practice because it's easy to verify from formulas, but the chain rule itself is a pointwise statement and holds under the weaker pointwise hypothesis.
How does this relate to the one-variable chain rule I already know?
It specializes to it exactly. If , then and are matrices — literally the numbers and — and matrix multiplication of matrices is ordinary multiplication of real numbers. So reads , the familiar formula. Every version of the chain rule taught in a calculus sequence (single variable, multivariable "tree diagram" versions, directional derivative versions) is a special case of this one matrix statement.
What exactly goes wrong if I only assume the partial derivatives of and exist, rather than full differentiability?
Existence of partial derivatives only guarantees good linear approximation along the coordinate axis directions; it says nothing about behavior along other directions, and in particular does not even guarantee continuity of the function at the point, as the counterexample shows. Since the chain rule proof crucially uses continuity of the inner function (to know the increment fed into the outer function's remainder term also shrinks) and the full defining limit of differentiability for both maps, weakening either hypothesis to mere existence of partials removes exactly the ingredients the proof needs, and the conclusion can fail outright, including failure of the composite to be continuous, let alone differentiable.
Is the chain rule the same thing as implicit differentiation?
Implicit differentiation is a direct application of the chain rule, not a separate rule. If implicitly defines as a differentiable function of , differentiating the composition using the chain rule gives , hence where . This is exactly the scalar chain rule for the composite map , and its rigorous justification (that actually is differentiable) is precisely the content of the Implicit Function Theorem, whose proof in turn uses this chain rule.
Does the chain rule generalize beyond , e.g. to infinite dimensions or manifolds?
Yes. In normed vector spaces (Banach spaces), the same statement and essentially the same proof (with "linear map" meaning "bounded linear operator" and norms replacing Euclidean norms) yield the chain rule for the Fréchet derivative, which is the natural generalization used in the calculus of variations and nonlinear functional analysis. On smooth manifolds, the chain rule for the differential of a smooth map between manifolds is stated and proved using local coordinate charts, reducing again to compositions of Euclidean-space maps and this exact theorem — it's the local model in every more general setting.
How does this connect to the Jacobian determinant and change of variables in multiple integrals?
When (same input and output dimension at every stage), the Jacobian matrices are square, and one can take determinants. Since for square matrices, the chain rule immediately gives — the determinants of composed coordinate changes multiply. This is exactly the fact used to verify that the change-of-variables formula for multiple integrals composes correctly when you chain two coordinate transformations (e.g., Cartesian → cylindrical → a further curvilinear system).