TL;DR
A function with several inputs and several outputs has a partial derivative for every pair of an output and an input. The Jacobian matrix puts all of them in one grid, with one row per output and one column per input. Near any point, the function behaves like the Jacobian applied to a small change in the input.
Where you'll see it: the backward pass of a neural network, where each layer's Jacobian passes gradients back through the layer, in coordinate changes for integrals, and in the stability analysis of dynamical systems.
Intuition
One output, many inputs, then many outputs
A function of several inputs with a single output has one partial derivative per input. Those numbers form the Gradient, which says how the output moves when each input nudges. Now suppose the function returns several numbers, say a pair of coordinates. Each output has its own gradient, and every output responds to every input. You need a table to keep track of all of it.
That table is the Jacobian. Each row is the gradient of one output. Each column says how one input moves all the outputs together.
Local straight-line behaviour
Zoom in close enough to a smooth curve and it looks like a straight line. The slope of that line is the Derivative. For a function of several variables, zoom in close enough to a point and the function looks like a flat, linear map. The Jacobian is the matrix of that map. It tells you how a tiny change in the input turns into a tiny change in the output, in every direction at once.
This is why the Jacobian shows up whenever a curved map must be studied locally. A globe is curved, but a small map of one city is nearly flat, and the Jacobian is the tool that describes that flat approximation.
flowchart LR A[Small change in inputs h] --> B[Multiply by Jacobian J] B --> C[Small change in outputs J h] C --> D[Output is about F of x plus J h]
The math
Definition
Let be a function with component functions , so . Its Jacobian at a point is the matrix
The entry in row and column is .
Here is the input and is the partial derivative of output with respect to input , computed with every other input held fixed. Row is the gradient of . Column shows how input moves every output.
The key result: linear approximation
If is differentiable at , then for a small change in the input,
The error in this approximation shrinks faster than itself, so for small enough steps the linear term carries nearly all of the change. The right-hand side is an affine function of : a fixed offset plus a matrix times the step. The Jacobian is the matrix in that approximation.
The chain rule in matrix form
If is applied after , the Jacobians multiply in the same order:
This is the chain rule written for vectors. It is the reason the chain rule works in backpropagation: the Jacobian of a whole network is the product of the Jacobians of its layers.
Special cases
- If , the Jacobian is a single row, which is the gradient written as a row vector.
- If , the Jacobian is the ordinary derivative, a matrix.
- If , the Determinant of the Jacobian measures how much scales volume near . The sign tells you whether it flips orientation.
Worked examples
Let . Its Jacobian entries are
- and .
- and .
- At the point the entries are , , and , so .
- At , . Take a step . The linear prediction is .
- The exact value at is .
- The second entry is predicted to within ( against ). The first entry differs by ( against ), which is the second-order part the approximation ignores. It is the larger error because has a sizeable -type cross term, while is nearly linear for small .
Let , which turns a radius and an angle into ordinary and coordinates.
- The Jacobian is .
- Its determinant is , since .
- Check at , . Then and , so . Its determinant is , which equals .
- So a small patch of area in polar coordinates corresponds to a patch of area in the plane. This factor is why integrals in polar coordinates carry an extra .
Let , a common activation applied to each entry separately. Each output depends only on its own input, so the Jacobian is diagonal, with entries on the diagonal.
- At , and .
- The diagonal entries are and .
- So .
- Interpretation: at the first input the layer passes changes through unchanged, while at the second it shrinks them to about 42 percent. This is the vanishing-gradient effect in deep networks, seen in one number.
Tradeoffs and failure modes
The Jacobian is the right tool when you need the local, linear behaviour of a smooth map: sensitivity analysis, change of variables in integrals, stability of equilibria, and gradient-based optimisation of models with vector outputs.
It has limits. It is only a local picture, so it can mislead far from the point where it was computed. It has entries, which is too many to store for a large network. In practice, systems such as automatic differentiation never build the full matrix. They multiply a vector by it directly, which costs far less.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Large network with millions of inputs | The full Jacobian has millions of rows and columns and cannot be stored | Vector-Jacobian products in reverse-mode differentiation |
| Predicting far from the expansion point | The linear approximation drifts away from the true output | Recompute the Jacobian at the new point, or use a nonlinear model |
| Jacobian is singular, with determinant zero | The map locally collapses a direction, and it is not invertible there | Treat the point as a critical point and check the model before inverting |
| Mixing row and column conventions | Results are transposed, and shapes look valid but are wrong | Fix the convention once, and check shapes against inputs and outputs |
History
The determinant of a system of functions, now called a functional determinant, was studied by Carl Gustav Jacob Jacobi in the 1830s and 1840s. He used it to show how multiple integrals change under a change of variables. The name "Jacobian" was attached to these objects later in the nineteenth century, in honour of his work.
The idea caught on because change of variables is everywhere in physics, from mechanics to fluid flow, and because the matrix form made the chain rule for systems simple. In the twentieth century the same matrix became central to numerical optimisation and, later, to the training of neural networks.
Check yourself
QuestionA function maps to . What is its Jacobian at ?Show answer
The partial derivatives are , , , and . At these are . So .
QuestionExplain why the first row of a Jacobian is the gradient of the first output.Show answer
Row holds for every input . Those are exactly the partial derivatives of the single function , which are the components of its gradient. Each row therefore gives how one output responds to all inputs.
QuestionA map has Jacobian determinant at a point. What does that tell you about the area near that point?Show answer
The map scales area by a factor of near the point, so small regions are about three times larger in the image. The negative sign means the map flips orientation there, like a mirror.
QuestionIn a two-layer network, the first layer has Jacobian and the second has . Write the Jacobian of the whole network, and say why the order of the product matters.Show answer
The whole network has Jacobian , evaluated at the right points: is taken at the output of the first layer. The order matters because matrix multiplication is not commutative, and the layer applied last must come on the left, mirroring the order in which the functions are composed.