---
title: Double integrals in polar coordinates
heading: Integrating over circles, and the Gaussian integral
eyebrow: A9 · Lesson 17 · Polar integrals
xp: 40
---

::: hook
A laser beam's brightness falls off from its center in a bell-shaped curve. How much of its power goes through a 1 mm aperture? Wires, coax cables, lenses, antennas and photodiodes are round, and integrating over them in $x$ and $y$ is a mess of square roots. In polar coordinates the circle is simple, and one extra factor of $r$ in the area element does all the bookkeeping. The same trick evaluates $\int e^{-x^2}dx$, the integral behind every Gaussian noise calculation, which no antiderivative can.
:::

::: play
- The curve is a laser beam's intensity across its radius, $I(r) = e^{-2r^2/w^2}$, with beam radius $w$.
- The shaded part is inside an aperture of radius $a$. The readout is the fraction of the beam's total power that passes through it.
- How large must $a$ be, in multiples of $w$, to pass 99%?
:::
:::

```sim plot
view: graph
x: r = 0..3 mm
y: I = 0..1.1
slider: w = 0.5..2 step 0.1 = 1 mm
slider: a = 0.1..3 step 0.05 = 1 mm
plot: exp(-2*r^2/w^2) | label: intensity
plot: exp(-2*r^2/w^2) | fill: 0..a | color: ch2
readout: fraction of power through = 1 - exp(-2*a^2/w^2) | digits: 4
```

::: predict
## A beam's intensity is $e^{-2r^2/w^2}$. What fraction of its power passes an aperture of radius $w$?

- [ ] 50%
- [ ] 63%
- [x] 86%
- [ ] 99%

::: reveal
86%. Integrating in polar coordinates, the power inside radius $a$ is proportional to $\int_0^ae^{-2r^2/w^2}\,r\,dr$, which gives the fraction $1 - e^{-2a^2/w^2}$. At $a = w$ that's $1 - e^{-2} = 0.865$. The extra $r$ in $r\,dr$ is what makes the integral easy.
:::
:::

::: nameit
## The area element

In polar coordinates, a small patch spanning $dr$ and $d\theta$ is nearly a rectangle with sides $dr$ and $r\,d\theta$, so

$$dA = r\,dr\,d\theta$$

and

$$\iint_Rf\,dA = \int_\alpha^\beta\int_{r_1(\theta)}^{r_2(\theta)}f(r\cos\theta, r\sin\theta)\,r\,dr\,d\theta$$

Forgetting the $r$ is the most common mistake: it's the reason patches far from the center count for more.

## Round things

- Area of a disk: $\int_0^{2\pi}\int_0^Rr\,dr\,d\theta = \pi R^2$.
- If the density depends only on $r$: $\iint\sigma\,dA = \int_0^R\sigma(r)\,2\pi r\,dr$, adding up rings.
- Total power of a Gaussian beam with peak intensity $I_0$: $\int_0^\infty I_0e^{-2r^2/w^2}2\pi r\,dr = \frac{\pi w^2}{2}I_0$.

## The Gaussian integral

Let $G = \int_{-\infty}^\infty e^{-x^2}dx$. Then

$$G^2 = \int\!\!\int e^{-(x^2 + y^2)}dx\,dy = \int_0^{2\pi}\int_0^\infty e^{-r^2}r\,dr\,d\theta = 2\pi\cdot\frac{1}{2} = \pi$$

so $G = \sqrt\pi$, and more generally $\int_{-\infty}^\infty e^{-ax^2}dx = \sqrt{\pi/a}$. This sets the normalizing constant of the Gaussian density in A11 and the error function in A6.
:::

::: example
## Show that $\int_{-\infty}^{\infty}e^{-x^2}dx = \sqrt\pi$.

::: solution
1. **Square the integral.** Treat the two copies as $x$ and $y$, over the whole plane:
   $$G^2 = \iint e^{-(x^2 + y^2)}dA$$
2. **Switch to polar coordinates.** There $x^2 + y^2 = r^2$ and $dA = r\,dr\,d\theta$, and
   $$\int_0^\infty e^{-r^2}r\,dr = \frac{1}{2}$$
3. **Combine.**
   $$\begin{aligned} G^2 &= 2\pi \cdot \frac{1}{2} \\ &= \pi \end{aligned}$$
   giving $G = 1.7725$.

