Companion page · Calculus meets linear algebra

The Jacobian

Zoom in far enough on any smooth map and it looks linear. The Jacobian is that linear map: the matrix of first derivatives that says how a field stretches, shears and rotates the space around a point. Divergence and curl are read straight off it, and so are the change-of-variables formula, Newton’s method and the stability of an equilibrium.

Assumed background: partial derivatives, matrix–vector multiplication, determinants and eigenvalues. Notation follows the main guide: bold letters are vectors, and \(\vF\) is a generic field.

A smooth map bends a square grid. Around the moving point, the image of one small square (shaded) is almost exactly the parallelogram spanned by the Jacobian’s two columns, J e₁ and J e₂ (dashed outline). The smaller the square, the closer the match.

Section 1 · The matrix of first derivatives

Definition

Every partial derivative of every component, arranged so that it multiplies a displacement.

Definition\[J_{\vF}=\begin{bmatrix}\dfrac{\partial F_1}{\partial x_1} & \cdots & \dfrac{\partial F_1}{\partial x_n}\\ \vdots & \ddots & \vdots\\ \dfrac{\partial F_m}{\partial x_1} & \cdots & \dfrac{\partial F_m}{\partial x_n}\end{bmatrix},\qquad J_{ij}=\frac{\partial F_i}{\partial x_j}\]
Linearization\[\vF(\vr+\vh)=\vF(\vr)+J_{\vF}(\vr)\,\vh+O\!\left(|\vh|^2\right)\]
\(\vF\)
a smooth map from \(\mathbb R^n\) to \(\mathbb R^m\); in electromagnetism usually a field from \(\mathbb R^3\) to \(\mathbb R^3\)
\(\vh\)
a small displacement from the point \(\vr\)
\(J_{\vF}(\vr)\)
an \(m\times n\) matrix, evaluated at \(\vr\); it changes from point to point

Background

The matrix is named for Carl Gustav Jacob Jacobi, whose 1841 memoir on “functional determinants” studied the determinant of this matrix systematically. The idea underneath is older and simpler: a derivative is the best linear approximation to a function near a point. For a function of one variable that approximation is a number, the slope. For a map between spaces of several dimensions it has to be a matrix, because each output can respond to each input separately.

Reading the matrix

Row \(i\) is the gradient of the \(i\)-th component, \(\nabla F_i\), written as a row. It says how that one output changes as you move in any direction. Column \(j\) is \(\partial\vF/\partial x_j\): the velocity of the whole output as you slide the input along the \(x_j\) axis. Multiply the matrix by a direction and you get the directional derivative of the whole field:

\[J\,\vv=(\vv\cdot\nabla)\vF=\lim_{t\to0}\frac{\vF(\vr+t\vv)-\vF(\vr)}{t}\]

Three shapes are worth recognizing. A scalar function \(f:\mathbb R^n\to\mathbb R\) has a \(1\times n\) Jacobian, which is its gradient laid on its side. A curve \(\vr(t):\mathbb R\to\mathbb R^n\) has an \(n\times1\) Jacobian, its velocity. A vector field \(\mathbb R^3\to\mathbb R^3\) has a square \(3\times3\) Jacobian, and square matrices have a trace, a determinant and eigenvalues. That last case is the one Maxwell’s equations live in:

\[J_{\vF}=\begin{bmatrix}\partial_xF_x & \partial_yF_x & \partial_zF_x\\ \partial_xF_y & \partial_yF_y & \partial_zF_y\\ \partial_xF_z & \partial_yF_z & \partial_zF_z\end{bmatrix}\]

The chain rule is matrix multiplication

Compose two maps and their best linear approximations compose too:

\[J_{\mathbf G\circ\vF}(\vr)=J_{\mathbf G}\big(\vF(\vr)\big)\,J_{\vF}(\vr)\]

Every multivariable chain rule you have memorized, with its sums over intermediate variables, is one entry of this matrix product.

Section 2 · What the matrix does to a small square

Local linearity

Up close, every smooth field is a linear field, and \(J\) is its matrix.

The linearization says the error in \(\vF(\vr+\vh)\approx\vF(\vr)+J\vh\) shrinks like \(|\vh|^2\), faster than \(\vh\) itself. Geometrically, a small square with sides \(h\,\mathbf e_1\) and \(h\,\mathbf e_2\) lands, after the map, very close to the parallelogram with sides \(h\,J\mathbf e_1\) and \(h\,J\mathbf e_2\), the scaled columns of \(J\). Its area is \(|\det J|\,h^2\). Halve the square and the curved edges straighten: the relative mismatch halves too.

