Solution (source code)

= Solution

By part (c), the best <polynomial> of degree at most $2$ is odd, hence has the form $p_2(x)=cx$. The <orthogonal projection> condition with $q=x$ gives
$$
c=\frac{(x^{2011},x)}{(x,x)}
=\frac{\int_{-1}^1x^{2014}\,dx}{\int_{-1}^1x^4\,dx}
=\frac{2/2015}{2/5}=\frac1{403}.
$$
The residual is odd, so its weighted inner products with the even polynomials $1$ and $x^2$ vanish automatically. Thus all three <normal equations for linear least squares>[normal equations] hold and
$$
\boxed{p_2(x)=\frac{x}{403}.}
$$