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.

\begin{align}
\int^1_0 ( & \sin(\pi x)-a_0-a_1x-a_2x^2)^2 \, dx, \\[8pt]
= \int_0^1 \Big( & \sin^2(\pi x) \,dx + a_0^2 + a_1^2 x^2 + a_2^2 x^4 \\
& {}-2a_0\sin(\pi x) - 2a_1x\sin(\pi x) - 2a_2x^2 \sin (\pi x) \\
& {} -{}2a_0a_1 x -2a_0a_2x^2 -2a_1a_2 x^2 \Big) \, dx \\[10pt]
= {} & \int_0^1 \sin ^2(\pi x)\, dx + a_0^2 \int_0^1 1\,dx + a_1^2 \int_0^2x^2\, dx + a_2^2\int_0^1 x^2\,dx \\[10pt]
& {} - 2a_0 \int_0^1\sin(\pi x)\,dx - 2a_1 \int_0^1 x\sin(\pi x)\,dx - 2a_2 \int_0^1 x^2 \sin(\pi x)\,dx \\[10pt]
& {} - 2a_0a_1 \int_0^1 x\,dx -2a_0a_2 \int_0^1 x^2\, dx - 2a_1 a_2 \int_0^1 x^2 \, dx \\[12pt]
= {} & B_0 + B_1a_0^2 + B_2a_1^2 + B_3 a_2^2 - 2B_4 a_0 - 2B_5 a_1 -2B_6 a_2 \\
& {} -2B_7 a_0 a_1 - 2B_8 a_0 a_2 - 2B_9 a_1 a_2.  
\end{align}
So you have a quadratic polynomial in three variables and the problem is to find the values of the variables that minimize the value of the polynomial.
