This is actually exercise 4.14 from Rudin's Real and Complex Analysis (also, yes I am aware of the AoPS solution manual but it actually skips this problem).
Problem statement:
Compute
$$ \min_{a,b,c} \int_{-1}^1 |x^3 - a - bx - cx^2|^2 dx $$
and find
$$\max \int_{-1}^1 x^3 g(x) dx$$
Subject to $$\int_{-1}^1 g(x)dx = \int_{-1}^1 xg(x)dx = \int_{-1}^1 x^2g(x)dx = 0$$
And $$\int_{-1}^1 |g(x)|^2 dx = 1$$
To give some context, this problem is from a chapter on elementary Hilbert space theory. Indeed the first integral is really just minimizing $||x^3 - a - bx - cx^2||_2$ ($L^2$ norm). However, the method in my head honestly seems like it would be more complicated than could be reasonably expected from just the material of the chapters (if you have a copy of the book, let me know if you agree).
Of course on the given interval, the Legendre polynomials are an orthonormal set (after normalizing by a suitable constant). Actually, a side note: after looking through the chapter Grahm-Schmidt is not actually introduced, so I guess the reader is assumed familiar with it. Anyway, we can of course rewrite any polynomial as a linear combination of the Legendre polynomials. After doing this, we merely apply Bessel's inequality and differentiate w.r.t $a$, $b$, and $c$ and find our minimum.
As for the second part, I assume that this must be related to the first part of the problem, but I cannot see how. In fact, I am pretty much lost as to how to solve this. While I am aware of (possible) techniques from the calculus of variations, I feel like that must be well above the scope of the text's intended solution.
In terms of $L^2$ formulation, we see that $g(x)$ is orthogonal to $1$, $x$, and $x^2$, and has norm $1$. So we are asked to maximize the inner product with $x^3$. I cannot find any obvious utility with these facts though. Any help is appreciated.
Thanks!
Let $X$ be the space of real-valued polynomials with degree $\le 2$. Note that the Legendre polynomials $e_0(x)=1, \ e_1(x)=x, e_2(x) = \frac{1}{2}(3x^2-1)$ form an orthogonal basis for $X$. To determine $$\min_{a,b,c} \int_{-1}^1 |x^3 - a - bx - cx^2|^2 \; dx$$ we minimize $\|x^3-p(x)\|_{L^2}$ with $p(x) = a+bx+cx^2$ by projecting $x^3$ onto $\{e_0,e_1,e_2\}$ via $$\displaystyle\sum_{n=0}^2 \dfrac{ \langle e_i, x^3 \rangle}{\langle e_i,e_i \rangle} e_i.$$
You should find $p(x) = \frac{3}{5}x$, and for your final answer you substitute into the integral and get $\frac{8}{175}$.
For the second part, as you said we have $g \perp X$, and $\|g\|_{L^2}=1$. We're looking to maximize $ \langle x^3, g \rangle_{L^2}$. An initial thought is Cauchy-Schwarz: $| \langle x^3, g \rangle_{L^2} | \le \|x^3\|_{L^2} \|g\|_{L^2}$, with equality when $g$ is a multiple of $x^3$. But if $g(x) = \lambda x^3,$ then $g$ is not orthogonal to $X$; in particular, $g$ is not orthogonal to $e_1 = x$.
Instead with $p = 3x/5$, we have $\langle x^3, g \rangle_{L^2} = \langle x^3 -p, g \rangle_{L^2} + \langle p,g \rangle_{L^2} = \langle x^3-p, g \rangle_{L^2} $, and we apply Cauchy-Schwarz again so that $g(x) = \lambda (x^3 - p)$. Since $g$ has norm 1, we get $$g(x) = \dfrac{ x^3-p}{\|x^3-p\|_{L^2}} = \sqrt{\dfrac{175}{8}} \left( x^3- \dfrac{3x}{5} \right).$$ By construction, $x^3 -\text{proj}_{X}(x^3)= x^3 - p$ is $ \perp X$ so $g \perp X$ and we are finished except for actually computing the maximum integral. The final computation yields $\frac{2\sqrt{14}}{35}$.