**Answer:** $G^2 = \pi$, so the integral is $\sqrt\pi = 1.7725$.
:::
:::

::: example
## A beam has peak intensity 2 W/cm² and radius $w$ = 1 mm. What is its total power?

::: solution
1. **Total power of the beam.** With $w = 0.1$ cm and $I_0 = 2$ W/cm²:
   $$\begin{aligned} P &= \frac{\pi w^2}{2}I_0 \\ &= \frac{\pi \times 0.1^2}{2} \times 2 \\ &= 0.0314\ \text{W} \end{aligned}$$

**Answer:** the beam carries 0.0314 W, about 31 mW.
:::
:::

::: example
## A disk of radius 5 cm carries charge density rising linearly from 0 at the center to 2 nC/m² at the rim. What is its total charge?

::: solution
1. **Density and area element.** In polar coordinates:
   $$\sigma = \sigma_R\frac rR, \quad dA = r\,dr\,d\theta$$
2. **Integrate.**
   $$\begin{aligned} Q &= \int_0^{2\pi}\int_0^R\sigma_R\frac rRr\,dr\,d\theta \\ &= 2\pi\sigma_R\frac{R^2}{3} \end{aligned}$$
3. **Put in the numbers.**
   $$\begin{aligned} Q &= \tfrac23\pi(2 \times 10^{-9})(0.05)^2 \\ &= 10.5\ \text{pC} \end{aligned}$$
4. **Compare with a uniform disk.** A uniform 2 nC/m² would give 15.7 pC; weighting toward the rim keeps two thirds of it, because the rim is where most of the area is.

**Answer:** the disk carries 10.5 pC.
:::
:::

::: check
given: a = 1 | 2; b = 3 | 5
answer: pi*(b^2 - a^2)
tolerance: 0.5%

## Use polar coordinates to find the area of the ring $\given{a} \le r \le \given{b}$.

::: right
Right. $\int_0^{2\pi}\int_a^br\,dr\,d\theta = \pi(b^2 - a^2)$ = {answer}.
:::

::: misses
- [2*pi*(b - a)] Include the factor $r$: the integral of $r\,dr$ is $\frac{r^2}{2}$.
- [pi*(b - a)^2] Subtract the areas, not the radii.
- [any] Not yet. $\int r\,dr\,d\theta$ over the ring.
:::
:::

::: check
given: s0 = 2 | 5; R = 0.1 | 0.3
answer: pi*s0*R^2/2
unit: nC
tolerance: 0.5%

## A disk of radius {R} m has charge density $\sigma = \given{s0}(1 - r^2/R^2)$ nC/m². What is its total charge, in nC?

::: right
Right. $\int_0^R\sigma_0(1 - r^2/R^2)\,2\pi r\,dr = \frac{\pi\sigma_0R^2}{2}$ = {answer}.
:::

::: misses
- [pi*s0*R^2] That's a uniform disk at $\sigma_0$. This density falls to zero at the rim.
- [any] Not yet. Add up rings of area $2\pi r\,dr$.
:::
:::

::: check
given: R = 1 | 2 | 3
answer: pi*R^4/2
tolerance: 0.5%

## Evaluate $\iint(x^2 + y^2)\,dA$ over the disk of radius {R}.

::: right
Right. $\int_0^{2\pi}\int_0^Rr^2\cdot r\,dr\,d\theta = \frac{\pi R^4}{2}$ = {answer}.
:::

::: misses
- [2*pi*R^3/3] Include the area element's $r$: the integrand is $r^3$.
- [pi*R^4/4] $\int_0^{2\pi}d\theta = 2\pi$: $2\pi \times \frac{R^4}{4}$.
- [any] Not yet. $x^2 + y^2 = r^2$ and $dA = r\,dr\,d\theta$.
:::
:::

::: check
given: k = 1 | 1.5 | 2
answer: 1 - exp(-2*k^2)
tolerance: 0.5%

## What fraction of a Gaussian beam's power passes through an aperture of radius {k} times the beam radius $w$?

::: right
Right. $1 - e^{-2a^2/w^2}$ = {answer}.
:::

::: misses
- [1 - exp(-k^2)] The beam is $e^{-2r^2/w^2}$: keep the 2.
- [exp(-2*k^2)] That's the fraction blocked.
- [any] Not yet. $\frac{\int_0^a e^{-2r^2/w^2}r\,dr}{\int_0^\infty e^{-2r^2/w^2}r\,dr}$.
:::
:::

