Maths WorkshopMaths problems with full solutions
Exercise 2169Linear algebra › Inner product spacesL1Added 3 Nov 2026

Least squares and normal equations

#least squares#normal equations#orthogonal projection

Statement

Let AA be an m×nm\times n matrix with full column rank, b∈Rmb\in\mathbb{R}^m. Show that the vector x∗x^* minimizing ∥Ax−b∥\|Ax-b\| satisfies the normal equations
ATAx∗=ATb.A^TAx^*=A^Tb.

Hint

Interpret AxAx as a point in Col⁡(A)\operatorname{Col}(A), and x∗x^* as the orthogonal projection of bb.

Show solutionHide solution

Solution

Geometric interpretation. Minimizing ∥Ax−b∥\|Ax-b\| over xx is equivalent to finding the point of Col⁡(A)\operatorname{Col}(A) closest to bb. This is the orthogonal projection of bb onto Col⁡(A)\operatorname{Col}(A).

Orthogonality. For x∗x^* to be the projection, b−Ax∗b-Ax^* must be orthogonal to Col⁡(A)\operatorname{Col}(A), i.e. to every column of AA:
AT(b−Ax∗)=0.A^T(b-Ax^*)=0.

Normal equations. Rearranging:
ATAx∗=ATb.A^TAx^*=A^Tb.
Since AA has full column rank, ATAA^TA is invertible, so x∗=(ATA)−1ATbx^*=(A^TA)^{-1}A^Tb.

Conclusion. The least-squares solution satisfies the normal equations.