Unit 7, chapter 28

Square the question, reveal a circle

Why the Gaussian integral of e to the minus x squared over the whole real line equals the square root of pi, found by squaring the integral, reading it as an improper double integral and using polar coordinates.

  • Chapter 28
  • The Gaussian integral, parameter differentiation and contour integration

The function e−x2e^{-x^2} has no antiderivative built from elementary functions, which is why its integral from 00 to 11 is found numerically, as about 0.74680.7468. The area under the whole curve, from −∞-\infty to ∞\infty, is a different question, and it has an exact answer. This page multiplies the integral by a copy of itself in a second variable, reads the product as the volume under a round surface over the whole plane and evaluates that volume in polar coordinates. The result is π\sqrt{\pi}, and each step comes with the condition that makes it valid.

Key terms

Gaussian integral

Definition The Gaussian integral is the improper integral of e−x2e^{-x^2} over the whole real line,

I=∫−∞∞e−x2 dx.I = \int_{-\infty}^{\infty} e^{-x^2}\,dx.

Both ends are infinite, so it means the sum of two limits,

I=lim⁡a→−∞∫a0e−x2 dx+lim⁡b→∞∫0be−x2 dx,\begin{aligned} I &= \lim_{a \to -\infty} \int_a^0 e^{-x^2}\,dx \\[0.4em] &\quad + \lim_{b \to \infty} \int_0^b e^{-x^2}\,dx, \end{aligned}

and it converges when both limits exist as finite numbers. They do, and I=π≈1.7725I = \sqrt{\pi} \approx 1.7725. More generally, for every constant c>0c > 0 the substitution u=c xu = \sqrt{c}\,x gives

∫−∞∞e−cx2 dx=πc.\int_{-\infty}^{\infty} e^{-c x^2}\,dx = \sqrt{\frac{\pi}{c}}.

In plain words The two tails of the bell curve never reach zero, but they thin out so quickly that the total area is finite. Since e−x2e^{-x^2} has no elementary antiderivative, the exact value cannot come from evaluating a formula for an antiderivative at the ends. It comes from a detour through two dimensions, described in the next cards.

Example Finiteness comes first. For ∣x∣≥1\lvert x \rvert \ge 1 we have x2≥∣x∣x^2 \ge \lvert x \rvert, so

e−x2≤e−∣x∣(∣x∣≥1).e^{-x^2} \le e^{-\lvert x \rvert} \qquad (\lvert x \rvert \ge 1).

Each exponential tail has finite area, because ∫1be−x dx=e−1−e−b\int_1^b e^{-x}\,dx = e^{-1} - e^{-b} tends to 1/e1/e as b→∞b \to \infty, and on [−1,1][-1, 1] the integrand is at most 11. So 0<I≤2+2/e≈2.740 < I \le 2 + 2/e \approx 2.74, and the value π≈1.7725\sqrt{\pi} \approx 1.7725 fits. The integrand is even, so the half-line integral is

∫0∞e−x2 dx=π2,\int_0^{\infty} e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2},

about 0.88620.8862. It exceeds ∫01e−x2 dx≈0.7468\int_0^1 e^{-x^2}\,dx \approx 0.7468 by the area of the tail beyond 11, about 0.13940.1394.

Squaring the integral

Definition Squaring the integral is a method for a convergent integral II of a nonnegative function. Write I2I^2 as the product of two copies of II with different integration variables, read the product as a double integral, evaluate the double integral in coordinates that fit its integrand, and recover II from I2I^2. The method treats II as a finite number, so convergence is checked before squaring, and it uses I≥0I \ge 0 to choose the nonnegative square root.

In plain words A single copy of the Gaussian has no factor that a substitution could use. Two copies in independent variables multiply to e−(x2+y2)e^{-(x^2+y^2)}, a height that depends only on the distance from the origin, and circular symmetry is what polar coordinates handle well. Squaring loses the sign, and the sign of the original integral restores it.

Example For the Gaussian integral, the product of the two copies is a double integral over the plane,

I2=∬R2e−(x2+y2) dA,I^2 = \iint_{\mathbb{R}^2} e^{-(x^2+y^2)}\,dA,

and in polar coordinates, with dA=r dr dθdA = r\,dr\,d\theta, it becomes