::: check
given: I0 = 1 | 5; w = 0.5 | 2
answer: pi*(w/10)^2/2*I0*1000
unit: mW
tolerance: 0.5%

## A beam has peak intensity {I0} W/cm² and radius $w$ = {w} mm. What is its total power?

::: right
Right. $\frac{\pi w^2}{2}I_0$ with $w$ in cm: {answer}.
:::

::: misses
- [pi*(w/10)^2*I0*1000] Gaussian beams carry half of what a uniform disk of radius $w$ at the peak would.
- [any] Not yet. $P = \frac{\pi w^2}{2}I_0$.
:::
:::

::: check
given: a = 2 | 4 | 0.5
answer: sqrt(pi/a)
tolerance: 0.5%

## Evaluate $\displaystyle\int_{-\infty}^\infty e^{-\given{a}x^2}dx$.

::: right
Right. Substituting $u = \sqrt a\,x$ turns it into $\frac{1}{\sqrt a}\sqrt\pi$ = {answer}.
:::

::: misses
- [sqrt(pi)/a] The substitution brings out $\frac{1}{\sqrt a}$.
- [sqrt(pi)] That's for $a = 1$.
- [any] Not yet. Substitute $u = \sqrt a\,x$.
:::
:::

::: check
kind: parts
given: R = 2 | 5; s = 1 | 3

## A disk of radius {R} cm carries charge density rising linearly from 0 at the center to {s} nC/m² at the rim.

::: part
answer: 2/3*pi*s*1e-9*(R/100)^2*1e12
unit: pC
tolerance: 0.5%

### What is its total charge?

::: misses
- [pi*s*1e-9*(R/100)^2*1e12] That's for a uniform density.
- [any] $2\pi\sigma_R\frac{R^2}{3}$.
:::
:::
:::

::: check
kind: derivation
vars: P = 0.1..5, w = 0.1..3

## A Gaussian beam has intensity $I_0e^{-2r^2/w^2}$.

::: step
answer: pi*w^2/2

### What is $\int_0^{2\pi}\int_0^\infty e^{-2r^2/w^2}r\,dr\,d\theta$?
:::

::: step
answer: 2*P/(pi*w^2)

### For total power $P$, what is the peak intensity $I_0$?
:::

::: right
Right. $I_0 = \frac{2P}{\pi w^2}$: twice what spreading $P$ uniformly over $\pi w^2$ would give.
:::
:::

::: explain
## Why does the polar area element have an extra factor of $r$?

::: model
A small patch between radii $r$ and $r + dr$ and angles $\theta$ and $\theta + d\theta$ is nearly a rectangle. Its radial side is $dr$, but its other side is an arc of length $r\,d\theta$, because an angle $d\theta$ sweeps out more distance the farther you are from the center. So its area is $r\,dr\,d\theta$. Without the $r$, you'd count patches near the center as large as those near the rim, and a disk's area would come out as $2\pi R$ instead of $\pi R^2$.
:::
:::

::: practice

::: check
given: R = 3..20 int
answer: pi*R^2
tolerance: 0.5%

## Use $\int_0^{2\pi}\int_0^Rr\,dr\,d\theta$ to find the area of a disk of radius {R}.

::: misses
- [2*pi*R] Include the $r$: $\int_0^Rr\,dr = R^2/2$.
- [any] $\pi R^2$.
:::
:::

::: check
given: a = 1..9 int
answer: pi/a
tolerance: 0.5%

## Evaluate $\iint e^{-\given{a}(x^2 + y^2)}dA$ over the whole plane.

::: misses
- [sqrt(pi/a)] That's the one-dimensional integral; this is its square.
- [any] $2\pi\int_0^\infty e^{-ar^2}r\,dr$.
:::
:::

::: check
given: s0 = 1 | 4; R = 2 | 3
answer: 2*pi*s0*R^3/3
tolerance: 0.5%

## A disk of radius {R} has density $\sigma = \given{s0}r$. What is its total charge?

::: misses
- [pi*s0*R^3] Integrate $\sigma_0r \cdot 2\pi r\,dr$.
- [any] $\int_0^R\sigma_0r\cdot2\pi r\,dr$.
:::
:::
:::
