# How to maximize this integral?

Rudin asked me to maximize $$\int^{1}_{-1}x^{3}g(x)dx$$ under the restraint that $$\int^{1}_{-1}g(x)=\int^{1}_{-1}xg(x)dx=\int^{1}_{-1}x^{2}g(x)dx=0$$

This is clearly a Hilbert space problem need to use orthogonal relations. I computed $x^{3}$'s coefficients under the $L^{2}$ inner product and it turns out $x^{3}=\frac{3}{5}x^{2}+c$, with $c$ being orthogonal to $\{1,x,x^{2}\}$. But how does this help to find $g$?

A related question I also do not know how to solve is to find the minimum of $$\int^{\infty}_{0}|x^{3}-a-bx-cx^{2}|^{2}e^{-x}dx$$And it is not clear to me what the linearly independent underlying set is - $\{1,x,x^{2},e^{-x/2}\}$?

-
I finally had some ideas, we just need to normalize $c$ to get $g$. – Bombyx mori Dec 29 '12 at 3:01
Hint for the second one: $e^{-x}$ is the weight function in the inner product. Also, do you know about Laguerre polynomials and/or Gram-Schmidt with respect to a weighted inner product? – JohnD Dec 29 '12 at 3:10
No I don't. I have to sleep now but really grateful for the hint. – Bombyx mori Dec 29 '12 at 3:15
Would it be possible to include a more detailed sketch of your steps to answering the first question. For example the phrase you "computed x^3's L2 inner product seems odd to me, since an inner product is usually defined over two functions. I assume it means \int x^3 x^3 dx?. I am looking at solving a related question. For example what if you swapped the x^2 and the x^3 in the problem statement, would the method above still hold. I haven't seen these Hilbert Space theorems used for maximization before. Do you have any references that can be found online? (also @Bombyxmori) – MHH Jun 30 '15 at 3:05

Hopefully you can recognize the second question as an application of what is sometimes called the "best approximation theorem" or "orthogonal projection theorem" in a Hilbert space. I'll show one approach, but there are others that people can chime in on.

If $\{\varphi_i(x)\}$ forms a complete orthonormal family on an interval $I$, with respect to the weight function $w(x)$, i.e., $$\langle \varphi_i,\varphi_j\rangle_w:=\int_I \varphi_i(x)\varphi_j(x)w(x)\,dx=\begin{cases} 0, &i\not=j,\\ 1, &i=j,\end{cases}$$ and we want to approximate $f\in L^2_w(I)$ as $$f(x)\approx\sum_{i=1}^n c_i \varphi_i(x), \quad x\in I,$$ then the "best" choice for the coefficients $c_i$ in the sense of minimizing the weighted $L^2$ norm of the error, $$\left\|f(x)-\sum_{i=1}^n c_i \varphi_i(x)\right\|_{L^2_w(I)},$$ is simply $c_i=\langle f,\varphi_i\rangle_w$, $i=1,\dots,n$.

To bring this to bear on your problem, the weight on the inner product is $e^{-x}$, $I=[0,\infty)$, $f(x)=x^3$, and we want to minimize the weighted $L^2_w(I)$ error when using the approximation $$x^3\approx a+bx+cx^2=\sum_{i=0}^2 c_i L_i(x),$$ where $L_i(x)$ denotes the $i$th Laguerre polynomial.

Since $L_0(x)=1$, $L_1(x)=1-x$, and $L_2(x)={1\over 2}(2-4x+x^2)$, from the best approximation theorem above, \begin{align} c_0&=\langle x^3,L_0\rangle_w=\int_0^\infty x^3 e^{-x}\,dx=6,\\ c_1&=\langle x^3,L_1\rangle_w=\int_0^\infty x^3(1-x)e^{-x}\,dx=-18,\\ c_2&=\langle x^3,L_2\rangle_w=\int_0^\infty x^3\cdot{1\over 2}(2-4x+x^2)e^{-x}\,dx=18, \end{align} which results in $$a=c_0+c_1+c_2=6, \quad b=-c_1-2c_2=-18, \quad c={c_2\over 2}=9.$$

Of course, if we want to let Mathematica do the work for us, it can:

but where's the fun in that? ;-)

Hope that helps.

-