Skip to content

Multivariable Chain Rule

Theorem

Let A⊆RnA\subseteq\mathbb{R}^n, B⊆RmB\subseteq\mathbb{R}^m, let g ⁣:A→B\boldsymbol{g}\colon A\to B, and let f ⁣:B→Rk\boldsymbol{f}\colon B\to\mathbb{R}^k. If g\boldsymbol{g} is differentiable at x0∈int⁡(A)\boldsymbol{x}_0\in\operatorname{int}(A), g(x0)∈int⁡(B)\boldsymbol{g}(\boldsymbol{x}_0)\in\operatorname{int}(B), and f\boldsymbol{f} is differentiable at g(x0)\boldsymbol{g}(\boldsymbol{x}_0), then f∘g\boldsymbol{f}\circ \boldsymbol{g} is differentiable at x0\boldsymbol{x}_0 and

D(f∘g)(x0)=Df(g(x0))Dg(x0).\boldsymbol{D}(\boldsymbol{f}\circ \boldsymbol{g})(\boldsymbol{x}_0)=\boldsymbol{D}\boldsymbol{f}(\boldsymbol{g}(\boldsymbol{x}_0))\boldsymbol{D}\boldsymbol{g}(\boldsymbol{x}_0).

Interpretation

Local changes pass through the inner map first and then through the outer map. This is why the derivative matrices multiply in the same order as the composition acts on changes.

Diagram of the maps g from R^n to R^m and f from R^m to R^k, with their derivatives under the arrows, and the composite f after g whose derivative is the matrix product Df(g(x0)) Dg(x0).

The local linear approximations compose in the same order as the maps. Near x0\boldsymbol{x}_0, the derivative of f∘g\boldsymbol{f}\circ \boldsymbol{g} is the product of the k×mk\times m matrix Df(g(x0))\boldsymbol{D}\boldsymbol{f}(\boldsymbol{g}(\boldsymbol{x}_0)) and the m×nm\times n matrix Dg(x0)\boldsymbol{D}\boldsymbol{g}(\boldsymbol{x}_0); reversing that order is generally invalid.

The Jacobian matrices represent the derivatives as linear maps. Their ordered product first applies the derivative of the inner function and then the derivative of the outer function; reversing the order is generally invalid and can even give incompatible dimensions.


Key Results

  • If g ⁣:Rn→Rm\boldsymbol{g}\colon\mathbb{R}^n\to\mathbb{R}^m and f ⁣:Rm→Rk\boldsymbol{f}\colon\mathbb{R}^m\to\mathbb{R}^k, then the product has size k×nk\times n.
  • If both maps are continuously differentiable near the relevant points, their composition is continuously differentiable near x0\boldsymbol{x}_0.

Examples

  • If g(x,y)=(x+y,xy)\boldsymbol{g}(x,y)=(x+y,xy) and f(u,v)=u2+vf(u,v)=u^2+v, then D(f∘g)=Df(g)Dg\boldsymbol{D}(f\circ \boldsymbol{g})=\boldsymbol{D}f(\boldsymbol{g})\boldsymbol{D}\boldsymbol{g}.
  • If g(t)=(t,t2)\boldsymbol{g}(t)=(t,t^2) and f(x,y)=x+yf(x,y)=x+y, the formula gives the curve derivative 1+2t1+2t.

Prerequisites

Sources

Aliases: multivariate chain rule Keywords: general chain rule, Jacobian chain rule, chain rule for Jacobians Symbols: element of, real numbers, subset

Last updated: 17 October 2026 21:53