Tutorials › Calculus III › Jacobians and the Multivariable Chain Rule

Jacobians and General Substitutions · Tutorial 677 of 999

Jacobians and the Multivariable Chain Rule

Learn to differentiate composed coordinate maps by multiplying their Jacobian matrices in the correct order, then use determinant multiplicativity to relate their Jacobians.

Advanced 10 min read

What You'll Learn

  • Define the Jacobian matrix for a map between Euclidean spaces
  • Apply the matrix chain rule to a composition of differentiable maps
  • Determine the correct order of the Jacobian factors
  • Relate the determinant of a composite Jacobian to the determinants of its factors
  • Check two- and three-variable calculations by direct differentiation
  • Identify why reversing matrix order gives an incorrect Jacobian

Introduction

Coordinate calculations often happen in stages. A point in one coordinate system is first mapped to an intermediate point, and that intermediate point is then mapped to the final coordinates. To differentiate the overall map, we need to account for both stages.

The multivariable chain rule does this with matrices: the Jacobian matrix of a composition is the product of the Jacobian matrices of its component maps. The order of multiplication matters, and determinant multiplicativity then gives a corresponding formula for the determinants.

Central rule: If \(G\) maps one coordinate space to another and \(F\) maps that intermediate space onward, then the Jacobian of \(F\circ G\) is \(DF(G(\mathbf{u}))DG(\mathbf{u})\). The factor from the later map is on the left.

Jacobian Matrices and Composed Maps

Let \(G:\mathbb{R}^n\to\mathbb{R}^m\) be differentiable, with component functions \(G_1,\ldots,G_m\). Its Jacobian matrix at \(\mathbf{u}=(u_1,\ldots,u_n)\) is the \(m\)-by-\(n\) matrix of first partial derivatives:

$$ DG(\mathbf{u}) = \left[ \frac{\partial G_i}{\partial u_j}(\mathbf{u}) \right]_{\substack{1\le i\le m\\1\le j\le n}}. $$

Each row corresponds to one output component, and each column corresponds to one input variable. This convention makes the derivative act on a small input change \(\mathbf{h}\) by matrix multiplication: the resulting first-order output change is \(DG(\mathbf{u})\mathbf{h}\).

Suppose \(G:\mathbb{R}^n\to\mathbb{R}^m\) and \(F:\mathbb{R}^m\to\mathbb{R}^p\) are differentiable. Their composition \(H=F\circ G\) is the map that first applies \(G\), then applies \(F\). At \(\mathbf{u}\), the intermediate point is \(G(\mathbf{u})\). The matrix \(DG(\mathbf{u})\) has size \(m\)-by-\(n\), while \(DF(G(\mathbf{u}))\) has size \(p\)-by-\(m\), so their product has the required \(p\)-by-\(n\) size.

Theorem: Multivariable chain rule. If \(G:\mathbb{R}^n\to\mathbb{R}^m\) is differentiable at \(\mathbf{u}\), and \(F:\mathbb{R}^m\to\mathbb{R}^p\) is differentiable at \(G(\mathbf{u})\), then \(F\circ G\) is differentiable at \(\mathbf{u}\) and $$ D(F\circ G)(\mathbf{u})=DF(G(\mathbf{u}))DG(\mathbf{u}). $$

Why the Matrix Chain Rule Holds

Differentiability means that, near a point, a function is approximated by its derivative together with an error that becomes negligible compared with the input change. Applying that fact first to \(G\) and then to \(F\) explains both the product and its order.

1
Approximate the inner map.
Write \(A=DG(\mathbf{u})\). For a small change \(\mathbf{h}\), differentiability gives \(G(\mathbf{u}+\mathbf{h})=G(\mathbf{u})+A\mathbf{h}+\mathbf{r}(\mathbf{h})\), where \(\|\mathbf{r}(\mathbf{h})\|/\|\mathbf{h}\|\to 0\) as \(\mathbf{h}\to\mathbf{0}\).
2
Approximate the outer map.
Write \(B=DF(G(\mathbf{u}))\). For a small intermediate change \(\mathbf{k}\), differentiability gives \(F(G(\mathbf{u})+\mathbf{k})=F(G(\mathbf{u}))+B\mathbf{k}+\mathbf{s}(\mathbf{k})\), where \(\|\mathbf{s}(\mathbf{k})\|/\|\mathbf{k}\|\to 0\) as \(\mathbf{k}\to\mathbf{0}\).
3
Substitute the first approximation into the second.
Take \(\mathbf{k}=A\mathbf{h}+\mathbf{r}(\mathbf{h})\). Then the linear term from the outer approximation is \(B\mathbf{k}=BA\mathbf{h}+B\mathbf{r}(\mathbf{h})\).