I2=∫02π∫0∞e−r2 r dr dθ=2π∫0∞re−r2 dr.\begin{aligned} I^2 &= \int_0^{2\pi} \int_0^{\infty} e^{-r^2}\, r\,dr\,d\theta \\[0.4em] &= 2\pi \int_0^{\infty} r e^{-r^2}\,dr. \end{aligned}

The substitution u=r2u = r^2, with du=2r drdu = 2r\,dr, evaluates the radial integral as a limit,

∫0bre−r2 dr=12∫0b2e−u du=1−e−b22,\begin{aligned} \int_0^{b} r e^{-r^2}\,dr &= \frac{1}{2} \int_0^{b^2} e^{-u}\,du \\[0.4em] &= \frac{1 - e^{-b^2}}{2}, \end{aligned}

which tends to 12\tfrac12 as b→∞b \to \infty. So I2=2π⋅12=πI^2 = 2\pi \cdot \tfrac12 = \pi. Both π\sqrt{\pi} and −π-\sqrt{\pi} square to π\pi, and the Gaussian integral adds positive heights, so I>0I > 0 and

∫−∞∞e−x2 dx=π.\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}.

Product of independent integrals

Definition Let ff be continuous and nonnegative on an interval JJ, and gg continuous and nonnegative on an interval KK, where either interval may be unbounded and both integrals converge. Then the product of the two integrals is a double integral over the rectangle J×KJ \times K,

∫Jf(x) dx∫Kg(y) dy=∬J×Kf(x) g(y) dA.\begin{aligned} &\int_J f(x)\,dx \int_K g(y)\,dy \\[0.4em] &\qquad = \iint_{J \times K} f(x)\, g(y)\,dA. \end{aligned}

The same holds for functions that change sign when ∫J∣f(x)∣ dx\int_J \lvert f(x) \rvert\,dx and ∫K∣g(y)∣ dy\int_K \lvert g(y) \rvert\,dy are finite. The two variables must be different. The product is in general not ∫Jf(x) g(x) dx\int_J f(x)\, g(x)\,dx, which pairs the two factors at the same point.

In plain words In the double integral, xx and yy vary independently over the whole rectangle. For each fixed xx, the inner integral over yy is the constant ∫Kg(y) dy\int_K g(y)\,dy, which comes out as a factor and leaves the product. The result is a volume under a surface over the plane, not an area under the single curve f(x) g(x)f(x)\,g(x).

Example The integrals of xx over [0,1][0, 1] and of y2y^2 over [0,2][0, 2] are 12\tfrac12 and 83\tfrac83, and their product is

∫01∫02xy2 dy dx=43,\int_0^1 \int_0^2 x y^2\,dy\,dx = \frac{4}{3},

while the integral of the pointwise product x⋅x2x \cdot x^2 over [0,1][0, 1] is only 14\tfrac14. For the Gaussian the same mistake gives

∫−∞∞e−2x2 dx=π2,\int_{-\infty}^{\infty} e^{-2x^2}\,dx = \sqrt{\frac{\pi}{2}},

about 1.25331.2533, which is not I2=π≈3.1416I^2 = \pi \approx 3.1416.

Improper double integral

Definition Let ff be continuous and nonnegative on the plane. Take bounded regions D1⊆D2⊆D3⊆⋯D_1 \subseteq D_2 \subseteq D_3 \subseteq \cdots, such as disks or squares centered at the origin, so that every bounded set lies inside some DnD_n. The improper double integral of ff over the plane is

∬R2f dA=lim⁡n→∞∬Dnf dA.\iint_{\mathbb{R}^2} f\,dA = \lim_{n \to \infty} \iint_{D_n} f\,dA.

Because f≥0f \ge 0, the integrals over DnD_n increase with nn, so the limit exists as a number or as ∞\infty, and it is the same for every such sequence of regions. By Tonelli’s theorem, the iterated integrals in either order give this same value. When ff changes sign, the integral over the plane, and Fubini’s theorem for swapping the order, need absolute integrability, ∬R2∣f∣ dA<∞\iint_{\mathbb{R}^2} \lvert f \rvert\,dA < \infty.

