Database › Mathematics › Pure mathematics › Algebra
Gram–Schmidt orthogonalisation turns any linearly independent set into an orthonormal one spanning the same nested subspaces, by subtracting projections onto the vectors already built.
Explanation
Each step removes the components along the previous unit vectors, leaving a vector orthogonal to all of them. In matrix language it is the QR decomposition $A=QR$ with $Q$ orthogonal and $R$ upper triangular; numerically the modified version (re-projecting each step) is more stable.
Applied to $1,x,x^2,\dots$ with different weight functions and intervals it generates the classical orthogonal polynomials (Legendre, Hermite, Laguerre, Chebyshev).
Example 1
Orthonormalise $(1,1,0)$ and $(1,0,1)$.
Solution
$\mathbf e_1=(1,1,0)/\sqrt2$. $\mathbf u_2=(1,0,1)-\frac12(1,1,0)=(\frac12,-\frac12,1)$, so $\mathbf e_2=(1,-1,2)/\sqrt6$.
Example 2
Apply Gram–Schmidt (without normalising) to $1,x,x^2$ with $\langle f,g\rangle=\int_{-1}^1fg\,dx$.
Solution
$u_0=1$, $u_1=x$ (already orthogonal by parity), $u_2=x^2-\frac{\langle1,x^2\rangle}{\langle1,1\rangle}=x^2-\frac13$, proportional to $P_2=\frac12(3x^2-1)$.