Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How to prove $$\int_{0}^{\infty} \mathrm{e}^{-x^2}\, dx = \frac{\sqrt \pi}{2}$$

share|improve this question
No point in repeating Wikipedia: en.wikipedia.org/wiki/Gaussian_integral –  Qiaochu Yuan Nov 7 '10 at 16:48
We had a nice discussion about this over at Tim Gowers' blog a few years ago. gowers.wordpress.com/2007/10/04/… –  David Speyer Nov 21 '10 at 16:25
I'm curious to know if there is a way to prove this using only calculus of one variable. –  lentic catachresis Apr 23 '11 at 19:50

14 Answers 14

up vote 80 down vote accepted

This is an old favorite of mine.
Define $$I=\int_{-\infty}^{+\infty} e^{-x^2} dx$$ Then $$I^2=\bigg(\int_{-\infty}^{+\infty} e^{-x^2} dx\bigg)\bigg(\int_{-\infty}^{+\infty} e^{-y^2} dy\bigg)$$ $$I^2=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}e^{-(x^2+y^2)} dxdy$$ Now change to polar coordinates
$$I^2=\int_{0}^{+2 \pi}\int_{0}^{+\infty}e^{-r^2} rdrd\theta$$ The $\theta$ integral just gives $2\pi$, while the $r$ integral succumbs to the substitution $u=r^2$ $$I^2=2\pi\int_{0}^{+\infty}e^{-u}du/2=\pi$$ So $$I=\sqrt{\pi}$$ and your integral is half this by symmetry

I have always wondered if somebody found it this way, or did it first using complex variables and noticed this would work.

share|improve this answer
I'm not sure how the history goes precisely but I imagine people first noticed that certain trig substitutions were equivalent to relating their integrals to multi-variable integrals and the story built from there. –  Ryan Budney Nov 7 '10 at 16:51
+1. I will delete my answer. Please consider using displaystyle or $$. –  Aryabhata Nov 7 '10 at 17:01
@Moron: I tried it, I like it. And it makes the e's come out in a better font, as well. Still learning this LaTex stuff. Thanks. Then I tried \lgroup and \rgroup for the parentheses in the second line (to make them bigger) and it didn't seem to help –  Ross Millikan Nov 7 '10 at 17:08
+1: I knew the proof using the two variable functions you provide in your $I^2$ line, but I really love how you got to it! (It always seemed like "out of the blue" for me while I was taking the class) –  Andy Nov 7 '10 at 17:24
@RyanBudney: this integral was not first computed using complex variables or multivariable integrals. The first proof, due to Laplace, is discussed at the end of math.uconn.edu/~kconrad/blurbs/analysis/gaussianintegral.pdf. –  KCd Apr 4 '12 at 4:00

A variation on Ross Millikan's answer.

We can start again with the observation $$\left(\int_{-\infty}^{\infty}e^{-x^2}dx\right)\left(\int_{-\infty}^{\infty}e^{-y^2}dy\right)=\left(\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dxdy\right)=V.$$ Now $V$ is simply the volume of the body $$-\infty < x,y < \infty,\qquad 0 < z < e^{-(x^2+y^2)},$$ or, equivalently, $$0 < x^2+y^2 < -\ln z,\qquad 0 < z < 1.$$ This implies that the body is a solid of revolution. Using the disk integration formula, we have $$V=\int_{0}^{1}\pi(-\ln z)dz=[\pi(z-z\ln z)]_{0}^1=\pi.$$

share|improve this answer
Beautiful! I had not seen this one before. –  Mike Spivey Nov 7 '10 at 20:56
@Mike Spivey: I vaguely remember seeing this in a note in the Math. Intelligencer though I'm not able to reconstruct the exact reference. –  Andrey Rekalo Nov 7 '10 at 21:17
Andrey, was this the article you had in mind? –  J. M. Nov 21 '10 at 0:36
This method is also the one given by Keith Ball in §5.6 of his 2003 book Strange Curves, Counting Rabbits, and other Mathematical Explorations. (I mention this only because it predates the Intelligencer article by a few years; but of course I have no reason to suspect this is the earliest occurrence.) –  Steven Taschuk Mar 21 '12 at 2:39
An earlier occurrence of this proof was in 1994. See T. P. Jameson, "The Probability Integral by Volume of Revolution", Math. Gazette 78 (1994), 339-340. –  KCd Apr 15 '12 at 19:11

I know this:

Define $f$ and $g$ as:

