How do I integrate $$\int\limits_{-\infty}^{\infty}x^2e^{-\frac{1}{2}x^2}\;\mathrm{d}x\;?$$ I'm sure that there's a way to do this with the Gamma function, but I just don't see it..
How do I integrate $\int_{-\infty}^{\infty}x^2e^{-\frac{1}{2}x^2}dx$?
152 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 4 best solutions below
On
This resembles the second order moment of a standard normal distribution, sans the normalizing constant. So if we let $X \sim N(0,1)$ then \begin{align} 1 = EX^2 = \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}x^2e^{-x^2/2}\mathrm{d}x. \end{align}
On
To go back to known integrals, start using $x=y\sqrt 2$. This gives $$\int x^2e^{-\frac{x^2}{2}}\,dx=2\sqrt 2\int y^2e^{-y^2}\,dy$$ Now $$\int y^2e^{-y^2}\,dy=\int y y e^{-y^2}dy=-\frac 12\int y(-2y)e^{-y^2}dy$$ which makes clear the integration by parts $$u=y\qquad v'=-2ye^{-y^2}dy\qquad u'=dy\qquad v=e^{-y^2}$$ So $$\int y^2 e^{-y^2}dy=-\frac 12\Big(ye^{-y^2}-\int e^{-y^2}dy\Big)$$
I am sure that you can take from here.
On
Since $$\int_{-\infty}^\infty e^{-\alpha x^2/2}dx=\sqrt{2\pi}\alpha^{-1/2},$$ differentiation under the integral sign with respect to $-\alpha/2$ gives $$\int_{-\infty}^\infty x^2 e^{-\alpha x^2/2}dx=\sqrt{2\pi}\alpha^{-3/2}.$$ Substituting $\alpha=1$ gives $$\int_{-\infty}^\infty x^2 e^{-x^2/2}dx=\sqrt{2\pi}.$$
You could use the Gamma function, though in my opinion, you're better off using integration by parts alongside the integration of the Gaussian. Anyway, here's a solution with the Gamma function in use.
$$2\int\limits_0^{\infty}x^2e^{-\frac{1}{2}x^2}\ dx $$
Let $u=\frac12x^2$ such that $du = x dx = \sqrt{2u}dx$. Then,
$$4\int\limits_0^{\infty}u e^{-u}\ \frac{du}{\sqrt{2u}} = \frac{4}{\sqrt2}\int\limits_0^{\infty}u^{1/2} e^{-u}\ du = \frac{4}{\sqrt2}\Gamma(3/2) = \frac{4}{\sqrt2}\frac{\sqrt\pi}{2} = \sqrt{2\pi}$$