To finish the justification, a fixed matrix maps a remainder that is negligible relative to \(\|\mathbf{h}\|\) to another such remainder. Thus \(B\mathbf{r}(\mathbf{h})=o(\|\mathbf{h}\|)\). Also, \(\mathbf{k}=O(\|\mathbf{h}\|)\), so the outer remainder \(\mathbf{s}(\mathbf{k})\) is \(o(\|\mathbf{h}\|)\). Combining the terms gives

$$ F(G(\mathbf{u}+\mathbf{h})) = F(G(\mathbf{u}))+BA\mathbf{h}+o(\|\mathbf{h}\|). $$

This is precisely differentiability of the composition with derivative \(BA\). The outer map acts on the change produced by the inner map, which is why its derivative matrix appears on the left.

Determinants of Composed Jacobians

When the input, intermediate, and output spaces all have the same dimension \(n\), the Jacobian matrices are square and their determinants are defined. The determinant product rule for square matrices says \(\det(AB)=\det(A)\det(B)\). Applying it to the chain rule gives the determinant formula below.

Determinant rule for a composition: If \(F,G:\mathbb{R}^n\to\mathbb{R}^n\) satisfy the differentiability conditions of the chain rule, then $$ \det D(F\circ G)(\mathbf{u}) = \det DF(G(\mathbf{u}))\, \det DG(\mathbf{u}). $$ No invertibility assumption is needed for this identity.

The value of \(DF\) must be taken at the intermediate point \(G(\mathbf{u})\), not at the original input \(\mathbf{u}\), unless those points happen to be the same. The order matters for the matrix product, even though the two determinant values are real numbers and their multiplication commutes.

Worked Example: A Two-Variable Composition

Worked Example: A Two-Variable Composition

Let \(G(u,v)=(u+v,u-v)\) and \(F(x,y)=(x^2,y^3)\). Find the Jacobian matrix of \(H=F\circ G\) at \((1,2)\), and compare the determinants.

First evaluate the intermediate map:

$$G(1,2)=(1+2,1-2)=(3,-1).$$

The two Jacobian matrices are

$$DG(u,v)=\begin{bmatrix}1&1\\1&-1\end{bmatrix},\qquad DF(x,y)=\begin{bmatrix}2x&0\\0&3y^2\end{bmatrix}.$$

At the required points, this gives

$$DG(1,2)=\begin{bmatrix}1&1\\1&-1\end{bmatrix},\qquad DF(3,-1)=\begin{bmatrix}6&0\\0&3\end{bmatrix}.$$

Use the chain rule in the correct order:

$$DH(1,2)=DF(G(1,2))DG(1,2)=\begin{bmatrix}6&0\\0&3\end{bmatrix}\begin{bmatrix}1&1\\1&-1\end{bmatrix}=\begin{bmatrix}6&6\\3&-3\end{bmatrix}.$$

The determinant of the inner Jacobian is \(1(-1)-1(1)=-2\), and the determinant of the outer Jacobian at \((3,-1)\) is \(6(3)-0=18\). Their product is \(18(-2)=-36\). Directly, the determinant of the product matrix is \(6(-3)-6(3)=-18-18=-36\).

As a further check, \(H(u,v)=((u+v)^2,(u-v)^3)\). Its derivative has rows \((2(u+v),2(u+v))\) and \((3(u-v)^2,-3(u-v)^2)\). At \((1,2)\) these become \((6,6)\) and \((3,-3)\), exactly the matrix found by composition.

Worked Example: A Three-Variable Composition

Worked Example: A Three-Variable Composition

Consider \(G(r,\theta,z)=(r\cos\theta,r\sin\theta,z)\) followed by \(F(x,y,z)=(2x,3y,4z)\). Compute the derivative of \(F\circ G\) at \((2,0,1)\) and verify its determinant.

The intermediate point is \(G(2,0,1)=(2\cos 0,2\sin 0,1)=(2,0,1)\). The derivative matrices are

$$DG(r,\theta,z)=\begin{bmatrix}\cos\theta&-r\sin\theta&0\\\sin\theta&r\cos\theta&0\\0&0&1\end{bmatrix},\qquad DF(x,y,z)=\begin{bmatrix}2&0&0\\0&3&0\\0&0&4\end{bmatrix}.$$

Since \(\cos 0=1\) and \(\sin 0=0\),

$$DG(2,0,1)=\begin{bmatrix}1&0&0\\0&2&0\\0&0&1\end{bmatrix},\qquad DF(2,0,1)=\begin{bmatrix}2&0&0\\0&3&0\\0&0&4\end{bmatrix}.$$

Multiplying in the chain-rule order gives

$$D(F\circ G)(2,0,1)=\begin{bmatrix}2&0&0\\0&3&0\\0&0&4\end{bmatrix}\begin{bmatrix}1&0&0\\0&2&0\\0&0&1\end{bmatrix}=\begin{bmatrix}2&0&0\\0&6&0\\0&0&4\end{bmatrix}.$$