$$f(x):=\left(\int_0^x e^{-t^2}dt\right)^{2} \ \ \ \text{and} \ \ \ g(x):=\left(\int_{0}^{1}\frac{e^{-x^{2}(t^{2}+1)}}{t^{2}+1}dt\right)$$

Now, $$f'(x)=2e^{-x^{2}}\int_{0}^{x}e^{-t^{2}}dt$$ and

$$g'(x)=\int_0^1 \frac{\partial}{dx}\left[\frac{e^{-x^2(t^2+1)}}{t^2+1}\right]dt = -2xe^{-x^{2}}\int_{0}^{1}e^{-x^{2}t^{2}}dt$$

So putting $t=tx$, get $\displaystyle\int_{0}^{1}e^{-x^{2}t^{2}}dt= \frac{1}{x}\displaystyle\int_{0}^{x}e^{-t^{2}}dt$

Then we get;


Thus $f'(x)+g'(x)=0$ for all $x$, then $f(x)+g(x)$ is an constant function. Also $$f(0)+g(0)=\displaystyle\int_{0}^{1}\frac{1}{t^{2}+1}dt = \displaystyle\frac{\pi}{4}$$

Then $f(x)+g(x)=\displaystyle\frac{\pi}{4}$ for all $x$.

Now $\lim_{x \to{+}\infty}{g(x)}=0$

So $$\displaystyle\frac{\pi}{4} = \lim_{x \to{+}\infty}{f(x)+g(x)}=\lim_{x \to{+}\infty}{f(x)}= \left(\int_{0}^{\infty}e^{-t^{2}}dt\right)^{2}$$


$$\int_{0}^{\infty}e^{-t^{2}}dt=\sqrt{\frac{\pi}{4}}= \frac{\sqrt{\pi}}{2}$$

The end.

share|improve this answer
Yocks. This method exploits the asymptotic behavior of exponential functions in a surprising way! –  Elias Apr 19 '14 at 11:59

It might be worth mentioning that one also can use spherical coordinates in 3-dimensions analogously to the polar coordinates Ross Millikan used above: If $I$ denotes $\int_{-\infty}^{\infty} e^{-x^2}dx$, then we have $$I^3 = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} \int_{-\infty}^{\infty}e^{-x^2 - y^2 - z^2}\,dx\,dy\,dz$$ Switching to spherical coordinates this becomes $$\int_0^{2\pi}\int_0^{\pi}\int_0^{\infty}\sin(\phi) \rho^2 e^{-\rho^2}\,d\rho\,d\phi\,d\theta$$ Doing the theta and $\phi$ integrations this becomes $$I^3 = 4\pi\int_0^{\infty}\rho^2 e^{-\rho^2}\,d\rho$$ One can then integrate parts in this, differentiating $\rho$ and integrating $\rho e^{-\rho^2}$. This leads us to $$I^3 = 2\pi \int_0^{\infty} e^{-\rho^2}\,d\rho$$ Note the right-hand side is exactly $2\pi * {I \over 2} = \pi I$. Thus $I^3 = \pi I$ and thus $I = \sqrt{\pi}$ as needed. Obviously polar coordinates are faster. Just sayin'...

share|improve this answer

An alternative derivation is to show that

$$\int_{0}^{\infty}xe^{-x^{2}y^{2}}\; \mathrm{d}y=I,$$

where $I$ is your integral:

$$I:=\int_{0}^{\infty}e^{-x^2}\; \mathrm{d}x,$$

and then evaluate $I^2$ by reversing the order of integration. If $x>0$, then

$$\int_{0}^{\infty}xe^{-x^{2}y^{2}}\; \mathrm{d}y=x\int_{0}^{\infty}e^{-{(xy)}^2}\; \mathrm{d}y=x\int_{0}^{\infty}e^{-u^2}\dfrac{\mathrm{d}u}{x}=\int_{0}^{\infty}e^{-u^2}\; \mathrm{d}u=I.$$