For a vector field there is a second reading that connects straight to the main guide. Lab 0 there explores linear fields \(\vF=M\vr\), whose divergence is \(\operatorname{tr}M\) and whose curl is \(M_{21}-M_{12}\) everywhere. Near any point, a smooth field differs from its value at that point by approximately such a linear field, with \(M=J\). So the divergence and curl of any field at a point are the trace and the antisymmetric part of its Jacobian there.

Interactive · Lab J

Zoom until it’s linear

The left panel shows a nonlinear field \(\vF\) in the plane. Drag the copper probe anywhere, or click to move it. The right panel zooms into the square around the probe and compares two arrows at each grid point: the actual change \(\vF(\vr_0+\vh)-\vF(\vr_0)\) in copper, and the Jacobian’s prediction \(J\vh\) as a wide blue band. Slide the zoom and watch them merge; the error readout falls in proportion to the window size.

The readouts show what the Jacobian at the probe says: its trace is the divergence, \(J_{21}-J_{12}\) is the curl, \(\det J\) is the local area scale, and the dashed green lines are the principal stretch axes of its symmetric part (Section 3).

Field · grid spacing 1 unit

Inside the window, centred on the probe

actual changeJ hstretch axes

Keyboard: focus the field plot, then arrow keys move the probe (Shift for bigger steps) and + / − zoom.

Field
J₁₁—
J₁₂—
J₂₁—
J₂₂—
∇·F = tr J
—
Curl = J₂₁ − J₁₂
—
det J (area scale)
—
Eigenvalues of J
—
Stretch rates (eig. of S)
—
Linearization error
—

Section 3 · Symmetric and antisymmetric parts

Stretch, shear, rotate

Divergence and curl are two of the three things a Jacobian can do.

Symmetric part · stretch\[S=\tfrac12\left(J+J^{\mathsf T}\right),\qquad \operatorname{tr}S=\operatorname{tr}J=\nabla\cdot\vF\]
Antisymmetric part · rotation\[A=\tfrac12\left(J-J^{\mathsf T}\right)=\frac12\begin{bmatrix}0 & -\omega_z & \omega_y\\ \omega_z & 0 & -\omega_x\\ -\omega_y & \omega_x & 0\end{bmatrix}\]

where \(\vw=\nabla\times\vF\)

Every square matrix splits in exactly one way into a symmetric part and an antisymmetric part. For a Jacobian, both parts have physical meaning.

S is the stretch. Because \(S\) is symmetric, the spectral theorem gives it real eigenvalues and perpendicular eigenvectors. Along each eigenvector the field changes at the rate given by the eigenvalue, without turning: these are the principal stretch axes, the dashed green lines in Lab J. Their rates add up to the trace, which is the divergence.

A is the rotation. \(A\) has three independent entries, and they are the components of the curl. For every vector \(\mathbf u\),

\[A\,\mathbf u=\tfrac12\,(\nabla\times\vF)\times\mathbf u\]

Acting on a small displacement, \(A\) turns it rigidly about the axis \(\nabla\times\vF\) at angular rate \(\tfrac12|\nabla\times\vF|\). This is the paddle wheel from the Primer in the main guide.

Take the trace out of \(S\) as well and the Jacobian falls into three pieces, with nothing left over:

\[J=\underbrace{\tfrac13(\nabla\cdot\vF)\,I}_{\text{expansion: 1 number}}+\underbrace{\Big(S-\tfrac13(\nabla\cdot\vF)\,I\Big)}_{\text{shear: 5 numbers}}+\underbrace{\tfrac12\,[\nabla\times\vF]_{\times}}_{\text{rotation: 3 numbers}}\]

Here \([\vw]_\times\) is the matrix that computes \(\vw\times\mathbf u\). The counts add to \(1+5+3=9\), the entries of a \(3\times3\) matrix. Maxwell’s equations specify the first piece and the last piece at every point, through the divergence and the curl. They say nothing locally about the five shear numbers, and they don’t need to: once the divergence and curl are known everywhere, and the field dies away at infinity, Helmholtz’s theorem fixes the whole field, shear included.

Two special cases. A gradient field \(\vF=\nabla\varphi\) has \(J\) equal to the Hessian of \(\varphi\), which is symmetric because mixed partial derivatives commute. So \(A=0\) and the curl vanishes: the identity \(\nabla\times\nabla\varphi=\mathbf 0\), read off a matrix. In the other direction, a field whose Jacobian is antisymmetric everywhere is a rigid motion, a uniform translation plus a uniform rotation.

Section 4 · How volume changes

The determinant

\(\det J\) is the factor by which a map scales small volumes.

