Compute $\min_{a,b,c \in \mathbb{R}} \int_{0}^{\infty} |x^3−a−bx−cx^2|^2 e^{-x}dx$ 
Compute the following:
$\min_{a,b,c \in \mathbb{R}} \int_{0}^{\infty} |x^3−a−bx−cx^2|^2 e^{-x}dx $

I am really confused with this exercise, we are working on Hilbert Space in my Functional analysis class, and the indication of my professor is using the best approximation lemma. 
Best approximation lemma: 
$||f-S_{N}(f)||_2 ^2 \le || f-\sum_{|n|= N} c_n \cdot e_n||$ for all $c_n \in \mathbb{C}$, where $S_N$ is the Fourier Series of $f$.
But I don't how can I do it. Thank u for your help. 
 A: Very similar to @Yuriy S's answer.
Expanding the square, you have a polynomial of degree $6$ that is to say that you face the problem of
$$I=\int_0^\infty \left(\sum_{i=0}^6 c_i x^i\right) e^{-x}\,dx=\sum_{i=0}^6 c_i\int_0^\infty x^ie^{-x}\,dx=\sum_{i=0}^6 c_i\,i!$$
This makes
$$I=a^2+2 a b+4 a c-12 a+2 b^2+12 b c-48 b+24 c^2-240 c+720$$ Now, compute the partial derivatives and set them equal to $0$. This will give
$$\frac{\partial I}{\partial a}=2 a+2 b+4 c-12=0$$
$$\frac{\partial I}{\partial b}=2 a+4 b+12 c-48=0$$
$$\frac{\partial I}{\partial c}=4 a+12 b+48 c-240=0$$ and then the result already given in @Yuriy S's answer.
A: Since every part of the integral is real, we can get rid of the absolute value function:
$$L(a,b,c)= \int_{0}^{\infty} (x^3−a−bx−cx^2)^2 e^{-x}dx$$
There's a unique solution such that:
$$\frac{\partial L}{\partial a}=\frac{\partial L}{\partial b}=\frac{\partial L}{\partial c}=0$$
Which makes it some kind of a stationary point, either a minimum, maximum or a saddle point. But it's pointless to check, since again, there's a unique solution, since we get a linear system of equations.
$$\int_{0}^{\infty} (x^3−a−bx−cx^2) e^{-x}dx=0 \\ \int_{0}^{\infty} (x^3−a−bx−cx^2) x e^{-x}dx=0 \\ \int_{0}^{\infty} (x^3−a−bx−cx^2) x^2 e^{-x}dx=0$$
This is easy to solve exactly.
If I didn't make some typo, the solution will be:
$$a=6 \\ b=-18 \\ c=9$$
And the value:
$$L(6,-18,9)=36$$
This is very reasonable as the minimum, because checking for random combinations of $a,b,c$ gives much larger values.
Here are a few contour plots around the minimum value.


Note that in this case the integral itself can be easily found analytically, and the resulting function minimized.
However, the method in this answer can be used for any weight function, as long as you can integrate numerically.
It's just a linear optimization problem.