$$\begin{aligned}I^2&=\int_{0}^{\infty}e^{-x^2}\; \mathrm{d}x\int_{0}^{\infty}xe^{-x^{2}y^{2}}\; \mathrm{d}y=\displaystyle\int_{0}^{\infty}\mathrm{d}y\int_{0}^{\infty}xe^{-x^2}e^{-x^{2}y^{2}}\; \mathrm{d}x\\ &=\int_{0}^{\infty}\mathrm{d}y\int_{0}^{\infty}xe^{-x^{2}(1+y^2)}\; \mathrm{d}x=\int_{0}^{\infty}\mathrm{d}y\dfrac{1}{2\left( 1+y^{2}\right) }\left[ -e^{-x^{2}\left( 1+y^{2}\right) }\right] _{x=0}^{\infty }\\ &=\int_{0}^{\infty }\dfrac{1}{2\left( 1+y^{2}\right) }\; \mathrm{d}y=\dfrac{1}{2}\left[ \arctan y\right] _{y=0}^{\infty }=\dfrac{\pi}{4}.\end{aligned}$$



share|improve this answer
This proof goes back to Laplace (Théorie Analytique des Probabilités, 1812, pp. 94-96). –  KCd Apr 15 '12 at 19:20
@KCd: Thanks for the information. I saw it as an exercise in Advanced Calculus by Angus Taylor. –  Américo Tavares Apr 15 '12 at 21:10

Another proof, from G.M. Fichtengoltz, Calculus Course, page 612.

$$K=\int_{0}^{\infty} e^{-x^2} dx $$

It easy to see (and prove) that, $\max\{(1+t)e^{-t}\}=1$ at $t=0$, hence for all $t\in\mathbb{R}$:


Substitution of $t=\pm x^2$, leads us to:

$$(1-x^2)e^{x^2}<1 \ \ \ \ \text{and} \ \ \ \ \ (1+x^2)e^{-x^2}<1 $$


$${1-x^2} <e^{-x^2}<\frac{1}{1+x^2} \ \ \ \ \ \ (x>0) $$

Now, at the left inequality we restrict our $x$ to be in $(0,1)$ (so that, $1-x^2>0$), and in the right inequality let $x>0$. Raising all the inequalities with natural number $n$, we get,

$$\underset{x\in (0,1)}{(1-x^2)^n<e^{-nx^2}} \ \ \ \ \text{and} \ \ \ \ \ \underset{x>0}{e^{-nx^2}<\frac{1}{(1+x^2)^n}}$$

Integrating the first inequality from $0$ to $1$, and the second inequality from $0$ to $+\infty$ we'll get:

$$\int_0^1({1-x^2})^ndx <\int_0^1 e^{-nx^2} dx<\int_0^{\infty} e^{-nx^2} dx<\int_0^{\infty}\frac{dx}{(1+x^2)^n}$$


$$\int_0^{\infty} e^{-nx^2}dx=\frac{1}{\sqrt{n}}K \ \ \ \ \ \ (\text{substitution} \ \ u=\sqrt{nx}),$$

$$\int_0^1({1-x^2})^ndx=\int_0^{\frac{\pi}{2}}\sin^{2n+1}(v)dv=\frac{(2n)!!}{(2n+1)!!} \ \ \ (\text{substitution} \ \ x=\cos(v))$$

and, finally,

$$\int_0^{\infty}\frac{dx}{(1+x^2)^n}=\int_0^{\frac{\pi}{2}}\sin^{2n-2}(v)dv=\frac{(2n-3)!!}{(2n-2)!!}\frac{\pi}{2} \ \ \ (\text{substitution} \ \ x=\text{ctg}(v))$$

Hence, our unknown, $K$ is bound:




Now, the final step - Wallis Formula :


Then, when $n$ tends to $\infty$ in our last inequality, we get:



$$K=\frac{\sqrt{\pi}}{2} \ \ \ \ \ \text{as}\ K>0 $$

share|improve this answer
I learned this proof a while ago and I really like it (I actually answered with a link to it). –  Pedro Tamaroff Apr 4 '12 at 0:54

By using Beta and Gamma functions properties we may simply obtain that: $$\operatorname B\left(\tfrac 12,\tfrac12\right)=\frac{\left[\Gamma(\tfrac{1}{2})\right]^{2}}{\Gamma{(1)}}=\left[\Gamma(\tfrac{1}{2})\right]^{2}$$ $$\operatorname B\left(\tfrac{1}{2},\tfrac{1}{2}\right)=\frac{\pi}{\sin{\frac{\pi}{2}}}=\pi$$ In other words we have that: $$\Gamma(\tfrac{1}{2})=\sqrt{\pi}\longrightarrow \space\int\limits_0^\infty x^{\frac{-1}{2}} e^{-x} \,\mathrm dx = \sqrt{\pi}$$

By substitution $x=t^2$ we get the final result:

