By considering the 2-norm(least squares) approximation of $f(x)=e^x$ for $-1\le x\le 1$ by a polynomial of degree $N$ which is expanded into a series of Legendre polynomials $P_j(x):$
$$Q_N(x)=\sum_{j=0} ^N \lambda_jP_j(x)$$
Calculate the expansion coefficients $\lambda_0,\lambda_1,\lambda_2,\lambda_3 $.
So given that $N=3$, I know that the Legendre Polynomials are $P_0(x)=1$, $P_1(x)=x$, $P_1(x)=\frac{1}{2}(3x^2-1)$ and $P_3(x)=\frac{1}{2}(5x^3-2x)$.
I also understand that the 2-norm(least squares) approximation seeks to minimise $$E^2=\int_{-1}^{1} (e^x-Q_N(x))^2dx $$
Where $Q_N(x)$ is the polynomial of degree N asked for in the question.
I think you need to do $$\lambda_j=\frac{2(j)+1} {2}\int_{-1}^{1}P_je^x dx $$
which for $j=0, P_0=1$ gives $\lambda_0=\frac{1}{2}(e-e^{-1}) $ and then you continue to do so for $j=1,2,3$.
Is this the correct approach?
