An inner product is defined on $P3$ such that $<f, g>$ $=$ $\int _{-1}^1\:f\left(t\right)g\left(t\right)dt$.
What is the orthogonal projection of $p(x)$ $=$ $x^3$ onto $P2$?
So I got that $f_1\left(x\right)=1,\:f_2\left(x\right)\:=\:x,\:f_3\left(x\right)\:=\:x^2$ form a basis of $P2$. I also got that $g_1\left(x\right)=f_1\left(x\right)=1$, $g_2\left(x\right)=f_2-\frac{<f_2,\:g_1>}{<g_1,\:g_1>}g_1$ and $g_3\left(x\right)=f_3-\frac{<f_3,\:g_1>}{<g_1,\:g_1>}g_1-\frac{<f_3,\:g_2>}{<g_2,\:g_2>}g_2$.
From this, I got that, $g_2\left(x\right)=x$ and $g_3\left(x\right)=x^2-\frac{1}{3}$.
I know that an orthonormal basis of $P2$ will have the form $\left\{\frac{g_1}{\left|g_1\right|},\:\frac{g_2}{\left|g_2\right|},\:\frac{g_3}{\left|g_3\right|}\right\}$, but I am quite confused on how to proceed further from this. I am not entirely sure how I would compute the norm and projection of the polynomials I have found and how I would proceed from this basis to find the required projection.
So if anyone can tell me if what I have done so far is correct or not, and how exactly I should proceed, I would greatly appreciate it!