$$2\int\limits_0^\infty e^{-t^2} \,\mathrm dt=\sqrt{\pi} \longrightarrow \int\limits_0^\infty e^{-t^2} \,\mathrm dt = \frac{\sqrt{\pi}}{2}.$$

Q.E.D. (Chris)

share|improve this answer

First, we notice that $$n!\ =\ \int_0^\infty e^{-\sqrt[n]x}\ dx\quad\iff\quad\tfrac1n!\ =\ \int_0^\infty e^{-x^n}dx\quad\rightarrow\quad\tfrac12!\ =\ \int_0^\infty e^{-x^2}dx$$ Then we further notice that $$\int_0^1\Big(1-\sqrt[n]x\Big)^m\,dx\ =\ \int_0^1\Big(1-\sqrt[m]x\Big)^n\,dx\ =\ \frac1{C_{m+n}^n}\ =\ \frac1{C_{m+n}^m}\ =\ \frac{m!\,n!}{(m+n)!}$$ From where we deduce that $$\frac\pi4\ =\ \int_0^1\sqrt{1-x^2}\,dx\ =\ \frac{\Big(\frac12!\Big)^2}{\Big(\frac12 + \frac12\Big)!}\ =\ \Big(\tfrac12!\Big)^2$$ Which leads us to conclude that $$\int_0^\infty e^{-x^2}dx\ =\ \tfrac12!\ =\ \sqrt{\pi\over4}\ =\ \frac{\sqrt\pi}2$$ QED

share|improve this answer
superb proof. And a quite trick use of combinatrics –  Shivam Patel Oct 23 '13 at 5:15
@Lucian I didn't know this one. –  Olivier Oloa Aug 8 '14 at 3:20

Change variables. Let $z=x^2$. We find $\int_{0}^{\infty} e^{-x^2} dx = \frac{1}{2} \Gamma(\frac{1}{2}) = \frac{\sqrt{\pi}}{2}$.

Addendum: Setting $z=1/2$ in Euler's reflection formula, $\Gamma(1-z)\Gamma(z) = \pi/\sin \pi z$, we find $\Gamma(1/2) = \sqrt{\pi}$.

share|improve this answer
This is circular if you don't use the double argument formula of $\Gamma$ or something of the sort. –  Pedro Tamaroff Apr 4 '12 at 0:53
@PeterT.off: Of course, this is a sledgehammer and fly proof. It is still one of my favorites! I simply think of the gamma function as more fundamental than the integral. –  user26872 Apr 4 '12 at 1:46
@PeterT.off: This "trick" also works for many integrals, not just one! –  user26872 Apr 6 '12 at 0:30
can you explain how this argument is circular @Peter Tamaroff –  Elements in Space Jan 6 '13 at 15:41
$$\begin{align*} \frac{\sqrt\pi}2\operatorname{erf}(\infty)&=\int\limits_0^\infty e^{-x^2}\mathrm dx&\\ \text{let }x^2=t\\ x= t^{1/2}\\ \mathrm dx=\frac{t^{-1/2}}2\mathrm dt\\ &=\int\limits_0^\infty e^{-t}\frac{t^{-1/2}}{2}\mathrm dt\\ &=\frac12\int\limits_0^\infty t^{(1/2)-1}e^{-t}\mathrm dt\\ &=\frac12\operatorname \Gamma(1/2)\\ &=\frac{\sqrt\pi}2 \end{align*}$$ –  Elements in Space Jan 13 '13 at 3:44

Here you have a solution using Wallis' formula for $\pi$ and the squeeze theorem which I learned. It's from a post I made in a forum.


share|improve this answer

