Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


$$\int_0^\infty x^{2n} e^{-x^2}\mathrm dx=\frac{(2n)!}{2^{2n}n!}\frac{\sqrt{\pi}}{2}$$


share|cite|improve this question
Please don't post questions as commands ("Prove ____." "Show _____.") because it is considered rude. – Tyler Mar 14 '11 at 17:00
up vote 23 down vote accepted

Alternatively, integration by parts works immediately.
Let $$a_n=\int_0^\infty x^{2n}e^{-x^2}.$$ Consider $U=x^{2n-1}$ so that $du=(2n-1)x^{2n-2}$, and $dv=xe^{-x^{2}}$ so that $V=-\frac{1}{2}e^{-x^{2}}$.

Then $$\int_{0}^{\infty}x^{2n}e^{-x^{2}}dx=\frac{1}{2}e^{-x^{2}}x^{2n-1}\biggr|_{0}^{\infty}-\int_{0}^{\infty}(2n-1)x^{2n-2}\frac{-1}{2}e^{-x^{2}}dx$$ $$=\frac{(2n-1)}{2}\int_{0}^{\infty}x^{2n-2}e^{-x^{2}}dx=\frac{(2n-1)2n}{2^{2}n}\int_{0}^{\infty}x^{2n-2}e^{-x^{2}}dx$$

Hence $$a_n=\frac{(2n)(2n-1)}{2^2n}a_{n-1}$$ and since $a_0=\frac{\sqrt{\pi}}{2}$ we conclude $$a_n=\int_{0}^{\infty}x^{2n}e^{-x^{2}}dx=\frac{(2n)!}{2^{2n}n!}\frac{\sqrt{\pi}}{2}$$ by induction.

Hope that helps,

share|cite|improve this answer

Alternatively, set $$I(\alpha) = \int_0^\infty e^{-\alpha x^2}\mathrm{d}x,$$ differentiate $n$ times with respect to $\alpha$ and evaluate at $\alpha = 1$.

EDIT: To spell things a little more out, this technique is known as Differentiation under the integral sign. Using the fact that $I(\alpha) =\frac12\sqrt{\frac{\pi}{\alpha}}$ and differentiating to obtain $$\frac{\mathrm{d}^n}{\mathrm{d}\alpha^n} I(\alpha) = (-1)^n\int_0^\infty x^{2n} e^{-\alpha x^2}\mathrm{d}x, $$ some algebraic manipulation and evaluating at $\alpha = 1$ will yield the wanted identity.

share|cite|improve this answer

Making a change of variable $u=x^2$ gives $$ \int_0^\infty {x^{2n} e^{ - x^2 } dx} = \frac{1}{2}\int_0^\infty {u^{n - 1/2} e^{ - u} du} = \frac{1}{2}\Gamma (n + 1/2). $$ Then from the well-known formula for the gamma function $$ \Gamma (n + 1/2) = \frac{{(2n)!}}{{4^n n!}}\sqrt \pi $$ we get $$ \int_0^\infty {x^{2n} e^{ - x^2 } dx} = \frac{{(2n)!}}{{2^{2n} n!}}\frac{{\sqrt \pi }}{2}. $$

Second approach. Writing $$ \int_0^\infty {x^{2n} e^{ - x^2 } dx} = \frac{1}{2} \frac{{\sqrt {2\pi (1/2)} }}{{\sqrt {2\pi (1/2)} }} \int_{ - \infty }^\infty {x^{2n} \exp \bigg( - \frac{{x^2 }}{{2(1/2)}}\bigg)dx} $$ shows that $$ \int_0^\infty {x^{2n} e^{ - x^2 } dx} = \frac{{\sqrt \pi }}{2}{\rm E}[X^{2n} ], $$ where ${\rm E}[X^{2n} ]$ is the $2n$-th moment of the Normal$(0,1/2)$ distribution. Now you can see how others, here for example, find ${\rm E}[X^{2n} ]$ (for a Normal$(0,\sigma^2)$ distribution). The simplest approach may be to use integration by parts. I'll leave it to you.

