Compute $\int_{-\infty}^{\infty} x^2e^{-x^2} \,dx$ $$\int_{-\infty}^{\infty} x^2e^{-x^2} \,dx$$
$g(x) = x^2e^{-x^2}$
Well, After computing it's fourier transform, which is $g(w) =\frac{2-w^2}{8\sqrt\pi}\cdot e^{\frac{-w^2}{4}}$.
In the solution they used some formula and said that:
$\int_{-\infty}^{\infty} x^2e^{-x^2} \,dx = 2\pi g(0) = \frac{\sqrt\pi}{2}$.
Well I don't understand what formula they used, and why did they make it $w = 0$. I thought about the $g(x) = \int_{-\infty}^{\infty} g(w)e^{iwx} dw$ and $w=0$. which didn't quite work..
Edit: I think I solved it. used the definiton $\frac{1}{2\pi}\int_{-\infty}^{\infty} g(x)e^{iwx} dx = g(w)$
 A: By integration by parts
$$ \int_{-\infty}^{+\infty}x^2 e^{-x^2}\,dx = \int_{-\infty}^{+\infty}\frac{x}{2}\left(2x e^{-x^2}\right)\,dx = \frac{1}{2}\color{red}{\int_{-\infty}^{+\infty}e^{-x^2}\,dx} = \frac{\color{red}{\sqrt{\pi}}}{2}$$
So it is enough to know the gaussian integral, there is no need to invoke Fourier transforms or the $\Gamma$ function.
A: Just for fun, here's a method that completely sidesteps integration by parts.
\begin{align}
\int_{-\infty}^\infty x^2e^{-x^2}dx&=-\int_{-\infty}^\infty\frac{\partial}{\partial\mu}e^{-\mu x^2}dx\bigg\vert_{\mu=1}\\
&=-\frac{d}{d\mu}\int_{-\infty}^\infty e^{-\mu x^2}dx\bigg\vert_{\mu=1}\\
&=-\sqrt{\pi}\frac{d}{d\mu}\left(\frac{1}{\sqrt{\mu}}\right)\bigg\vert_{\mu=1}\\
&=\frac{\sqrt{\pi}}{2\mu^{3/2}}\bigg\vert_{\mu=1}\\
&=\frac{\sqrt{\pi}}{2}
\end{align}
As with Jack's method, you only need to know the Gaussian integral.
A: For the undefinite integral, use integration by parts:
$$\mathcal{I}\left(x\right)=\int x^2e^{-x^2}\space\text{d}x=-\frac{xe^{-x^2}}{2}+\frac{1}{2}\int e^{-x^2}\space\text{d}x\tag1$$
Well, we have that:
$$\int\frac{2e^{-x^2}}{\sqrt{\pi}}\space\text{d}x=\frac{2}{\sqrt{\pi}}\int e^{-x^2}\space\text{d}x=\text{erf}\left(x\right)+\text{C}\tag2$$
So, we get:
$$\mathcal{I}\left(x\right)=\frac{\sqrt{\pi}\text{erf}\left(x\right)-2xe^{-x^2}}{4}+\text{C}\tag3$$
Now, for the boundaries we get:


*

*$$\lim_{x\to-\infty}\mathcal{I}\left(x\right)=-\frac{\sqrt{\pi}}{4}\tag4$$

*$$\lim_{x\to\infty}\mathcal{I}\left(x\right)=\frac{\sqrt{\pi}}{4}\tag5$$

