How does one evaluate $$\int_{-\infty}^\infty x^2\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2} \ dx ?$$
The result is $1$ and it corresponds to $E[X^2]$, where $X$ is a random variable with $X\sim\mathcal{N}(0,1)$. I have tried to do some substituions and I've tried integration by parts but didn't succeed to integrate it. With the integration by parts I ended up with a harder integral in both cases and I couldn't find a good substitution.
Notice, integral can be usually computed using Laplace transform as follows, $$\int_{-\infty}^{\infty}x^2\frac{1}{\sqrt{2\pi }}e^{-\frac{x^2}{2}}\ dx $$ By symmetry of even function: $f(-x)=f(x)$, $$=2\frac{1}{\sqrt{2\pi }}\int_{0}^{\infty}x^2e^{-\frac{x^2}{2}}\ dx $$$$=\sqrt{\frac{2}{\pi }}\int_{0}^{\infty}x^2e^{-\frac{x^2}{2}}\ dx $$ let $\frac{x^2}{2}=u\implies x\ dx=du$ or $dx=\frac{1}{\sqrt{2u}}\ du=\frac{1}{\sqrt2}\frac{ du}{\sqrt u}$, $$=\sqrt{\frac{2}{\pi }}\int_{0}^{\infty}(2u)e^{-u} \frac{1}{\sqrt2}\frac{ du}{\sqrt u}$$ $$=\frac{2}{\sqrt {\pi}}\int_{0}^{\infty}u^{1/2}e^{-u}\ du$$ using Laplace transform: $\color{blue}{\int_0^{\infty}t^ne^{-st}\ dt=\frac{\Gamma(n+1)}{s^{n+1}}}$, $$=\frac{2}{\sqrt {\pi}}\left[\frac{\Gamma\left(1+\frac{1}{2}\right)}{s^{1+\frac{1}{2}}}\right]_{s=1}$$ $$=\frac{2}{\sqrt {\pi}}\left[\frac{\frac{1}{2}\Gamma\left(\frac{1}{2}\right)}{(1)^{3/2}}\right]$$ $$=\frac{2}{\sqrt {\pi}}\left[\frac{1}{2}\sqrt \pi\right]=\color{red}{1}$$