Prove the least squares approximation property of Legendre polynomials [see $(9.5)$ and (9.6)] as follows. Let $f(x)$ be the given function to be approximated. Let the functions $p($ r) be the normalized Legendre polynomials, that is,
$$
p_{l}(x)=\sqrt{\frac{2 l+1}{2}} P_{l}(x) \quad \text { so that } \int_{-1}^{1}\left[p_{l}(x)\right]^{2} d x=1
$$
Show that the I.egendre series for $f(x)$ as far as the $p_{2}(x)$ term is
$$
f(x)=\varsigma_{0} p_{0}(x)+\iota_{1} p_{1}(x)+i_{2} p_{2}(x) \quad \text { with } \quad c_{l}=\int_{-1}^{1} f(x) p_{1}(x) d x
$$. Write the quadratic polynomial satisfying the least squares condition as $b_{0} P_{0}(x)+b_{1} p_{1}(x)$ $+b_{2} p_{2}(x)$ (by Problem $5.14$ any quadratic polynomial can be written in this form). 'The problem is to find $b_{0}, b_{1}, b_{2}$ so that
$$
I=\int_{-1}^{1}\left[f(x)-\left(b_{0} p_{0}(x)+b_{1} p_{1}(x)+b_{2} \rho_{2}(x)\right)\right]^{2} d x
$$
is a minimum. Square the bracket and write $I$ as a sum of integrals of the individual terms. Show that some of the integrals are zero by orthogonality, some are 1 because the $\rho_{l}$ 's are normalized, and others are equal to the cofficients $c_{1} .$ Add and subtract $t_{0}^{2}+c_{1}^{2}+c_{2}^{2}$ and show that
$$
I=\int_{-1}^{1}\left[f^{2}(x)+\left(b_{0}-c_{0}\right)^{2}+\left(b_{1}-c_{1}\right)^{2}+\left(b_{2}-c_{2}\right)^{2}-\iota_{0}^{2}-c_{1}^{2}-c_{2}^{2}\right] d x
$$
Now determine the values of the $b$ 's to make $I$ as small as possible. (Hint: The smallest value the square of a real number can have is zero.) Generalize the proof to polynomials of degree $n$.