I'd like to know how to answer the question located in this comprehensive exam from the 1990s. The question is:
Find the maximum value of $\int_{-1}^{1} x^3 g(x) dx$ for measurable functions g(x) satisfying
$$ \int_{-1}^{1} g(x) dx = \int_{-1}^{1} x g(x) dx = \int_{-1}^{1} x^2 g(x) dx = 0 . $$
and $\int_{-1}^{1} |g(x)|^2 dx = 1$.
In principle I think I could reduce to the case where $g$ is continuous, and then even smooth/polynomial, and try to formulate things as some kind of optimization problem, but I suspect there's some sort of trick I'm not aware of.
I suppose that it is a linear algebra problem: $g$ needs to belong to the orthogonal complement of $1, x, x^2$ and we want to maximize its inner product with $x^3$. So, what we do is find the projections of $x^3$ onto the (normalized) $1, x,$ and $x^2$ coordinates, the subtract that away to get a function $h$ that is orthogonal to $1, x, x^2$ and will be the closest in direction to $x^3$. Then you normalize $h$ to get $g$.