Inner Products from Integrals
Polynomials can be treated as vectors, with their inner product defined by integrating the product of the two polynomial functions. This gives a concrete setting for Gram–Schmidt: instead of dot products of coordinate columns, each projection coefficient is found by an integral. The interval matters, because changing it changes the inner product and therefore can change the orthonormal polynomials.
Let \(\mathcal{P}_n\) denote the real vector space of polynomials of degree at most \(n\), including the zero polynomial. For real numbers \(a<b\), use the inner product \(\langle f,g\rangle=\int_a^b f(x)g(x)\,dx\). The norm associated with this inner product is \(\|f\|=\sqrt{\langle f,f\rangle}\). An orthonormal list is a list whose elements have norm \(1\) and whose distinct elements have inner product \(0\).
The integral behaves linearly in each polynomial, and \(\langle f,g\rangle=\langle g,f\rangle\) because multiplication of real numbers is commutative. Positive definiteness is also essential: a nonzero polynomial must have strictly positive squared norm.
Proof. Let \(f\) be a nonzero polynomial. It cannot vanish at every point of the interval \([a,b]\), since a nonzero polynomial has only finitely many roots. Choose \(x_0\in[a,b]\) with \(f(x_0)\ne0\). By continuity, there is a subinterval of positive length within \([a,b]\) on which \(|f(x)|>|f(x_0)|/2\); this also holds if \(x_0\) is an endpoint, by taking the subinterval on the inward side. On that subinterval, \(f(x)^2>|f(x_0)|^2/4>0\), and everywhere else \(f(x)^2\ge0\). Therefore its integral over \([a,b]\) is strictly positive. The other inner-product properties follow from linearity of the integral and \(f(x)g(x)=g(x)f(x)\). \(\square\)
On the symmetric interval \([-1,1]\), many computations simplify because odd powers integrate to zero. The following formula is useful for checking every term in a polynomial product.
Proof. An antiderivative of \(x^k\) is \(x^{k+1}/(k+1)\). If \(k\) is odd, then \(k+1\) is even, so evaluating at the endpoints gives \((1-1)/(k+1)=0\). If \(k\) is even, then \(k+1\) is odd, so the endpoint values give \((1-(-1))/(k+1)=2/(k+1)\). \(\square\)
Gram–Schmidt with Polynomial Inputs
For an ordered independent list \(f_1,\ldots,f_p\), the order is part of the calculation. Keep the first polynomial, then remove from each new polynomial its components along the orthogonal polynomials already obtained. If the current orthogonal polynomials are \(u_1,\ldots,u_{k-1}\), the residual is computed as \(u_k=f_k-\sum_{j=1}^{k-1}\frac{\langle f_k,u_j\rangle}{\langle u_j,u_j\rangle}u_j\). Then normalize by setting \(q_k=u_k/\|u_k\|\). The denominator \(\langle u_j,u_j\rangle\) is needed because the \(u_j\) have not yet been normalized. In each example below, the coefficient is chosen so the residual has zero inner product with the corresponding earlier polynomial.
Worked Example: The Monomials on \([-1,1]\)
Apply Gram–Schmidt to the ordered list \(1,x,x^2\) in \(\mathcal{P}_2\), using \(\langle f,g\rangle=\int_{-1}^1 f(x)g(x)\,dx\). The list is independent: a polynomial \(c_0+c_1x+c_2x^2\) is the zero polynomial only when all three coefficients vanish.
Start with \(u_1=1\). Its squared norm is \(\langle 1,1\rangle=\int_{-1}^1 1\,dx=2\), so \(q_1=1/\sqrt{2}\). For the second polynomial, \(\langle x,1\rangle=\int_{-1}^1x\,dx=0\). Thus \(u_2=x\), with \(\|u_2\|^2=\int_{-1}^1x^2\,dx=2/3\), giving \(q_2=\sqrt{3/2}\,x\).
For the third polynomial, its projection coefficient along \(u_1=1\) is \(\langle x^2,1\rangle/\langle 1,1\rangle=(2/3)/2=1/3\). Its coefficient along \(u_2=x\) is \(\langle x^2,x\rangle/\langle x,x\rangle=0/(2/3)=0\), since \(x^3\) is odd. Therefore
Its squared norm is computed term by term:
Hence \(q_3=\sqrt{45/8}(x^2-\tfrac13)=\sqrt{5/8}(3x^2-1)\). The resulting list is \(\bigl(1/\sqrt2,\sqrt{3/2}\,x,\sqrt{5/8}(3x^2-1)\bigr)\).
Check: The squared norms of the three displayed polynomials are \(1\), \((3/2)(2/3)=1\), and \((5/8)(8/5)=1\). The first and second are orthogonal because \(\int_{-1}^1x\,dx=0\). For the first and third, the unscaled pairing is \(\int_{-1}^1(x^2-\tfrac13)\,dx=2/3-2/3=0\). For the second and third, the unscaled pairing is \(\int_{-1}^1x(x^2-\tfrac13)\,dx=0\), since both terms are odd. Thus every pair is orthogonal and each norm is \(1\).
The example illustrates a useful calculation rule: expand the product first, then integrate each monomial. On a symmetric interval, parity can eliminate some projection coefficients immediately. The final check still matters, since the coefficients and normalization factors must both be correct.
Why Projection Subtraction Works
Suppose \(u\) is a nonzero polynomial and \(f\) is another polynomial. The coefficient \(c=\langle f,u\rangle/\langle u,u\rangle\) makes \(f-cu\) orthogonal to \(u\): expanding the inner product gives \(\langle f-cu,u\rangle=\langle f,u\rangle-c\langle u,u\rangle=0\). With several mutually orthogonal earlier polynomials, subtracting these components one at a time removes the component along each without reintroducing components along the others. Normalizing a nonzero residual changes its length but not its orthogonality.
Worked Example: A Basis on \([0,1]\)
Apply the process to \(1,t,t^2\) in \(\mathcal{P}_2\) with \(\langle f,g\rangle=\int_0^1f(t)g(t)\,dt\). These polynomials are independent because the coefficients of a zero polynomial must all be zero.
First, \(u_1=1\), and \(\|u_1\|^2=\int_0^1 1\,dt=1\), so \(q_1=1\). Next, \(\langle t,1\rangle=\int_0^1t\,dt=1/2\), giving \(u_2=t-1/2\). Its squared norm is
Thus \(q_2=\sqrt{12}(t-\tfrac12)=\sqrt3(2t-1)\). For \(t^2\), the coefficient along \(u_1\) is \(\int_0^1t^2\,dt=1/3\). The coefficient along \(u_2\) is
Consequently \(u_3=t^2-\tfrac13-(t-\tfrac12)=t^2-t+\tfrac16\). Squaring and integrating gives
Therefore \(q_3=6\sqrt5(t^2-t+\tfrac16)\), and the orthonormal list is \(\bigl(1,\sqrt3(2t-1),6\sqrt5(t^2-t+\tfrac16)\bigr)\).
Check: The norms are \(1\), since \(3\int_0^1(2t-1)^2\,dt=3(1/3)=1\), and since \((6\sqrt5)^2(1/180)=1\). The first polynomial pairs with the second as \(\sqrt3\int_0^1(2t-1)\,dt=0\), and with the third as \(6\sqrt5(1/3-1/2+1/6)=0\). For the last pair, \(\int_0^1(2t-1)(t^2-t+\tfrac16)\,dt=0\), as expansion gives \(2t^3-3t^2+\tfrac43t-\tfrac16\), whose integral is \(1/2-1+2/3-1/6=0\). All three vectors have unit norm and are pairwise orthogonal.
A Different Order, a Different Orthonormal List
Gram–Schmidt depends on the order of its input. Even when the span remains the same, choosing a different first polynomial can produce a different orthonormal list. The next example also shows why the denominator in the projection formula cannot be dropped when the earlier polynomial is not a unit vector.
Worked Example: Two Non-Monomial Polynomials
Use the ordered list \(f_1=1+x,\ f_2=1-x\) on \([0,1]\). They are independent: if \(c_1(1+x)+c_2(1-x)=0\), the constant and \(x\) coefficients give \(c_1+c_2=0\) and \(c_1-c_2=0\), so \(c_1=c_2=0\).
For \(f_1\),
The inner product \(\langle f_2,f_1\rangle=\int_0^1(1-x)(1+x)\,dx=\int_0^1(1-x^2)\,dx=2/3\). The projection coefficient along the nonunit vector \(f_1\) is \((2/3)/(7/3)=2/7\). Thus
Its squared norm is \(\int_0^1(5-9x)^2/49\,dx=(25-45+27)/49=1/7\), so \(q_2=(5-9x)/\sqrt7\).
Check: The first norm is \(1\) by its normalization, and \(\int_0^1(5-9x)^2/7\,dx=1\), so the second norm is also \(1\). Their inner product is \(\sqrt{3/7}\int_0^1(1+x)(5-9x)/\sqrt7\,dx\). The product inside the integral is \(5-4x-9x^2\), with integral \(5-2-3=0\). They are orthonormal.
Common Mistake: Forgetting the Denominator
When projecting \(x^2\) onto the first polynomial \(1\) on \([-1,1]\), a tempting but incorrect subtraction is \(x^2-\langle x^2,1\rangle\cdot1=x^2-\tfrac23\). This omits the squared norm of \(1\), which is \(2\). The resulting polynomial is not orthogonal to \(1\): its inner product with \(1\) is \(2/3-(2/3)\cdot2=-2/3\ne0\).
The correct coefficient is \(\langle x^2,1\rangle/\langle1,1\rangle=(2/3)/2=1/3\), so the residual is \(x^2-\tfrac13\), and \(\int_{-1}^1(x^2-\tfrac13)\,dx=2/3-2/3=0\). If the earlier polynomial is already a unit vector \(q\), the denominator is \(1\), and the projection coefficient simplifies to \(\langle f,q\rangle\). Keeping these two formulas distinct prevents a common error.
Once the orthonormal list is constructed, each polynomial has a direct integral check: its squared norm must be \(1\), and its pairing with every distinct list member must be \(0\). These checks use the given interval and inner product; changing either requires recalculating the projections and norms.
Check Your Understanding
For each question, use the stated interval and verify your result by evaluating the relevant integrals.
- On \([-1,1]\), calculate \(\langle x,x^3\rangle\) and explain the role of parity.
- For the inner product on \([0,1]\), find the residual after removing from \(t^2\) its projection onto \(1\).
- On \([-1,1]\), calculate the squared norm of \(x^2-\tfrac13\).
- Why must the coefficient for removing a component along a nonunit polynomial \(u\) include division by \(\langle u,u\rangle\)?
- For the list \(1,1+x\) on \([0,1]\), find the second Gram–Schmidt residual and normalize it.