When I apply the Gram-Schmidt algorithm I don't understand why I don't get the Legendre polynomials. When I apply this algorithm I always get monic polynomials whereas the Legendre polynomials aren't all monics.
So we want to get an orthogonal basis for the inner product : $\langle f,g\rangle:=\int fg$. To so we are going to apply G-S algorithm on the basis: $(1,X,X^2,...)$
We have : $P_0 = 1$, $P_1 = X$ and
$$P_2 = X^2 - \frac{\langle X^2, 1\rangle}{\|1 \|}1 - \frac{\langle X^2, X\rangle}{\|X \|^2}X$$
Hence $P_2$ is a monic polynomial here while the second Legendre polynomial isn't monic.
And more generally we have :
$$P_n = X^n - \sum_{k = 0}^{n-1} \frac{\langle X^n, P_i\rangle }{\| P_i \|^2} P_i$$ So all the polynomials I get thanks to G-S are monic.
So where am I going wrong here?
Thank you !