TITLE: Integral: $\int_{-\infty}^{\infty} x^2 e^{-x^2}\mathrm dx$
QUESTION [41 upvotes]: I don't know how to evaluate it. I know there is one method using the gamma function. BUT I want to know the solution using a calculus method like polar coordinates.
$$\int_{-\infty}^\infty x^2 e^{-x^2}\mathrm dx$$
I will wait for a solution. Thank you.

REPLY [12 votes]: If you know that $\int_{-\infty}^\infty e^{-x^2}=\sqrt\pi$, then you can use it to easily solve this.
Differentiating $e^{-x^2}$ twice,
$$\frac{d^2}{dx^2}e^{-x^2}=-2e^{-x^2}+4x^2e^{-x^2}$$
Now integral of the left hand side is $0$, as $\int\left(\frac{d^2}{dx^2}e^{-x^2}\right)dx=\frac{d^2}{dx^2}\int e^{-x^2}dx=\frac{d^2}{dx^2}\sqrt\pi=0$.
So integrating, we get 
$$\begin{array}{rcl}
0&=&\int -2e^{-x^2}+4x^2e^{-x^2}\,dx\\
&=&-2\sqrt\pi+4\int x^2e^{-x^2}\,dx\\
\implies\int x^2e^{-x^2}\,dx&=&\frac{\sqrt\pi}{2}
\end{array}
$$