Find best approximation of $\sin(\pi x)$ over $[0,1]$ with quadratic polynomial $a_0+a_1x+a_2x^2$ Use the theory of orthogonal functions to find best in the mean approximation of the function $\sin(πx)$ on the interval $[0,1]$ by a second-order polynomial
That is, find such coefficients $a_0, a_1$ and $a_2$ that,
$$\int^1_0 (\sin(\pi x)-a_0-a_1x-a_2x^2)^2 \, dx, $$
takes a minimal possible value.
I feel as though this has something to do with Fourier series but I really cant be sure because I am not very familiar with this area.
Also, I'm not sure what "best in mean approximation" means, so any help with that would be great.

Note that $x \mapsto x^k$, $k=0,1,...$ is a Schauder basis for $L^2[0,1]$. If we use, say, Gram Schmidt to orthonormalise these to get $e_k$ then we know that
for any $f \in L^2[0,1]$, we have
$f = \sum_{k=0}^n \langle e_k, f \rangle e_k$ (in an $L^2$ sense). Furthermore, the best approximation to $f$ in an $L^2$ sense in the subspace spanned by $e_0,...,e_n$ is given by $\sum_{k=0}^n \langle e_k, f \rangle e_k$.
So, with $\langle f,g \rangle = \int_0^1 f(x),g(x) dx $, we get
$e_0(x) = 1$, $e_1(x)=2 \sqrt{3}(x-{1 \over 2})$,
$e_2(x) = 6 \sqrt{5}(x^2-x+{1 \over 6})$. (These are the normalised shifted Legendre polynomials.)
With $f(x) = \sin ( \pi x)$, we get
$\langle e_0, f \rangle = {2 \over \pi}$,
$\langle e_1, f \rangle = 0$,
$\langle e_2, f \rangle = {2 \sqrt{5} \over \pi^3} (\pi^2-12)$,
and so the best $L^2$ approximation is
$\sum_{k=0}^2 \langle e_k, f \rangle e_k(x) = {( 60 {{\pi }^{2}}-720 ){{x}^{2}} +( 720-60{{\pi }^{2}} ) x -120+12 {\pi^{2}} \over {{\pi }^{3}}}$.
