Skip to content
Glacius
CalculusConcept reference

Jacobians

The Jacobian has entry (i,j) equal to the partial derivative of output i with respect to input j.

On this page 9 sections
  1. Overview
  2. The Jacobian is a table of local sensitivities for a function with several outputs
  3. For F(x,y)=(x^2+y,xy), the first output gives (2x,1)
  4. Evaluate every entry at the same input
  5. A closer look
  6. Key takeaway
  7. Further questions
  8. Sources & further reading
  9. Concept connections

01The Jacobian is a table of local sensitivities for a function with several outputs#

The Jacobian is a table of local sensitivities for a function with several outputs. Each output gets a row; each input gets a column. Where the gradient handles one scalar output, this table handles a whole output vector.

For a system with two input settings and three sensor outputs, the Jacobian has three rows and two columns. Entry (i,j)(i,j) records how output ii changes when input jj changes, with the other inputs held fixed. The shape is a useful check before any arithmetic.

A vector map has several outputs. For F(x,y)=(x2+y,xy)F(x,y)=(x^2+y,xy), collect each output’s partials into a row.

For F(x,y)=(x squared+y,xy), rows correspond to outputs F1 and F2 and columns to inputs x and y. The first row is (2x,1), and the second is (y,x). The labeled array is the full two-by-two Jacobian.For F(x,y)=(x squared+y,xy), rows correspond to outputs F1 and F2 and columns to inputs x and y. The first row is (2x,1), and the second is (y,x). The labeled array is the full two-by-two Jacobian.
Figure 1For F(x,y)=(x squared+y,xy), rows correspond to outputs F1 and F2 and columns to inputs x and y. The first row is (2x,1), and the second is (y,x). The labeled array is the full two-by-two Jacobian.
Link to this figure ↗Download SVGDownload PNG

We use output rows and input columns. Entry (i,j)(i,j) differentiates output FiF_i in input xjx_j. A map from nn inputs to mm outputs has an m×nm\times n Jacobian.

(JF)ij=Fixj(J_F)_{ij}=\frac{\partial F_i}{\partial x_j}

For F(x,y)=(x2+y,xy)F(x,y)=(x^2+y,xy), handle output 1 first. Its derivative in xx is 2x2x, and in yy is 1. Output 2 has derivatives yy and xx. Keep the order: rows (2x,1)(2x,1) and (y,x)(y,x). Only then substitute a requested input into all four entries.

Check your reasoning

F(x,y)=(2x+y,x2)F(x,y)=(2x+y,x^2). Give JFJ_F as ordered rows.

  1. A(2,2x);(1,0)(2,2x);(1,0)
  2. B(2,1);(2x,0)(2,1);(2x,0)
  3. C(2,1);(2,0)(2,1);(2,0)
Show answer and explanation
(2,1);(2x,0)(2,1);(2x,0)

Output 2 gives (2x,0)(2x,0).

02For F(x,y)=(x^2+y,xy), the first output gives (2x,1)#

For F(x,y)=(x2+y,xy)F(x,y)=(x^2+y,xy), the first output gives (2x,1)(2x,1). The second gives (y,x)(y,x). Keep all four entries.

JF=(2x1yx)J_F=\begin{pmatrix}2x&1\\y&x\end{pmatrix}
Check your reasoning

F(x,y)=(x,y,2x)F(x,y)=(x,y,2x). Repair an omitted output 3. Give the ordered rows of JFJ_F.

  1. A(1,0);(0,1)(1,0);(0,1)
  2. B(1,0,2);(0,1,0)(1,0,2);(0,1,0)
  3. C(1,0);(0,1);(2,0)(1,0);(0,1);(2,0)
Show answer and explanation
(1,0);(0,1);(2,0)(1,0);(0,1);(2,0)

Keep all three output rows.

03Evaluate every entry at the same input#

Evaluate every entry at the same input. For F(x,y)=(x2+y,xy)F(x,y)=(x^2+y,xy) at (1,3)(1,3), substitute x=1,y=3x=1,y=3 into the full matrix.

JF(1,3)=(2131)J_F(1,3)=\begin{pmatrix}2&1\\3&1\end{pmatrix}
Check your reasoning

F(a,b)=(ab,a+b2)F(a,b)=(ab,a+b^2). At (a,b)=(2,1)(a,b)=(2,1), give the ordered rows of JFJ_F.

  1. A(1,2);(1,2)(1,2);(1,2)
  2. B(2,1);(2,1)(2,1);(2,1)
  3. C(2,0);(0,2)(2,0);(0,2)
Show answer and explanation
(1,2);(1,2)(1,2);(1,2)

Differentiate in a, then b.

04A closer look#

If a differentiable system’s inputs change by a small vector Δx\Delta x, its output change is approximately JΔxJ\Delta x. The Jacobian is therefore a local linear model of the system. Backpropagation uses these local sensitivities to connect changes across multiple operations.

Key takeaway

Outputs choose rows; inputs choose columns.

  • Construct the Jacobian of a vector-valued map.

Further questions

Is a scalar gradient the same shape?
We write a gradient as an ordered vector. With the output-row convention here, a scalar function’s Jacobian has one row containing those same partials.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Jacobians.” Math behind ML. /learn/c-jacobian