1.2.5 · D5Calculus & Optimization Basics

Question bank — The Jacobian matrix

1,355 words6 min readBack to topic

Before we start, two words we lean on constantly. Output = one of the numbers the function spits out (). Input = one of the numbers you feed in (). The whole game is keeping those two straight, because the Jacobian is literally a table indexed by (output, input).


True or false — justify

For , the Jacobian is .
False. It is — rows are outputs, columns are inputs — because must eat an input direction and return an output change in : .
The gradient and the Jacobian are the same object.
False. They only coincide (up to a transpose) when the output is a single scalar; the gradient is a column, the Jacobian for is its row transpose . For there is no single gradient at all.
Every Jacobian has a determinant.
False. A determinant needs a square matrix, so exists only when . Most ML layers map with , so no determinant exists for them.
The chain rule for Jacobians, , is order-independent because scalar chain rule is.
False. Matrix multiplication does not commute; only the order "outer Jacobian on the left" makes the shapes line up. Writing is generally undefined or wrong.
The Jacobian is defined only at a specific point , not once for the whole function.
True. Each entry is a function of , so is a field of matrices; you must evaluate it at a point to get concrete numbers (like varying along a curve).
If at a point, the map locally collapses area/volume to zero there.
True. is the local volume-scaling factor, so a zero determinant means a tiny patch is flattened onto something lower-dimensional — the map is not locally invertible there.
A diagonal Jacobian means the map is linear.
False. Diagonal only means each output depends on one input (no cross-coupling), e.g. elementwise . The map can still be highly nonlinear; the entries just change from point to point.
The linear approximation is exact when is affine.
True. For we get constant, and exactly — no higher-order terms exist to drop.

Spot the error

"Row of the Jacobian is the gradient of input ."
Rows are indexed by outputs, not inputs, and gradients belong to outputs: row is . Inputs are the columns; "gradient of an input" is meaningless.
"For the Jacobian is because we differentiate."
It is , not . Since , we get , which reproduces exactly with no transpose.
"Since is nonlinear, its Jacobian is a full dense matrix."
Each depends only on its own , so all off-diagonal partials () are zero. The Jacobian is — diagonal, not dense.
"To linearize, use ."
Shapes are wrong and the order is backward: it must be , a matrix times a column . Writing tries to multiply , which is undefined.
"In backprop we multiply Jacobians front-to-back as following the forward order."
The chain rule stacks outer on the left, so the composition orders them last-layer-first: . Matching indices, not forward intuition, dictates the order.
"The Jacobian determinant for polar coordinates is ."
It is , not : . That single is the factor in polar integration.

Why questions

Why is the Jacobian "the" derivative for vector functions rather than just a bag of partials?
Because it is the unique linear map that best approximates near a point: . That single defining property is what makes it play the role plays in one dimension. See Linear approximation and Taylor series.
Why does the chain rule become a matrix product of Jacobians?
Composing functions composes their best-linear approximations, and composing linear maps is matrix multiplication. So — see The chain rule (multivariable).
Why do we care about at all in integration?
When you change variables, a tiny input cell of volume maps to an output cell of volume ; that factor rescales the integral so it counts the same "stuff." This is Change of variables in integration.
Why is a Jacobian-vector product cheaper than forming the full Jacobian?
You often only need for a chosen direction , and forward-mode autodiff computes that directly without ever materializing the table — see Jacobian-vector products (forward-mode autodiff).
Why does the gradient equal a Jacobian row and not a column?
The Jacobian must left-multiply to give a change in , so its single row dotted with produces the directional change; the gradient is the transpose of that row, chosen as a column so reads naturally.
Why is the second-derivative analogue (the Hessian matrix) symmetric while a general Jacobian is not?
The Hessian is the Jacobian of a gradient, whose entries are ; mixed partials commute (Schwarz), forcing symmetry. A general Jacobian's entries mix different outputs, so no such symmetry applies.

Edge cases

What is the Jacobian when ?
A matrix holding the single number — the ordinary derivative recovered as the smallest possible Jacobian.
What does the Jacobian of a constant function look like?
The zero matrix of shape : no output responds to any input, so every partial is .
What is the Jacobian of the identity map ?
The identity matrix , since when and otherwise — nudging an input moves exactly its own output.
Can a square Jacobian have , and what does that mean?
Yes; the sign flips when the map reverses orientation (like a mirror). Volume still scales by , but a right-handed patch becomes left-handed.
For an affine map , does appear in ?
No. Constants have zero derivative, so regardless of ; the offset shifts outputs but never changes local slopes.
At a point where is not differentiable (a kink, like ReLU at ), does the Jacobian exist?
Strictly no — the linear approximation isn't unique there, so the true Jacobian is undefined. In practice frameworks pick a subgradient (e.g. or ) as a convention, which powers Backpropagation through non-smooth layers.
Recall One-line self-test

Cover everything: state the shape, the entry, the linearization, the chain-rule order, and when exists — in one breath. Answer ::: Shape ; entry ; ; chain rule (outer left); only if .