# Integral of $x^2 \exp(-ax^2)$ using the gamma function?

I'm struggling with this integral:

$$\int_{-\infty}^{\infty}x^{2}e^{-ax^{2}}dx = \frac{\sqrt{\pi}}{2a^{3/2}}$$

Is there a way to do this integration without using integration by parts and then explicitly relying on the Gaussian integral, instead using the Gamma function $\Gamma(a)=\int_{0}^{\infty}x^{a-1}e^{-x} dx$ ? I had tried the substitution $u=ax^2$ to give $\frac{2}{a}\int_{0}^{\infty}ue^{-u}du$ but that doesn't seem to get me far.

Thanks in advance for any help or hints !

-
$\int_0^\infty ue^{-u} du = \int_0^\infty x^{2-1} e^{-x} dx = \Gamma(2)$. But note that your change of variables is not quite right: if $u = ax^2$ you have $du = 2ax dx$ so $$\int_0^\infty x^2 e^{-ax^2} dx = \int_0^\infty \frac{u}{a} e^{-u} \frac{du}{2\sqrt{au}}$$... – Willie Wong Mar 26 '12 at 14:26
Your approach is correct, but not the result. Your substitution should yield $$\frac{1}{a^{3/2}}\int_{0}^{\infty} u^{1/2}e^{-u}\; du.$$ – Sangchul Lee Mar 26 '12 at 14:29
To get this from the Gaussian painlessly, use differentiation under the integral sign. See math.uconn.edu/~kconrad/blurbs/analysis/diffunderint.pdf, esp. section 5. – KCd Mar 26 '12 at 22:35
Hi KCd. Thanks. I am curious. So we would evaluate this: $\int_{-\infty}^{\infty}\frac{\partial }{\partial a}x^{2}e^{-ax^{2}}dx$ ? – P Sellaz Mar 27 '12 at 8:10

Summarising the comments, after substitution of $u=ax^2$ and $du=2axdx$, you'll get $$\int_0^\infty x^2 e^{-ax^2}dx=\frac{1}{2a^{3/2}}\int_0^\infty u^{3/2-1}e^{-u} du=\frac{\Gamma(3/2)}{2a^{3/2}}=\frac{\sqrt{\pi}}{4a^{3/2}}.$$
Sorry, to un-select as the answer, but I still have a doubt. The original problem is to integrate over the whole real line, and appealing to symmetry, since the integrand is a function only of $x^2$ , the integral should be twice that over just positive x. That means $$\int_{0}^{\infty}x^{2}e^{-ax^{2}}dx = \frac{\sqrt{\pi}}{4a^{3/2}}$$ so there is a factor of 1/2 missing somewhere. Can you help ? – P Sellaz Mar 26 '12 at 17:25
@PSellaz, thanks, I unintentionally dropped the $2$ from the substitution, sorry for the confusion. – draks ... Mar 26 '12 at 17:50