Get AI summaries of any video or article — Sign up free
Abstract Linear Algebra 21 | Example for Gram-Schmidt Process thumbnail

Abstract Linear Algebra 21 | Example for Gram-Schmidt Process

4 min read

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.

TL;DR

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?

Because normalization is the only operation needed at the start. With m0(x)=1, the squared norm is ⟨m0,m0⟩ = ∫[−1,1] 1·1 dx = 2. Dividing m0 by √2 gives B0(x)=1/√2.

In the m1 step, why is no subtraction needed even though Gram–Schmidt normally subtracts projections?

The projection coefficient onto the earlier direction depends on ⟨m0,m1⟩. Here ⟨m0,m1⟩ = ∫[−1,1] 1·x dx = 0, so the component of m1 along m0 is already zero. The orthogonal component stays m1, and only normalization is applied using ⟨m1,m1⟩ = ∫[−1,1] x^2 dx = 2/3.

How does the m2 step simplify so that the orthogonal component becomes x^2 − 1/3?

The orthogonal component is m2 minus its projections onto B0 and B1. The projection onto B1 vanishes because it involves an integral proportional to ∫[−1,1] x^3 dx, which equals 0. 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 subtraction yields x^2 − 1/3.

What integral determines the normalization constant for B2, and what value does it produce?

Normalization uses the squared norm ⟨B2~,B2~⟩ where B2~(x)=x^2−1/3. The required integral is ∫[−1,1] (x^2−1/3)^2 dx. Expanding gives a combination of ∫ x^4, ∫ x^2, and ∫ 1 over [−1,1]. Evaluating those definite integrals results in 8/45, so the normalization factor is √(8/45).

What higher-degree polynomials arise when the same procedure is extended to Pn?

Applying the same orthonormalization idea to larger polynomial spaces produces orthonormal polynomials (up to normalization conventions) known as Legendre polynomials. They retain the orthogonality/orthonormality properties needed for orthogonal projections in inner-product polynomial spaces.

Review Questions

  1. Compute ⟨m0,m1⟩ and ⟨m1,m2⟩ under ⟨p,q⟩=∫[−1,1] p(x)q(x) dx. Which ones vanish and why?
  2. 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.
  3. Evaluate ∫[−1,1] (x^2−1/3)^2 dx and use the result to express the normalized B2(x).

Key Points

  1. 1

    Gram–Schmidt constructs an orthonormal basis by subtracting orthogonal projections and then normalizing each new vector.

  2. 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. 3

    Normalizing m0 uses ⟨m0,m0⟩=2, giving B0(x)=1/√2.

  4. 4

    The m1 step requires only normalization because ⟨m0,m1⟩=∫[−1,1] x dx=0.

  5. 5

    For m2, the projection onto the B1 direction vanishes because it depends on ∫[−1,1] x^3 dx=0.

  6. 6

    The orthogonal component for m2 simplifies to x^2−1/3 before normalization.

  7. 7

    Extending the method to Pn yields Legendre polynomials (up to normalization choices), enabling orthogonal projections in polynomial inner-product spaces.

Highlights

The orthonormal basis for degree ≤2 polynomials emerges explicitly: B0(x)=1/√2 and B1(x)=√(3/2)·x.
A key simplification occurs in the m2 step: the B1 projection disappears because the relevant integral is proportional to ∫[−1,1] x^3 dx = 0.
The unnormalized third basis polynomial becomes B2~(x)=x^2−1/3, and normalization uses ∫[−1,1] (x^2−1/3)^2 dx = 8/45.
Legendre polynomials are identified as the higher-degree counterparts produced by the same orthonormalization strategy.

Topics