Change of variables\[\int_{\Phi(U)} f(\vx)\,d^n x=\int_U f\big(\Phi(\vu)\big)\,\big|\det J_\Phi(\vu)\big|\,d^n u\]
Volume along a flow (Jacobi’s formula)\[\frac{d}{dt}\det\Phi_t=(\nabla\cdot\vF)\,\det\Phi_t\]

A small box of volume \(dV\) lands, after the map, on a region of volume \(|\det J|\,dV\). A negative determinant means the map also flips orientation, turning a left hand into a right hand. That is all the change-of-variables formula says: chop \(U\) into small boxes, map each one, and correct the integrand for how much each box grew.

The familiar volume elements are Jacobian determinants. Polar coordinates give \(dA=r\,dr\,d\theta\), cylindrical coordinates give \(dV=\rho\,d\rho\,d\phi\,dz\), and spherical coordinates give \(dV=r^2\sin\theta\,dr\,d\theta\,d\phi\). Example 5.1 works out the polar case.

Where \(\det J\neq0\), the inverse function theorem says the map can be undone near that point, and the Jacobian of the inverse is the inverse matrix, \(J_{\Phi^{-1}}=J_\Phi^{-1}\). Where \(\det J=0\), the map crushes some direction flat. Coordinates fail there, as spherical coordinates do on the polar axis, where \(\sin\theta=0\).

Divergence is the rate of change of volume

Let a field drive a flow, \(\dot{\vr}=\vF(\vr)\), and let \(\Phi_t\) be the Jacobian of the flow map: how the position at time \(t\) depends on the starting position. Differentiating \(\dot{\vr}=\vF(\vr)\) with respect to the starting point gives \(\dot\Phi_t=J_{\vF}\,\Phi_t\). Jacobi’s formula for the derivative of a determinant, \(\tfrac{d}{dt}\det\Phi=\det\Phi\,\operatorname{tr}\!\big(\Phi^{-1}\dot\Phi\big)\), then gives the equation in the box above:

\[\frac{d}{dt}\det\Phi_t=\det\Phi_t\,\operatorname{tr}\!\big(\Phi_t^{-1}J_{\vF}\Phi_t\big)=\det\Phi_t\,\operatorname{tr}J_{\vF}=(\nabla\cdot\vF)\,\det\Phi_t\]

A small blob carried by the flow grows in volume at the fractional rate \(\nabla\cdot\vF\). This is the flux definition of divergence from the main guide, seen from inside the flow. When \(\nabla\cdot\vF=0\) the flow preserves volume; Liouville’s theorem in Hamiltonian mechanics and incompressibility in fluid flow are both this statement.

Section 5 · Worked examples and uses

In practice

Coordinates, fields from the main guide, and where engineers meet Jacobians.

Worked examples

Example 5.1 · Polar coordinates

The map \(\Phi(r,\theta)=(r\cos\theta,\;r\sin\theta)\) has

\[J_\Phi=\begin{bmatrix}\cos\theta & -r\sin\theta\\ \sin\theta & r\cos\theta\end{bmatrix},\qquad \det J_\Phi=r\cos^2\theta+r\sin^2\theta=r\]

So \(dA=r\,dr\,d\theta\). The first column is the unit radial vector; the second is \(r\) times the unit angular vector, because a step in \(\theta\) sweeps an arc that grows with \(r\). The classic payoff is the Gaussian integral:

\[\left(\int_{-\infty}^{\infty}e^{-x^2}dx\right)^{2}=\int_0^{2\pi}\!\!\int_0^\infty e^{-r^2}\,r\,dr\,d\theta=\pi\]
Example 5.2 · A point charge, and tides

For \(\vE=k\,\vr/r^3\) with \(k=q/4\pi\varepsilon_0\), differentiate \(k\,x_i\,r^{-3}\) with respect to \(x_j\):

\[J_{ij}=\frac{k}{r^3}\left(\delta_{ij}-\frac{3x_ix_j}{r^2}\right),\qquad J=\frac{k}{r^3}\left(I-3\,\rhat\rhat^{\mathsf T}\right)\]

\(J\) is symmetric, so \(\nabla\times\vE=\mathbf 0\). Its trace is \((k/r^3)(3-3)=0\), so \(\nabla\cdot\vE=0\) away from the charge. Its eigenvalues are \(-2k/r^3\) along \(\rhat\) and \(+k/r^3\) twice across it. For gravity, \(k=-GM\) and the same matrix is the tidal tensor: it stretches a body by \(2GM/r^3\) of relative acceleration per metre along the line to the mass and squeezes it by \(GM/r^3\) across. That is why the oceans have two bulges.

