Linear Algebra
11.118 min read

Linear Functions and the Jacobian

For a linear function f(x)=Ax\mathbf{f}(\mathbf{x}) = A\mathbf{x} (where AA is an m×nm\times n matrix), the Jacobian is simply AA itself — constant everywhere.

This makes intuitive sense: the local linear approximation to a linear function is the function itself. The LLA f(a+h)f(a)+Jf(a)h\mathbf{f}(\mathbf{a}+\mathbf{h}) \approx \mathbf{f}(\mathbf{a}) + J\mathbf{f}(\mathbf{a})\mathbf{h} becomes A(a+h)=Aa+AhA(\mathbf{a}+\mathbf{h}) = A\mathbf{a} + A\mathbf{h}, which is exact (zero error).

More generally, for an affine function f(x)=Ax+b\mathbf{f}(\mathbf{x}) = A\mathbf{x} + \mathbf{b}, the Jacobian is again AA — the constant term b\mathbf{b} disappears because differentiation kills constants. This reflects the fact that the derivative measures rate of change, and constants do not change.

Formal View

Theorem 11.4 — Jacobian of a Linear Function
If f(x)=Ax+b\mathbf{f}(\mathbf{x}) = A\mathbf{x} + \mathbf{b} for ARm×nA \in \mathbb{R}^{m\times n} and bRm\mathbf{b} \in \mathbb{R}^m, then Jf(x)=AJ\mathbf{f}(\mathbf{x}) = A for all x\mathbf{x}.

In particular, the Jacobian of the identity function f(x)=x\mathbf{f}(\mathbf{x}) = \mathbf{x} is the identity matrix InI_n.

Example 11.4 — Jacobian of a Linear Map
Let f(x1,x2,x3)=(2x1x2,x2+3x3)\mathbf{f}(x_1, x_2, x_3) = (2x_1 - x_2, x_2 + 3x_3). The Jacobian is Jf=[210013]J\mathbf{f} = \begin{bmatrix} 2 & -1 & 0 \\ 0 & 1 & 3 \end{bmatrix}, a constant 2×32\times 3 matrix.

Interactive Visualization

Matrix-Vector Multiplication

Why This Matters

The fact that the Jacobian of a linear function is constant is why linear regression has a simple, closed-form solution.

  • Linear regression gradient: wAwb2=2AT(Awb)\nabla_{\mathbf{w}}\|A\mathbf{w} - \mathbf{b}\|^2 = 2A^T(A\mathbf{w}-\mathbf{b}) — a linear function of w\mathbf{w}
  • Sensitivity analysis: for linear systems, the Jacobian gives exact (not approximate) sensitivities
  • Change of coordinates: the Jacobian of a linear change of coordinates is the transformation matrix itself

Quiz

Question 1

For f(x)=cTxf(\mathbf{x}) = \mathbf{c}^T \mathbf{x} (a linear functional), the Jacobian DfDf is:

Question 2

Adding a constant vector to a function changes its Jacobian.

Common Mistakes

  • Thinking the Jacobian of an affine function includes the constant offset b\mathbf{b} — it does not.
  • For scalar functions, confusing the 1×n1\times n Jacobian row vector with the n×1n\times 1 gradient column vector.
  • Forgetting that linear function LLAs have zero error (not just small error).