In plain words Integrate over larger and larger bounded pieces of the plane and take the limit. With a nonnegative integrand nothing can cancel, so neither the shape of the pieces nor the order of integration can change the answer. With a sign-changing integrand, positive and negative parts can balance differently on disks and on squares, and the answer may then depend on the shape unless the absolute value has a finite integral.

Example Take f(x,y)=e−(x2+y2)f(x, y) = e^{-(x^2+y^2)}, the disk DρD_\rho of radius ρ\rho and the square Sn=[−n,n]×[−n,n]S_n = [-n, n] \times [-n, n]. In polar coordinates over a disk,

∬Dρf dA=π(1−e−ρ2),\iint_{D_\rho} f\,dA = \pi\left(1 - e^{-\rho^2}\right),

and over the square the double integral splits as In2I_n^2, where In=∫−nne−x2 dxI_n = \int_{-n}^{n} e^{-x^2}\,dx. The disk DnD_n fits inside SnS_n, which fits inside Dn2D_{n\sqrt{2}}, and f≥0f \ge 0, so

π(1−e−n2)≤In2≤π(1−e−2n2).\begin{aligned} &\pi\left(1 - e^{-n^2}\right) \le I_n^2 \\[0.4em] &\quad \le \pi\left(1 - e^{-2n^2}\right). \end{aligned}

Both bounds tend to π\pi, so the squares and the disks give the same limit I2=πI^2 = \pi. For n=1n = 1 the three numbers are about 1.9861.986, 2.2312.231 and 2.7162.716.

Polar coordinates on the whole plane

Definition Polar coordinates write x=rcos⁡θx = r\cos\theta and y=rsin⁡θy = r\sin\theta. The whole plane is covered by 0≤r<∞0 \le r < \infty and a full turn 0≤θ≤2π0 \le \theta \le 2\pi, and the map is one-to-one from 0<r<∞0 < r < \infty, 0≤θ<2π0 \le \theta < 2\pi onto the plane without the origin. The leftover sets, the origin and the repeated ray θ=2π\theta = 2\pi, have zero area. The Jacobian determinant of (r,θ)↦(x,y)(r, \theta) \mapsto (x, y) is rr, and its absolute value gives dA=r dr dθdA = r\,dr\,d\theta. For ff continuous on the plane and either nonnegative or absolutely integrable, and with g(r,θ)=f(rcos⁡θ,rsin⁡θ)g(r, \theta) = f(r\cos\theta, r\sin\theta),

∬R2f(x,y) dA=∫02π∫0∞g(r,θ) r dr dθ.\begin{aligned} &\iint_{\mathbb{R}^2} f(x, y)\,dA \\[0.4em] &= \int_0^{2\pi} \int_0^{\infty} g(r, \theta)\, r\,dr\,d\theta. \end{aligned}

When f(x,y)=h(x2+y2)f(x, y) = h(x^2 + y^2) depends only on the distance from the origin, the angular integral is the factor 2π2\pi, and

∬R2f dA=2π∫0∞h(r2) r dr.\begin{aligned} &\iint_{\mathbb{R}^2} f\,dA \\[0.4em] &= 2\pi \int_0^{\infty} h(r^2)\, r\,dr. \end{aligned}

In plain words Polar coordinates cut the plane into thin rings. The ring between radii rr and r+drr + dr has circumference 2πr2\pi r and width drdr, so its area is about 2πr dr2\pi r\,dr. That factor rr is the one the one-variable Gaussian lacked, since the substitution u=x2u = x^2 needs du=2x dxdu = 2x\,dx and the integrand e−x2e^{-x^2} has no factor xx. Covering the whole plane means every radius from 00 to ∞\infty and a full turn of angles, not a quadrant or a disk.

Example Over the whole plane,

∬R2dA(1+x2+y2)2=2π∫0∞r dr(1+r2)2=π,\begin{aligned} &\iint_{\mathbb{R}^2} \frac{dA}{(1 + x^2 + y^2)^2} \\[0.4em] &= 2\pi \int_0^{\infty} \frac{r\,dr}{(1 + r^2)^2} = \pi, \end{aligned}

