Finding the max. of an integral

I have a question which asks:

Let $g\in C[-1,1]$ and the usual inner product $\langle f,g\rangle = \int_{-1}^{1} f(x)g(x)dx$.

Find the max value of $\int_{-1}^{1}g(x)x^3dx$ where $g$ is subject to the restrictions:

$\int_{-1}^{1} g(x)dx=0$, $\ \ \$ $\int_{-1}^{1} g(x)x^2dx=0$, $\ \ \$ $\int_{-1}^{1} |g(x)|^2dx=1$

I'm not really sure how I am supposed to proceed with this question. It is in relation to Hilbert spaces and the orthogonal projection and this question Finding the min of an integral

• Don't you feel $g(x)=x$ ! :)
– ABC
Apr 8 '13 at 12:28
• Did you try rewriting everything as a Hilbert space question? Apr 8 '13 at 12:34
• @HaraldHanche-Olsen Your comment is perfect. Mine was silly, sorry. Apr 8 '13 at 12:50
• @HaraldHanche-Olsen I'm sorry I don't quite understand what you mean by re-writing everything as a Hilbert spaces question. I can see that my restrictions are requirements for an orthonormal basis but I am a bit confused as to what you mean? Thanks for the help Apr 8 '13 at 13:00
• I mean like this: “Find the maximum of $\langle g,x^3\rangle$ subject to $\langle g,1\rangle=\langle g,x^2\rangle=0$ and $\lVert g\rVert=1$.” Apr 8 '13 at 13:45

Here is a hint: Let $P$ be the projection on the span of $1$ and $x^2$, so $Q=I-P$ is the projection on the orthogonal complement of that space. By two of the constraints $g=Qg$, so that $\langle g,x^3\rangle=\langle Qg,x^3\rangle=\langle g,Qx^3\rangle$. So you want to compute $Qx^3$. $g$ is the unit vector with the largest possible inner product with that vector.
• Isn't $Qx^3$ simply $x^3$? In that case, I am not sure how this helps. Apr 8 '13 at 14:33