Example 5.3 · A line current

In the plane perpendicular to a long wire, \(\vB=\frac{\mu_0 I}{2\pi}\,\frac{(-y,\;x)}{\rho^2}\) with \(\rho^2=x^2+y^2\). Differentiating gives

\[J=\frac{\mu_0 I}{2\pi\rho^4}\begin{bmatrix}2xy & y^2-x^2\\ y^2-x^2 & -2xy\end{bmatrix}\]

Symmetric and traceless: zero curl and zero divergence away from the wire. Every field line circles the wire, yet the local change of \(\vB\) is pure shear, with stretch axes at 45° to the radius. A paddle wheel placed off the wire does not turn. All of the curl sits on the wire itself, which is what Ampère’s law says. Try the Filament preset in Lab J.

Example 5.4 · Rigid rotation

A body spinning at angular velocity \(\Omega\) about \(z\) has velocity \(\vv=\vw\times\vr=(-\Omega y,\;\Omega x,\;0)\), so

\[J=\begin{bmatrix}0 & -\Omega & 0\\ \Omega & 0 & 0\\ 0 & 0 & 0\end{bmatrix}=[\vw]_\times\]

Purely antisymmetric: no stretch, no divergence. The curl is \(\nabla\times\vv=2\vw\), twice the angular velocity, which is where the \(\tfrac12\) in \(A=\tfrac12[\nabla\times\vF]_\times\) comes from.

Applications

  • Newton’s method

    Solve \(\vF(\vx)=\mathbf 0\) by repeatedly solving the linear system \(J\,\Delta\vx=-\vF(\vx)\). Circuit simulators such as SPICE do this at every time step to handle diodes and transistors, and nonlinear finite-element solvers do the same.

  • Finite elements

    Each curved element is the image of a reference square or triangle. The determinant of that map’s Jacobian scales every element integral, and its inverse converts gradients into physical coordinates.

  • Stability of equilibria

    At a fixed point of \(\dot{\vx}=\mathbf f(\vx)\), the eigenvalues of \(J\) decide stability: if all have negative real parts, small disturbances die out. It is the phase-portrait classification from Lab 0, applied to the linearization.

  • Error propagation

    If inputs \(\vx\) have covariance \(\Sigma\), outputs \(\mathbf y=\mathbf f(\vx)\) have covariance approximately \(J\,\Sigma\,J^{\mathsf T}\). Measurement uncertainty budgets built from sensitivity coefficients are this formula.

  • Satellite navigation

    A GNSS receiver linearizes its pseudorange equations about a position guess. The Jacobian, called the geometry matrix \(H\), drives each least-squares update, and \((H^{\mathsf T}H)^{-1}\) gives the dilution of precision.

  • Robot arms

    An arm’s Jacobian maps joint speeds to hand velocity. Where its determinant vanishes the arm is at a singularity and loses a direction of motion.

  • Gravity gradiometry

    The Jacobian of the gravitational field is the tidal tensor of Example 5.2. Gravity gradiometers measure its entries directly to map density variations underground.

Check yourself

For \(\vF(x,y)=(x^2-y^2,\;2xy)\), find \(J\), the divergence, the curl and \(\det J\).
\[J=\begin{bmatrix}2x & -2y\\ 2y & 2x\end{bmatrix},\qquad \nabla\cdot\vF=4x,\qquad J_{21}-J_{12}=4y,\qquad \det J=4(x^2+y^2)\]

\(J\) is always a scaled rotation, with no shear. This map is \(z\mapsto z^2\) in complex notation, and the Cauchy–Riemann equations say exactly that \(J\) has this form. Such maps preserve angles. The z² preset in Lab J shows 0% shear everywhere.

Why is the curl of a gradient zero, in one line of linear algebra?

The Jacobian of \(\nabla\varphi\) is the Hessian \(\partial^2\varphi/\partial x_i\partial x_j\), which is symmetric because mixed partials commute. A symmetric matrix has no antisymmetric part, and the antisymmetric part is where the curl lives.

Use the spherical Jacobian to find the volume of a ball of radius \(R\).
\[V=\int_0^{R}\!\!\int_0^{\pi}\!\!\int_0^{2\pi} r^2\sin\theta\,d\phi\,d\theta\,dr=\frac{R^3}{3}\cdot2\cdot2\pi=\frac43\pi R^3\]
A map has \(\det J=-1\) everywhere. What does it do to areas and to orientation?

It preserves area exactly and reverses orientation everywhere. A reflection such as \((x,y)\mapsto(x,-y)\), or the swap \((x,y)\mapsto(y,x)\), is an example.