An inner product is defined on $P_3$ 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 the subspace $S$ $=$ $\left\{f\:∈\:P_3\left|f\left(-1\right)=0\right|\:\right\}$?
For this subspace, I got the basis $\left\{x^3+1,\:x^2+x,\:x^3+x^2\right\}$.
So I got that $f_1\left(x\right)= x^3+1,\:f_2\left(x\right)\:=\:x^2+x,\:f_3\left(x\right)\:=\:x^3+x^2$.
I also got that $g_1\left(x\right)=f_1\left(x\right)=x^3+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)=-\frac{7x^3}{15}+x^2+x-\frac{7}{15}$ and $g_3\left(x\right)=\frac{7}{8}x^3+\frac{3}{8}x^2-\frac{5}{8}x-\frac{1}{8}$.
Then I tried to calculate $\left\{\frac{g_1}{\left|g_1\right|},\:\frac{g_2}{\left|g_2\right|},\:\frac{g_3}{\left|g_3\right|}\right\}$. For this, I got $\left\{\frac{\sqrt{7}}{4}\left(x^3+1\right),\:\frac{15\sqrt{2}}{16}\left(-\frac{7x^3}{15}+x^2+x-\frac{7}{15}\right),\:\sqrt{15}\left(\frac{7}{8}x^3+\frac{3}{8}x^2-\frac{5}{8}x-\frac{1}{8}\right)\right\}$.
The formula for the orthogonal projection I then got was $<f,\:\frac{\sqrt{7}}{4}g_1>\frac{\sqrt{7}}{4}g_1+<f,\:\frac{15\sqrt{2}}{16}g_2>\frac{15\sqrt{2}}{16}g_2+<f,\:\sqrt{15}g_3>\sqrt{15}g_3$.
This gave me a final answer of $g\left(x\right)=-\frac{3}{32}x^3+\frac{15}{32}x^2+\frac{15}{32}x-\frac{3}{32}$.
But this entire process was very long so I feel that my general approach may not be the right one.
If someone can tell me if what I have done is correct or not, I would greatly appreciate it!