[Math] Finding a projection of$e^x$ onto subspace of polynomials

linear algebra

Find in $C[0,1]$ with inner product $<f,g>=\int^1_0 f(x)g(x)dx$, fnd the projection of $e^x$ onto subspace of polynomials of degree 1 or less.

I want to find an othonormal basis for the subspace of degree$\le1$. So I tried to normalize thevector 1, so

$<1,1>=\int_0^11dx=1$, so $e_1=1$

Now we have to do $<e,x>=<1,x>=\int_0^1xdx=\frac{1}{2}$

So $u_2=x-<e_1,x>e_1=x-\frac{1}{2}$

So now I do $<1,x-\frac{1}{2}>=0$, so I feel like I've done something wrong, as I don't thnk that my second coordinate for the basis vector is (0,1).

Any help? Thanks

Best Answer

Finding the orthogonal projection can also be done by solving for a,b, the system $$\langle 1,e^x-(a+bx)\rangle=0\\ \langle x,e^x-(a+bx)\rangle=0$$ or, in the matrix form, $$ \begin{pmatrix} \langle1,1\rangle & \langle 1,x\rangle \\ \langle x,1\rangle & \langle x,x\rangle\end{pmatrix} \begin{pmatrix}a\\b\end{pmatrix} =\begin{pmatrix}\langle 1,e^x\rangle\\\langle x,e^x\rangle\end{pmatrix}.$$