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)$

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$$

