11.1210 min read
Quadratic Functions and the Jacobian
For a quadratic function (where is symmetric), the gradient (Jacobian transposed) can be computed using the matrix calculus identity: .
More generally, for , the gradient is and the Jacobian is its transpose: .
This result is fundamental to optimization: the gradient of the least squares objective is . Setting this to zero yields the normal equations .
Formal View
Theorem 11.5 — Gradient of a Quadratic Form
For symmetric :
For general : , which equals when .
The Hessian (matrix of second derivatives) of is .
Example 11.5 — Gradient of Least Squares
For : expanding gives . Applying the quadratic gradient formula: .
Why This Matters
Matrix calculus for quadratic forms is essential for deriving and understanding all linear regression and least squares methods.
- Deriving normal equations: gives
- Ridge regression: adding gives gradient
- All quadratic optimization problems (portfolio optimization, control theory) rely on this gradient formula
Quiz
Question 1
Let for symmetric . Then equals:
Question 2
The gradient of with respect to is:
Common Mistakes
- Forgetting the factor of 2 in .
- Applying the symmetric formula when is not symmetric — use for general .
- In the least squares gradient, writing instead of — the chain rule introduces an extra .