The Half-Line Gaussian Integral

Probability · Easy · Free problem

Evaluate $$\int_{0}^{\infty} e^{-x^{2}/2}\,dx.$$ Give the exact value, and show a derivation that does not simply quote the answer.

Hints

  1. There is no elementary antiderivative of $e^{-x^2/2}$, so do not look for one. Either relate the integral to the standard normal density, or square it.
  2. Quick route: $\frac{1}{\sqrt{2\pi}} e^{-x^2/2}$ is a probability density, so $\int_{-\infty}^{\infty} e^{-x^2/2}\,dx = \sqrt{2\pi}$; the integrand is even.
  3. Self-contained route: let $I$ be the full-line integral. Then $I^2 = \iint e^{-(x^2 + y^2)/2}\,dx\,dy$; switch to polar coordinates, where $r\,e^{-r^2/2}$ integrates cleanly.

Worked Solution

How to Think About It: The Gaussian has no elementary antiderivative, so one-dimensional tricks fail. Two clean routes exist: recognize the normal density's normalizing constant, or square the integral and use polar coordinates so that the radial Jacobian makes the integrand integrable.

Quick Estimate: The integrand equals $1$ at $x = 0$, is about $0.61$ at $x = 1$, $0.14$ at $x = 2$, and $0.01$ at $x = 3$. A rough Simpson-style sum gives roughly $1.25$. The exact answer $\sqrt{\pi/2} \approx 1.2533$ agrees.

Formal Solution:

*Step 1 -- Square the full-line integral.* Let $I = \int_{-\infty}^{\infty} e^{-x^2/2}\,dx$. Then $$I^{2} = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} e^{-(x^2 + y^2)/2}\,dx\,dy.$$

*Step 2 -- Polar coordinates.* With $x = r\cos\theta$, $y = r\sin\theta$, $dx\,dy = r\,dr\,d\theta$: $$I^{2} = \int_{0}^{2\pi}\int_{0}^{\infty} e^{-r^2/2}\,r\,dr\,d\theta = 2\pi \int_{0}^{\infty} r e^{-r^2/2}\,dr = 2\pi\left[-e^{-r^2/2}\right]_{0}^{\infty} = 2\pi.$$ Hence $I = \sqrt{2\pi}$.

*Step 3 -- Halve by symmetry.* The integrand is even, so $$\int_{0}^{\infty} e^{-x^2/2}\,dx = \frac{I}{2} = \frac{\sqrt{2\pi}}{2} = \sqrt{\frac{\pi}{2}} \approx 1.2533.$$

*Step 4 -- Probability shortcut.* Since $\phi(x) = \frac{1}{\sqrt{2\pi}}e^{-x^2/2}$ integrates to $1$ over the real line, $\int_{-\infty}^{\infty} e^{-x^2/2}dx = \sqrt{2\pi}$ immediately, and the half-line value is $\sqrt{2\pi}\cdot P(X > 0) = \sqrt{2\pi}/2$.

Answer: $\displaystyle \int_{0}^{\infty} e^{-x^2/2}\,dx = \sqrt{\pi/2} \approx 1.253$ (the full-line integral is $\sqrt{2\pi}$).

Intuition

Squaring the Gaussian integral and going to polar coordinates works because $e^{-x^2/2} e^{-y^2/2} = e^{-r^2/2}$ depends only on the radius, and the extra factor $r$ from the Jacobian is exactly what is needed to integrate by substitution. This is the same computation that normalizes the normal density, and it is why $\sqrt{2\pi}$ appears in every Black-Scholes formula, every Gaussian likelihood, and Stirling's approximation.

Open the full interactive solver →