# How to compute $\min_{\{a, b, c\}}\int^{\infty}_0|x^3-a-bx-cx^2|^2e^{-x}\,dx$

I have no idea with $\min_{\{a, b, c\}}\int^{\infty}_0|x^3-a-bx-cx^2|^2e^{-x}\,dx$, especially the $e^{-x}$ part.

-

Let $V$ be the inner product space whose elements are polynomial functions on $[0,\infty)$, with inner product defined by $\langle f,g\rangle =\int_0^\infty f(x)\overline{g(x)} e^{-x}dx$. You are trying to find (the square of) the distance from $x^3$ to the subspace $P_2$ of polynomials of degree at most $2$. One way to do so is to apply Gram Schmidt on $(1,x,x^2,x^3)$ to express everything in terms of orthonormal vectors. That way, the integral can be expressed as a sum of squares, where it is easier to see how it is minimized.
Essentially, this allows you to decompose $x^3$ as $x^3 = f(x) + g(x)$ with $g\in P_2$ and $f\in P_2^\perp$, and then the min in question is $\|f\|^2 =\int_0^\infty |f(x)|^2e^{-x}dx$.
user46007: You're welcome. And if I computed correctly, it should come out to $36$. – Jonas Meyer Nov 6 '12 at 4:07
$$F(a,b,c) = \int_0^{\infty} \left(x^3 - a -bx - cx^2\right)^2 \exp(-x) dx$$ $$\dfrac{\partial F}{\partial a} = \int_0^{\infty} -2\left(x^3 - a -bx - cx^2\right) \exp(-x) dx = 0$$ $$\dfrac{\partial F}{\partial b} = \int_0^{\infty} -2x\left(x^3 - a -bx - cx^2\right) \exp(-x) dx = 0$$ $$\dfrac{\partial F}{\partial c} = \int_0^{\infty} -2x^2\left(x^3 - a -bx - cx^2\right) \exp(-x) dx = 0$$ This gives us $$\Gamma(4) - a \Gamma(1) - b \Gamma(2) - c \Gamma(3) = 0$$ $$\Gamma(5) - a \Gamma(2) - b \Gamma(3) - c \Gamma(4) = 0$$ $$\Gamma(6) - a \Gamma(3) - b \Gamma(4) - c \Gamma(5) = 0$$ where $\Gamma(n) = (n-1)!$. Now solve the linear system to get your $a,b$ and $c$.