Abstract Linear Algebra 21 | Example for Gram-Schmidt Process
Based on The Bright Side of Mathematics's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Gram–Schmidt constructs an orthonormal basis by subtracting orthogonal projections and then normalizing each new vector.
Briefing
Gram–Schmidt (the “K Schmid” process) turns an ordinary basis of a polynomial subspace into an orthonormal basis by repeatedly subtracting projections and then normalizing. The key takeaway is that even when the starting basis is simple—like {m0, m1, m2} for polynomials of degree ≤ 2—orthonormality is not automatic. With the right inner product, the procedure produces explicit orthonormal polynomials that make later computations like orthogonal projections straightforward.
The example works in the real polynomial space P2 = {polynomials on [−1, 1] of degree at most 2}, equipped with the standard inner product ⟨p, q⟩ = ∫[−1,1] p(x)q(x) dx. The starting basis is the monomials m0, m1, m2, where m0(x)=1, m1(x)=x, and m2(x)=x^2. The process begins by normalizing m0. Since ⟨m0, m0⟩ = ∫[−1,1] 1·1 dx = 2, the first orthonormal basis element becomes B0(x) = 1/√2.
Next comes m1. Gram–Schmidt subtracts the component along the already-built direction, but here orthogonality already holds: ⟨m0, m1⟩ = ∫[−1,1] 1·x dx = 0, so the “projection part” vanishes and the orthogonal component remains m1 itself. Normalization is still required: ⟨m1, m1⟩ = ∫[−1,1] x·x dx = ∫[−1,1] x^2 dx = 2/3. That yields B1(x) = √3/√2 · x, equivalently B1(x)=√(3/2) x.
The final step handles m2 = x^2. The orthogonal component is computed as m2 minus its projection onto the span of {B0, B1}. Two integrals appear: ⟨B1, m2⟩ = ∫[−1,1] (√(3/2)x)·x^2 dx is proportional to ∫[−1,1] x^3 dx, which is 0, so the B1-direction contributes nothing. The remaining projection onto B0 uses ⟨B0, m2⟩ = ∫[−1,1] (1/√2)·x^2 dx = (1/√2)·(2/3). After multiplying back by B0, the orthogonal component simplifies neatly to B2~(x) = x^2 − 1/3.
Normalization finishes the construction. The squared norm ⟨B2~, B2~⟩ requires integrating (x^2 − 1/3)^2 over [−1,1], which expands into a polynomial involving x^4, x^2, and constants. Evaluating the definite integrals gives ⟨B2~, B2~⟩ = 8/45, so the normalized basis element is B2(x) = (x^2 − 1/3)/√(8/45). The result is an explicit orthonormal basis for P2 under the given inner product.
Finally, the same method extends to higher-degree polynomial spaces Pn. The orthonormal polynomials that emerge (up to normalization choices) are the Legendre polynomials, which are widely used because they support orthogonal projections and other computations in abstract inner-product spaces.
Cornell Notes
Gram–Schmidt orthonormalizes a polynomial basis using the inner product ⟨p,q⟩ = ∫[−1,1] p(x)q(x) dx. Starting from monomials m0(x)=1, m1(x)=x, m2(x)=x^2 for P2, the process normalizes m0 to get B0(x)=1/√2. The m1 step needs only normalization because ⟨m0,m1⟩=0, giving B1(x)=√(3/2)·x. For m2, the projection onto the B1 direction vanishes since ∫[−1,1] x^3 dx=0, leaving an orthogonal component B2~(x)=x^2−1/3. Normalizing B2~ using ∫[−1,1] (x^2−1/3)^2 dx = 8/45 yields B2(x)=(x^2−1/3)/√(8/45). These orthonormal polynomials generalize to Legendre polynomials for Pn.
Why does the first Gram–Schmidt step produce B0(x)=1/√2 for P2?
In the m1 step, why is no subtraction needed even though Gram–Schmidt normally subtracts projections?
How does the m2 step simplify so that the orthogonal component becomes x^2 − 1/3?
What integral determines the normalization constant for B2, and what value does it produce?
What higher-degree polynomials arise when the same procedure is extended to Pn?
Review Questions
- Compute ⟨m0,m1⟩ and ⟨m1,m2⟩ under ⟨p,q⟩=∫[−1,1] p(x)q(x) dx. Which ones vanish and why?
- Starting from B0(x)=1/√2 and B1(x)=√(3/2)x, write the projection of m2(x)=x^2 onto span{B0,B1} and show how it leads to x^2−1/3.
- Evaluate ∫[−1,1] (x^2−1/3)^2 dx and use the result to express the normalized B2(x).
Key Points
- 1
Gram–Schmidt constructs an orthonormal basis by subtracting orthogonal projections and then normalizing each new vector.
- 2
In P2 with ⟨p,q⟩=∫[−1,1] p(x)q(x) dx, the monomials m0=1, m1=x, m2=x^2 are not orthonormal by default.
- 3
Normalizing m0 uses ⟨m0,m0⟩=2, giving B0(x)=1/√2.
- 4
The m1 step requires only normalization because ⟨m0,m1⟩=∫[−1,1] x dx=0.
- 5
For m2, the projection onto the B1 direction vanishes because it depends on ∫[−1,1] x^3 dx=0.
- 6
The orthogonal component for m2 simplifies to x^2−1/3 before normalization.
- 7
Extending the method to Pn yields Legendre polynomials (up to normalization choices), enabling orthogonal projections in polynomial inner-product spaces.