Consider the usual space \(L^2(a,b)\) of (measurable) functions \(f:[a,b] \to \mathbb{C}\) such that \[ \int_a^b |f(x)|^2 \, dx < \infty, \] and with inner product given by \[ \langle f,g \rangle = \int_a^b f(x) \overline{g(x)} \, dx. \]
This space may be generalized by including a “weight function”:
Definition
Let \(w:[a,b] \to \mathbb{R}\) be a continuous function with \(w(x)>0\) for each \(x\in [a,b]\). Define \(L^2_w(a,b)\) to be the space of all (measurable) functions \(f:[a,b]\to \mathbb{C}\) such that
\[ \int_a^b |f(x)|^2 w(x) \, dx < \infty. \]
This space has an inner product given by
\[ \langle f,g \rangle_w = \int_a^b f(x) \overline{g(x)} w(x) \, dx, \]
which induces the norm \(\|f\|_w = \sqrt{\langle f, f \rangle_w}\). The space \(L^2_w(a,b)\) is called a weighted \(L^2\)-space.
Consider the function \(\psi_1(x) = x\) in the space \(L^2_w(0,1)\) with weight function \(w(x)=x\). Find a polynomial of the form \(\psi_2(x) = x^2 + bx + c\) such that \(\psi_1\) and \(\psi_2\) are orthogonal.
Compute the norms of the two functions in part (a) and thus construct an orthonormal set \(\{\phi_1,\phi_2\}\) from these two functions.
Compute the orthogonal projection of the function \(f(x)=x^3\) onto the subspace of \(L^2_w(0,1)\) spanned by \(\phi_1\) and \(\phi_2\).
Theorem 3.8
Let \(H\) be either a function space of the form \(L^2(a,b)\) or \(L^2_w(a,b)\), let \(\{\phi_n\}\) be an orthonormal set in \(H\), and let \(f\in H\). Then
\[ \left\| f - \sum \langle f, \phi_n \rangle \phi_n \right \| \leq \left \| f - \sum c_n \phi_n \right \| \]
for all choices of scalars \(c_n\) for which \(\sum \|c_n \|^2 < \infty\). Equality holds only when \(c_n = \langle f, \phi_n \rangle\) for each \(n\).
Consider the polynomials
\[ \phi_1(x) = 1, \quad \phi_2(x) = \sqrt{12}\left( x- \frac{1}{2}\right), \quad \phi_3(x) = \sqrt{180}\left( x^2-x+\frac{1}{6} \right). \]
Verify that \(\{\phi_1,\phi_2,\phi_3\}\) is an orthonormal set in \(L^2(0,1)\).
Compute the orthogonal projection of the function \(f(x)=x^3\) onto the subspace spanned by the \(\phi_n\)’s.
Plot the projection and compare it to \(f\). What do you see?