because ∫0br (1+r2)−2 dr=12−12(1+b2)\int_0^b r\,(1 + r^2)^{-2}\,dr = \tfrac12 - \tfrac{1}{2(1 + b^2)} tends to 12\tfrac12 as b→∞b \to \infty. Leaving out the factor rr would give 2π∫0∞(1+r2)−2 dr=2π⋅π4=π22≈4.932\pi \int_0^{\infty} (1 + r^2)^{-2}\,dr = 2\pi \cdot \tfrac{\pi}{4} = \tfrac{\pi^2}{2} \approx 4.93, a different and wrong number.

Check yourself

  1. Use squaring the integral to evaluate ∫−∞∞e−x2/2 dx\int_{-\infty}^{\infty} e^{-x^2/2}\,dx.
Show the answer

Call the integral JJ. It converges by the same comparison as the Gaussian, since x2/2≥∣x∣x^2/2 \ge \lvert x \rvert for ∣x∣≥2\lvert x \rvert \ge 2, and it is positive. Two copies in xx and yy give

J2=∬R2e−(x2+y2)/2 dA=2π∫0∞re−r2/2 dr.\begin{aligned} J^2 &= \iint_{\mathbb{R}^2} e^{-(x^2+y^2)/2}\,dA \\[0.4em] &= 2\pi \int_0^{\infty} r e^{-r^2/2}\,dr. \end{aligned}

With u=r2/2u = r^2/2 and du=r drdu = r\,dr, the radial integral up to bb is 1−e−b2/21 - e^{-b^2/2}, which tends to 11 as b→∞b \to \infty. So J2=2πJ^2 = 2\pi, and since J>0J > 0,

∫−∞∞e−x2/2 dx=2π,\int_{-\infty}^{\infty} e^{-x^2/2}\,dx = \sqrt{2\pi},

about 2.50662.5066. This is the constant that makes the standard normal density e−x2/2/2πe^{-x^2/2}/\sqrt{2\pi} have total area 11.

  1. Find ∫0∞e−x2 dx\int_0^{\infty} e^{-x^2}\,dx by squaring it directly, without using the value of the full Gaussian integral. Which angles does the polar integral use?
Show the answer

Call the integral KK, which is positive and finite. Its square is the integral of e−(x2+y2)e^{-(x^2+y^2)} over the first quadrant x≥0x \ge 0, y≥0y \ge 0, not over the whole plane. In polar coordinates that quadrant is 0≤r<∞0 \le r < \infty with 0≤θ≤π/20 \le \theta \le \pi/2, so

K2=π2∫0∞re−r2 dr=π4.K^2 = \frac{\pi}{2} \int_0^{\infty} r e^{-r^2}\,dr = \frac{\pi}{4}.

Since K>0K > 0, it follows that K=π/2≈0.8862K = \sqrt{\pi}/2 \approx 0.8862, half of the Gaussian integral, as symmetry predicts. Using a full turn 0≤θ≤2π0 \le \theta \le 2\pi here would give K2=πK^2 = \pi, four times too large.

  1. Let f(x,y)=sin⁡(x2+y2)f(x, y) = \sin(x^2 + y^2). Compute the integral of ff over the disk DρD_\rho of radius ρ\rho centered at the origin. Does ff have an integral over the whole plane in the sense of this page?
Show the answer

In polar coordinates, with u=r2u = r^2,

∬Dρf dA=2π∫0ρrsin⁡(r2) dr=π(1−cos⁡ρ2).\begin{aligned} &\iint_{D_\rho} f\,dA \\[0.4em] &= 2\pi \int_0^{\rho} r \sin(r^2)\,dr \\[0.4em] &= \pi\left(1 - \cos \rho^2\right). \end{aligned}

As ρ→∞\rho \to \infty this keeps oscillating between 00 and 2π2\pi, so the disks give no limit. The squares [−n,n]×[−n,n][-n, n] \times [-n, n] do give a limit, π\pi, which follows from the Fresnel integrals, so the answer depends on the shape of the regions. The method of this page does not apply, because ff changes sign and is not absolutely integrable. The integral of ∣f∣\lvert f \rvert over DρD_\rho is π∫0ρ2∣sin⁡u∣ du\pi \int_0^{\rho^2} \lvert \sin u \rvert\,du, which equals 2πk2\pi k when ρ2=kπ\rho^2 = k\pi and so grows without bound. The function has no integral over the whole plane.

How this lesson connects