The inner determinant is \(1\cdot 2\cdot 1=2\), and the outer determinant is \(2\cdot 3\cdot 4=24\). The determinant product is \(24\cdot 2=48\). The product matrix has determinant \(2\cdot 6\cdot 4=48\), as required.

Direct composition gives \(H(r,\theta,z)=(2r\cos\theta,3r\sin\theta,4z)\). At \((2,0,1)\), its derivative is the same diagonal matrix above. More generally, the determinant of \(DG(r,\theta,z)\) is \(r\), while \(\det DF=24\); hence the chain rule gives \(\det D(F\circ G)=24r\). Directly differentiating \(H\) gives a matrix whose determinant is \(24r(\cos^2\theta+\sin^2\theta)=24r\), confirming the formula.

Worked Example: A Scalar Function After a Coordinate Map

Worked Example: A Scalar Function After a Coordinate Map

Let \(q(x,y)=x^2+xy+y^2\) and \(G(s,t)=(s+t,s-t)\). Find the derivative row of \(q\circ G\) at \((1,2)\) using the chain rule, then check it by simplifying the composition.

The derivative of \(q\) is the row matrix \(Dq(x,y)=[2x+y,\ x+2y]\). Since \(G(1,2)=(3,-1)\),

$$Dq(3,-1)=[2(3)+(-1),\ 3+2(-1)]=[5,1].$$

The Jacobian of \(G\) is \(DG(s,t)=\begin{bmatrix}1&1\\1&-1\end{bmatrix}\). Therefore, the composite derivative is

$$D(q\circ G)(1,2)=[5,1]\begin{bmatrix}1&1\\1&-1\end{bmatrix}=[5+1,\ 5-1]=[6,4].$$

For a direct check, substitute \(x=s+t\) and \(y=s-t\):

$$ (q\circ G)(s,t) =(s+t)^2+(s+t)(s-t)+(s-t)^2 =3s^2+t^2. $$

Its derivative row is \([6s,2t]\), which at \((1,2)\) equals \([6,4]\). This scalar-valued case uses the same matrix rule: the derivative row of the outer function multiplies the Jacobian of the inner map.

A Common Pitfall: Reversing the Factors

Matrix multiplication is generally not commutative: \(AB\) need not equal \(BA\). Reversing the Jacobian factors can therefore produce an incorrect derivative, even when the dimensions allow both products.

In the first example, the incorrect order would be

$$ DG(1,2)DF(3,-1) = \begin{bmatrix}1&1\\1&-1\end{bmatrix} \begin{bmatrix}6&0\\0&3\end{bmatrix} = \begin{bmatrix}6&3\\6&-3\end{bmatrix}. $$

This does not match the direct derivative of \(H\), whose first row is \((6,6)\), not \((6,3)\). The correction is to follow the order of the maps: \(G\) acts first, and \(F\) acts second, so \(DF(G(\mathbf{u}))\) must multiply \(DG(\mathbf{u})\) from the left.

There is a subtle check to keep in mind: the determinant of the incorrectly reversed product is also \(-36\), because \(\det(DG)\det(DF)=\det(DF)\det(DG)\). Thus, a matching determinant alone does not confirm that the Jacobian matrix itself is correct. Check the matrix product order or differentiate the composite directly.

Why the Rule Matters

Coordinate transformations are often constructed in stages. One map may convert parameters into an intermediate coordinate system, while a second map rescales or otherwise changes those coordinates. The chain rule allows the derivative of the complete transformation to be assembled from the derivatives of the simpler stages.

The determinant formula provides a related check: for square Jacobians, the determinant of the composite derivative is the product of the determinant at each stage, evaluated at the appropriate point. This is useful when tracing how local scaling factors combine. The matrix rule remains the primary calculation; it preserves all first-order directional information, whereas the determinant records only one scalar quantity.

Practical takeaway: For a composition \(F\circ G\), evaluate the outer Jacobian at \(G(\mathbf{u})\), multiply \(DF(G(\mathbf{u}))DG(\mathbf{u})\), and only then take the determinant if needed.

Check Your Understanding

Use the definitions and rules above to answer these questions.

  1. If \(G:\mathbb{R}^2\to\mathbb{R}^3\) and \(F:\mathbb{R}^3\to\mathbb{R}^2\), what are the sizes of \(DG\), \(DF\), and \(D(F\circ G)\)?
  2. For \(F\circ G\), at what point should \(DF\) be evaluated?
  3. State the matrix chain rule and explain why the outer map’s Jacobian is the left factor.
  4. If the maps and Jacobians are square, how does the determinant of the composite Jacobian relate to the two determinant factors?
  5. Why might checking only the determinant fail to reveal that a Jacobian matrix product was taken in the wrong order?