I need to find the $L^2[-\pi,\pi]$ projection of $f(x)=x^2$ onto the space $V_n\subset L^2[-\pi,\pi]$ spanned by
$\left\{\frac{1}{\sqrt{2\pi}},\frac{\sin(jx)}{\sqrt{\pi}},\frac{\cos(jx)}{\sqrt{\pi}};j=1,\dots,n\right\}$
for $n=1$,$n=2$ and $n=3$.
I really want to learn how to do this but I can't get started.
In the case $n =1$ you search for a projection $g(x)$ of the form: $$ g \left( x \right) ={\frac {a}{\sqrt {2\pi }}}+{\frac {b \sin \left( x \right) }{\sqrt {\pi }}}+{\frac {c\cos \left( x \right) }{\sqrt {\pi }}} $$
The constants $a$, $b$ and $c$ must be determined using that $f(x)-g(x)$ is orthogonal to every vector in $V_{1}$. Then we have
Solving the equations you obtain