Double Integrals in Polar Coordinates
Disks, rings, sectors and petals are awkward in and but trivial in polar coordinates. The price of switching is one extra factor: the area element becomes . This lesson derives that factor from the geometry of a polar rectangle, applies it to volumes and areas, and uses it for the most famous trick in probability, the evaluation of , which also powers the Box–Muller method for generating normal random numbers.
The survey course introduces double and triple integrals in Double and Triple Integrals.
Polar coordinates themselves are covered in Polar Coordinates and Areas and Lengths in Polar Coordinates.
Polar rectangles and the area element
Recall , , . A polar rectangle is
a piece of a ring between two radii and two angles. Divide into pieces of width and into pieces of width . A small polar rectangle between radii , and angles , is the difference of two circular sectors:
where is the middle radius. This is exact, not an approximation: the piece is approximately a rectangle with sides (radial) and (an arc), and its area is precisely their product. Pieces far from the origin are bigger than pieces near it, which is what the factor records.
A Riemann sum using the centres is therefore , a Riemann sum for a function of . Taking the limit:
Note: Forgetting the is the most common mistake. A quick check: the area of a disk of radius is . Without the you would get , the circumference.
The same formula is a special case of the change of variables theorem: is the Jacobian determinant of the map .
General polar regions
For a region :
With and this gives the familiar area formula .
Volume under a paraboloid. The solid above the -plane and below sits over the disk :
One petal of a rose. The curve has a petal for :
import sympy as sp
r, th = sp.symbols("r theta", nonnegative=True)
print("disk area :", sp.integrate(r, (r, 0, 3), (th, 0, 2 * sp.pi)))
print("paraboloid vol :", sp.integrate((4 - r**2) * r, (r, 0, 2), (th, 0, 2 * sp.pi)))
print("rose petal area:", sp.integrate(r, (r, 0, sp.cos(2 * th)), (th, -sp.pi / 4, sp.pi / 4)))
# a Cartesian integrand: ∬ over the ring 1 ≤ r ≤ 2 of x²/(x² + y²)
x, y = sp.symbols("x y")
f = x**2 / (x**2 + y**2)
polar = sp.simplify(f.subs({x: r * sp.cos(th), y: r * sp.sin(th)}))
print("integrand in polar:", polar, "->", sp.integrate(polar * r, (r, 1, 2), (th, 0, 2 * sp.pi)))disk area : 9*pi
paraboloid vol : 8*pi
rose petal area: pi/8
integrand in polar: cos(theta)**2 -> 3*pi/2
The Gaussian integral
The function has no elementary antiderivative, yet
Proof. Square and write the product of two integrals as a double integral over the whole plane (Fubini for a positive separable integrand):
The factor is exactly what makes the inner integral elementary (substitute ). Since , . (Rigorously, integrate over disks and squares of growing size; both are squeezed to the same limit.)
Consequence. Rescaling gives , so the normal distribution density integrates to 1. The mysterious in every Gaussian formula comes from this polar computation.
In software: Box–Muller
The same idea runs backwards to generate normal random numbers. Two independent standard normals have joint density . In polar form, the angle is uniform on , and the radius satisfies . Inverting that survival function: if is uniform on , then has the right distribution. Hence the Box–Muller transform:
import numpy as np
rng = np.random.default_rng(2024)
n = 200_000
u1 = 1.0 - rng.random(n) # in (0, 1], avoids log(0)
u2 = rng.random(n)
R, T = np.sqrt(-2 * np.log(u1)), 2 * np.pi * u2
X, Y = R * np.cos(T), R * np.sin(T)
print("mean, std of X :", round(float(X.mean()), 4), round(float(X.std()), 4))
print("mean, std of Y :", round(float(Y.mean()), 4), round(float(Y.std()), 4))
print("corr(X, Y) :", round(float(np.corrcoef(X, Y)[0, 1]), 4))
print("P(|X| < 1) :", round(float(np.mean(np.abs(X) < 1)), 4), " (theory 0.6827)")mean, std of X : -0.002 0.9995
mean, std of Y : 0.0036 0.9973
corr(X, Y) : -0.0022
P(|X| < 1) : 0.6823 (theory 0.6827)
Other places polar integration appears:
- Radially symmetric kernels. Gaussian blurs, radial basis functions and light falloff are functions of only, so their normalising constants are one-dimensional integrals .
- Sampling a disk uniformly (depth-of-field lens samples, scattering points in a circle): choose uniform and , not . The factor in says that a uniform would crowd points into the centre.
- Antenna and sensor coverage, radar sectors and circular hit zones in games are polar rectangles.
Exercises
Exercise 1: A power of the radius
Evaluate over the disk .
Answer
.
Solution
Exercise 2: Half a ring
Evaluate where is the part of the ring with .
Answer
.
Solution
Exercise 3: Cardioid area
Find the area enclosed by the cardioid .
Answer
.
Solution
Exercise 4: A drilled sphere (code)
A cylinder of radius 1 is drilled through the centre of a ball of radius 2. Find the volume of the material removed (inside both the ball and the cylinder) in polar coordinates, and check it with scipy.integrate.dblquad.
Answer
.
Solution
Above and below the disk the ball reaches :
import math
from scipy import integrate
val, _ = integrate.dblquad(lambda r, t: 2 * math.sqrt(4 - r * r) * r, 0, 2 * math.pi, 0, 1)
print(round(val, 4), round(4 * math.pi / 3 * (8 - 3 * math.sqrt(3)), 4))11.7447 11.7447
Test yourself
In polar coordinates, equals…
Which integral gives the area of the disk of radius 5?
Why does switching to polar coordinates make computable?
- Because is a polynomial
- The factor from makes elementary
- Because disappears from the limits
- It does not; the value is only numerical