Another way is to make use of the Poisson summation formula. I will work with the Fourier transform $$\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x) \exp(-2 \pi i \xi x) dx$$ The Poisson summation formula states that $$\sum_{\xi \in \mathbb{Z}} \hat{f}(\xi) = \sum_{n \in \mathbb{Z}} f(n).$$ Now take $f(x) = \exp(-\pi x^2)$. We then get that \begin{align} \hat{f}(\xi) & = \int_{-\infty}^{\infty} \exp(- \pi x^2) \exp(-2 \pi i \xi x) dx\\ & = \int_{-\infty}^{\infty} \exp(-\pi(x+i \xi)^2 - \pi \xi^2) dx\\ & = \exp( - \pi \xi^2)\int_{-\infty}^{\infty} \exp(-\pi(x+i \xi)^2) dx\\ & = \exp( - \pi \xi^2)\int_{-\infty + ic}^{\infty+ic} \exp(-\pi x^2) dx \end{align} By integrating from $-\infty+ic$ to $\infty + ic$, I mean integrate along the line Im$(x) = c$ from left to right. Now since the integrand is analytic, we can move this contour to $X$ axis and conclude that $$\int_{-\infty + ic}^{\infty+ic} \exp(-\pi x^2) dx = \int_{-\infty}^{\infty} \exp(-\pi x^2) dx$$ Hence, we get that $$\hat{f}(\xi) = C \exp( - \pi \xi^2)$$where $C = \displaystyle \int_{-\infty}^{\infty} \exp(-\pi x^2) dx$. Now make use of the Poisson summation formula to get that $$C \left(\sum_{\xi \in \mathbb{Z}} \exp(-\pi \xi^2) \right) = \left(\sum_{x \in \mathbb{Z}} \exp(-\pi x^2) \right)$$ We can afford to cancel $\displaystyle \left(\sum_{x \in \mathbb{Z}} \exp(-\pi x^2) \right)$ since it converges and hence we can conclude that $$C = \displaystyle \int_{-\infty}^{\infty} \exp(-\pi x^2) dx = 1$$ Suitable scaling gives you the integral and answer you are looking for.

share|improve this answer

The following argument, similar to Bryan Yock's, is a Feynman parameter trick I invented in Integrating $\int^{\infty}_0 e^{-x^2}\,dx$ using Feynman's parametrization trick

Let $$I(b) = \int_0^\infty \frac {e^{-x^2}}{1+(x/b)^2} \mathrm d x = \int_0^\infty \frac{e^{-b^2y^2}}{1+y^2} b\,\mathrm dy$$ so that $I(0)=0$, $I'(0)= \pi/2$ and $I(\infty)$ is the thing we want to evaluate.

Now note that rather than differentiating directly, it's convenient to multiply by some stuff first to save ourselves some trouble. Specifically, note

$$\left(\frac 1 b e^{-b^2}I\right)' = -2b \int_0^\infty e^{-b^2(1+y^2)} \mathrm d y = -2 e^{-b^2} I(\infty)$$

Then usually at this point we would solve the differential equation for all $b$, and use the known information at the origin to infer the information at infinity. Not so easy here because the indefinite integral of $e^{-x^2}$ isn't known. But we don't actually need the solution in between; we only need to relate information at the origin and infinity. Therefore, we can connect these points by simply integrating the equation definitely; applying $\int_0^\infty \mathrm d b$ we obtain

$$-I'(0)= -2 I(\infty)^2 \quad \implies \quad I(\infty) = \frac{\sqrt \pi} 2$$

share|improve this answer

Using Normal density:

$$ \int_0^\infty e^{-x^2}dx=\sqrt \pi \int_0^\infty \frac{1}{\sqrt \pi}e^{-x^2}dx=\sqrt \pi P(X\geq0), $$

where $X\sim \mathrm{Normal}(0,\frac{1}{2})$. Remember that the normal distribution is symmetric around its mean, so $P(X>0)=P(X>E(X))=\frac{1}{2}$, and the result follows.

share|improve this answer
This one feels a bit circular to me. It relies on the fact that $\frac{1}{\sqrt{\pi}} e^{-x^2}$ is actually a valid probability density function. That in turn requires showing that $\int_{-\infty}^\infty \frac{1}{\sqrt{\pi}} e^{-x^2}dx = 1$, which is the same as the OP's question. –  Mike Spivey Nov 20 '12 at 20:20

Consider the mapping $\eta\! : \mathbb{R}^2\to \mathbb{R}$ given by $$ \eta((x,y)) = \sqrt{x^2+y^2},\quad (x,y)\in\mathbb{R}^2. $$ (1) Show that the image-measure $\lambda_2\circ\eta^{-1}$ is the measure on $(\mathbb{R},\mathcal{B}(\mathbb{R}))$ with density $$ f(z)=2\pi z 1_{(0,\infty)}(z),\quad z\in\mathbb{R}, $$ by using Dynkin's Lemma.

(2) Show that $$ \int_{\mathbb{R}^2} e^{-x^2-y^2}\,\lambda_2(\mathrm{d}x,\mathrm{d}y)=\pi $$ by using the formula for integration under measurable transformations.

(3) Use Tonelli's theorem to conclude that $$ \int_{\mathbb{R}}e^{-x^2}\,\lambda(\mathrm{d}x)=\sqrt{\pi}, $$ and now your result follows.

share|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.