EDIT (in light of the OP's edit): Integration by parts gives the result, using induction, as follows: $$ \int_0^\infty {x^{2(n + 1)} e^{ - x^2 } dx} = \frac{{2n + 1}}{2}\int_0^\infty {x^{2n} e^{ - x^2 } dx} = \frac{{[2(n + 1)]!}}{{2^{2(n + 1)} (n + 1)!}}\frac{{\sqrt \pi }}{2}. $$ For the base case $n=0$, note that $\int_0^\infty {e^{ - x^2 } dx} = \frac{{\sqrt \pi }}{2}$.

share|cite|improve this answer

Let's suppose that, one way or another, you know that $ \displaystyle \int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}$. Then

$$\int_{-\infty}^{\infty} e^{2tx - x^2} dx= e^{t^2} \int_{-\infty}^{\infty} e^{-(t - x)^2} \, dx = e^{t^2} \sqrt{\pi}.$$

On the other hand,

$$\int_{-\infty}^{\infty} e^{2tx - x^2} dx = \int_{-\infty}^{\infty} \left( \sum_{n \ge 0} \frac{2^n t^n x^n}{n!} \right) e^{-x^2} dx = \sum_{n \ge 0} \frac{2^n t^n}{n!} \int_{-\infty}^{\infty} x^n e^{-x^2} \, dx.$$

Finally, note that by evenness,

$$\int_{-\infty}^{\infty} x^{2n} e^{-x^2} \, dx = 2 \int_0^{\infty} x^{2n} e^{-x^2} \, dx.$$

share|cite|improve this answer
Do you mean the integral from 0 to infinity? – Raeder Mar 15 '11 at 12:42
@Raeder: thank you for reminding me that I messed up the constant in the first statement, but no. The first step is messier if you take the integral from zero; you want the integral over the entire real line to get translational symmetry, but on the other hand $e^{-x^2}$ is even. – Qiaochu Yuan Mar 15 '11 at 12:45

Case 1: For $n=0$ we have $ \int^{\infty}_{0}{e^{-x^{2}}}dx=\frac{\sqrt{\pi}}{2}$. Now, we use the fact that $e^{-x^{2}}$ is an even function, and thus we have $\int^{\infty}_{0}{e^{-x^{2}}}dx=\frac{1}{2}\int^{+\infty}_{-\infty}{e^{-x^{2}}}dx. $ Moreover, $$\int^{+\infty}_{-\infty}{e^{-x^2}}dx = \sqrt{\left(\int^{+\infty}_{-\infty}{e^{-x^{2}}}dx\right)\left(\int^{+\infty}_{-\infty}{e^{-x^{2}}}dx\right)}=$$ $$= \sqrt{\left(\int^{+\infty}_{-\infty}{e^{-y^{2}}}dy\right)\left(\int^{+\infty}_{-\infty}{e^{-x^{2}}}dx\right)} = \sqrt{\int^{+\infty}_{-\infty}\int^{+\infty}_{-\infty}{e^{-\left(x^{2}+y^{2}\right)}}dydx}$$

Here, we use the fact that the variable in the integral is a dummy variable that is integrates out in the end and can be renamed from $x$ to $y$. Moreover, switching to polar coordinates then gives $$\int^{+\infty}_{-\infty}{e^{-x^{2}}}dx =\sqrt{\int^{2\pi}_{0}\int^{+\infty}_{0}e^{-r^{2}r}drd\theta} = $$ $$ =\sqrt{\int^{+\infty}_{0}re^{-r^{2}}\int^{2\pi}_{0}d\theta} = \sqrt{-\frac{1}{2}e^{-r^{2}}|^{\infty}_{0}\cdot 2\pi} = $$ $$ = \sqrt{\frac{1}{2}\cdot 2\pi} = \sqrt{\pi}$$
And so $\int^{\infty}_{0}{e^{-x^{2}}}dx=\frac{1}{2}\int^{+\infty}_{-\infty}{e^{-x^{2}}}dx=\frac{\sqrt{\pi}}{2}$.

Case 2: For $n\geq 1$. Let $a_n= \int^{+\infty}_{0}{x^{2n}e^{-x^{2}}}dx$. Using integration by parts, let $u_{1}=x^{2n-1}$ so that $du_{1}=(2n-1)x^{2n-2}dx$, and $dv_{1}=xe^{-x^{2}}dx$ so that $ v_{1}=-\frac{1}{2}e^{-x^{2}}$. Then $$\int^{+\infty}_{0}{x^{2n}e^{-x^{2}}}dx = -\frac{1}{2}e^{-x^{2}}x^{2n-1}|^{+\infty}_{0}-\int^{+\infty}_{0}{-\frac{1}{2}e^{-x^{2}}(2n-1)x^{2n-2}}dx =$$ $$ = 0+ \frac{(2n-1)}{2}\int^{+\infty}_{0}{x^{2n-2}e^{-x^{2}}}dx = \frac{(2n-1)}{2}\int^{+\infty}_{0}{x^{2n-2}e^{-x^{2}}}dx$$

Using the integration by parts again, we let $u_{2}=x^{2n-3}$ so that $du_{2}=(2n-3)x^{2n-4}dx$, and let $dv_{2}=xe^{-x^{2}}dx$ so that $v_{2}= -\frac{1}{2}e^{-x^{2}}$. Again we have $$ \int^{+\infty}_{0}{x^{2n}e^{-x^{2}}}dx = \frac{(2n-1)}{2}\int^{+\infty}_{0}{x^{2n-2}e^{-x^{2}}}dx =$$ $$ = \frac{(2n-1)}{2} \left(-\frac{1}{2}x^{2n-3}e^{-x^{2}}-\int^{+\infty}_{0}{-\frac{1}{2}e^{-x^{2}}(2n-3)x^{2n-4}dx}\right) = \frac{(2n-1)}{2} \left(0-\int^{+\infty}_{0}{-\frac{1}{2}e^{-x^{2}}(2n-3)x^{2n-4}dx}\right) =$$ $$ = \frac{(2n-1)(2n-3)}{2^{2}} \int^{+\infty}_{0}{e^{-x^{2}}x^{2n-4}dx}$$ Following the same process, we can obtain $$a_n = \int^{+\infty}_{0}{x^{2n}e^{-x^{2}}}dx = \frac{(2n-1)(2n-3)(2n-5)(2n-7)\ldots (7)(5)(3)(1)}{2^{n}}\cdot a_{0} =$$ $$ =\frac{(2n-1)(2n-3)(2n-5)\ldots(5)(3)(1)}{2^{n}}\cdot a_{0}\cdot\left(\frac{(2n-2)(2n-4)(2n-6)\ldots(6)(4)(2)}{(2n-2)(2n-4)(2n-6)\ldots(6)(4)(2)}\right) = \frac{(2n-1)(2n-3)(2n-5)\ldots(5)(3)(1)}{2^{n}}\cdot a_{0}\cdot \frac{(2n-2)(2n-4)(2n-6)\ldots(6)(4)(2)}{2^{n-1}(n-1)(n-2)(n-3)\ldots(3)(2)(1)} = $$ $$ = \frac{(2n-1)(2n-2)(2n-3)\ldots (3)(2)(1)}{2^{n}2^{n-1}(n-1)!}\cdot a_{0} = \frac{(2n-1)!}{2^{2n-1}(n-1)!}\cdot a_{0} = $$ $$ = \frac{(2n-1)!}{2^{2n-1}(n-1)!}\cdot\frac{2n}{2n}\cdot a_{0} = \frac{(2n)!}{2^{2n-1}2(n-1)!n}\cdot a_{0} = $$ $$ = \frac{(2n)!}{2^{2n}(n)!}\cdot a_{0} = \frac{(2n)!}{2^{2n}(n)!}\cdot \frac{\sqrt{\pi}}{2}$$ from Case 1.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.