# Need help with the integral $\int_{0}^\infty e^{-x^{2}}x^{2n+1}dx$

Problem: Prove that $$I = \int_{0}^\infty e^{-x^{2}}x^{2n+1}dx = \frac{n!}{2}$$

Source: A problem I found on an integral test. The problem bugged me for long and I did end up leaving it on the exam. Back home I decided to tackle it again. Here's my go on it.

My try: I have never encountered such a problem before, not even in my assignments and workbooks. Here's how I tried it

We can first take an indefinite integral and then we can work up towards a reduction formula.We can plug in the limits later. I don't know if it's any good but I did write this up on the exam: $$I_{2n+1} = \int{e^{x^{-2}}}{x^{2n+1}}dx$$

On applying Integration by parts:

$$I_{2n+1} = e^{-x^{2}}\frac{x^{2n+2}}{2n+2} +\frac{2}{2n+2} \int{e^{-x^{2}}}{x^{2n+3}}dx$$

or $$I_{2n+1} = e^{-x^{2}}\frac{x^{2n+2}}{2n+2} +\frac{I_{2n+3}}{n+1}$$ or

$$I_{2n+1} = {e^{-x^{2}}\over 2}\Bigl(\frac{x^{2n+2}}{n+1}\Bigl) +\frac{I_{2n+3}}{n+1}$$

Edit 1: As suggested (already tried by me) lets put $u = -x^2$ $$du = -2xdx$$ plug the above expression in the problem

$$I_{n} = -{1 \over 2}\int{e^{u}}{u^{n}}du$$

$$I_{n} = -{1 \over 2}e^{-u}\frac{u^{n+1}}{n+1} + \frac{I_(n+1)}{n+1}$$

Certainly helps. Now what?

Edit 2: Use the gamma function to get the result. Now unfortunately I didn't read it for the test that's why I didn't get it. Thank you all for pointing out the right direction!

• $$e^{x^{-2}}$$ or $$e^{-x^2}\ ?$$ – Did Sep 19 '17 at 15:42
• The latter is the arch classical Gaussian integral. Tons of questions about it here. – Did Sep 19 '17 at 15:43
• I'm very sorry I'll correct it now @Did thanks for pointing out – YourAverageEuler Sep 19 '17 at 15:45
• Try the substitution $t = x^2$ on your initial integral – George Coote Sep 19 '17 at 15:54
• First to simplify perform the change of variable $y=x^2$ – FDP Sep 19 '17 at 15:54

I thought it might be instructive to present a way forward that relies on differentiating under the integral. To that end, we proceed.

Let $I(a)$ be given by the integral

$$I(a)=\int_0^\infty e^{-ax^2}\,x\,dx=\frac1{2a} \tag1$$

Differentiating $(1)$ $n$ times reveals

\begin{align} I^{(n)}(a)&=(-1)^n\int_0^\infty e^{-ax^2}\,x^{2n+1}\,dx\\\\ &=\frac12 \frac{d^n}{da^n}\left(\frac1a\right)\\\\ &=\frac1{2a^{n+1}}(-1)^n\,n!\tag2 \end{align}

Finally, setting $a=1$ in $(2)$, we find that

$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty e^{-x^2}\,x^{2n+1}\,dx=\frac12\,n!}$$

And we are done!

• Should you equation (2) be $\frac{1}{2}(-1)^n \frac{n!}{a^{n+1}}$? – Strants Sep 19 '17 at 21:32
• @strants Indeed. Good catch. I've edited. Thank you. – Mark Viola Sep 19 '17 at 22:21

$n\geq 0$ integer.

$\displaystyle J=\int_{0}^\infty e^{-x^{2}}x^{2n+1}dx$

Perform the change of variable $y=x^2$,

\begin{align}J&=\frac{1}{2}\int_{0}^\infty e^{-x}x^{n}dx\\ &=\frac{1}{2}\Gamma(n+1)\\ &=\boxed{\frac{1}{2} n!}\\ \end{align}

• That's the gamma formula you used if I'm not mistaken? – YourAverageEuler Sep 19 '17 at 16:16
• Sure. It's derived from the formula, $\Gamma(z+1)=z\Gamma(z)$ and using recurrence. – FDP Sep 19 '17 at 16:40

Let's pretend that we have no idea about the Gamma function. Apply a substitution,

$$t = x^2$$

From which, $$I_n = \int_0^\infty e^{-t} (x^2)^n \cdot \frac x {2x} \mathrm d t$$ $$I_n = \frac 1 2 \int_0^\infty e^{-t} t^n \mathrm dt$$

As we are trying to prove that $2I_n = n!$, it is sufficient to prove that, from the recursive definition of the factorial,

$$2I_1 = 1$$ $$I_n = nI_{n-1}$$

Can you take it from here with IBP?

• thanks but I don't get the last factorial part. Any references? – YourAverageEuler Sep 19 '17 at 16:19
• Apply IBP to $I_{n+1}$ with $f(x)=exp(-t)$, antiderivative $=-exp(-t)$ and $g(t)=t^{n+1}$ – FDP Sep 19 '17 at 17:47

Let us start from your initial formula $$I_{2n+1} = \int{e^{x^{-2}}}{x^{2n+1}}dx$$ and define the definite integral $$J_{2n+1} = \int_0^{\infty}{e^{x^{-2}}}{x^{2n+1}}dx$$

If we take the formula you got via integration by parts:

$$I_{2n+1} = e^{-x^{2}}\frac{x^{2n+2}}{2n+2} +\frac{2}{2n+2} \int{e^{-x^{2}}}{x^{2n+3}}dx$$ and evaluate it at it's limits, it reduces to

$$J_{2n+1} = \frac{1}{n+1} \int_0^{\infty}{e^{-x^{2}}}{x^{2n+3}}dx=\frac{J_{n+3}}{n+1}.$$

Your formula now follows from evaluating $J_1$ and induction. For this purpose, it is useful to rewrite the equation as $J_{2k+1}=kJ_{2(k-1)+1}$.