A point of the plane can be given by its distance r from the origin and its angle θ from the positive x-axis. The point at angle θ on the unit circle is (cosθ,sinθ) (lesson 1.7.1), so the point at distance r is r times it.
Rule: Polar coordinates
x=rcosθ,y=rsinθr=x2+y2
r≥0 is a distance; θ is in radians. The angle is found with math.atan2(y, x) (practice set 1.7.4), which looks at the signs of both coordinates. These are the modulus and argument of x+iy (lesson 1.7.3).
The point (1,1) has r=2≈1.414214 and θ=4π. The point (−1,1) has the same r but θ=43π≈2.356194, in the second quarter of the plane. The point (0,−2) has r=2 and θ=−2π; adding 2π gives the same point.
Two cases need care. Adding 2π to θ does not move the point, so a full turn is θ from 0 to 2π or from −π to π, not both. And the origin has r=0 and no angle.
Try it
math.hypot(x, y) is x2+y2. The loop prints r, θ and θ in degrees for the three points above.
The last line goes back: rcosθ and rsinθ rebuild (−1,1).
⌘/Ctrl + Enter runs the cell
The polar cell: dA=rdrdθ
Polar coordinates are a map from the (r,θ) plane to the (x,y) plane, as in lesson 4.7.2. A small rectangle in (r,θ), from r to r+dr and from θ to θ+dθ, lands on a piece of a ring.
That piece has two straight sides of length dr along the rays. Its other two sides are arcs, and an arc of angle dθ on a circle of radius r has length rdθ (lesson 1.7.1). So its area is about rdrdθ: the further out, the bigger the cell.
Equal cells in the (r,θ) plane land on pieces of rings. The cell from r=2.5 to 3 has 2.2 times the area of the cell from r=1 to 1.5. That is the ratio of their middle radii, 2.75 and 1.25.
The exact area of the piece of ring is the difference of two sectors, 21((r+dr)2−r2)dθ=(r+2dr)drdθ. Divided by the cell's area in (r,θ), drdθ, it tends to r as the cell shrinks:
dr=dθ
0.1
0.01
0.001
area ratio at r=2
2.05
2.005
2.0005
area ratio at r=0.5
0.55
0.505
0.5005
The Jacobian of lesson 4.7.2 gives the same scale. With x=rcosθ and y=rsinθ,
J=(cosθsinθ−rsinθrcosθ)detJ=rcos2θ+rsin2θ=r
by the identity cos2θ+sin2θ=1 of lesson 1.7.1.
Rule: Integrals in polar coordinates
dA=rdrdθ∬RfdA=∬f(rcosθ,rsinθ)rdrdθ
The extra r is the area scale detJ. The limits describe R in r and θ, with θ covering the region once.
Try it
SymPy builds the Jacobian and simplifies its determinant to r.
The loop prints the exact area of a small piece of ring, divided by drdθ, at r=2 and r=0.5.
⌘/Ctrl + Enter runs the cell
Discs, rings and wedges
A disc of radius a about the origin is the polar rectangle 0≤r≤a, 0≤θ≤2π. Its area comes out as it should:
∫02π∫0ardrdθ=2π⋅2a2=πa2
A ring 1≤r≤2 has area 2π⋅24−1=3π≈9.424778. For a function of x2+y2, polar coordinates turn it into a function of r alone. Over the unit disc,
∬(x2+y2)dA=∫02π∫01r2⋅rdrdθ=2π⋅41=2π
That is about 1.570796. Without the factor r the answer would be 32π, which is wrong.
A wedge uses part of a turn. The right half of the disc of radius 2, where x≥0, is −2π≤θ≤2π.
There ∬xdA=∫−π/2π/2cosθdθ⋅∫02r2dr=2⋅38=316, a product as in lesson 4.7.1. Over the whole disc the two halves cancel and ∬xdA=0.
When polar coordinates do not help
Polar coordinates suit discs, rings and wedges centred at the origin, and functions of x2+y2. They make other regions harder.
In the square [0,1]×[0,1], r runs out to the edge x=1, which is r=cosθ1 for θ≤4π. Beyond that it runs out to y=1, so there are two pieces with awkward limits. For a square, keep x and y.
Try it
SymPy computes the disc and the ring, then x2+y2 over the unit disc with and without the factor r. The third line integrates x over the half disc and the whole disc.
dblquad checks 2π twice: in x and y, with y from −1−x2 to 1−x2, and in polar coordinates.
⌘/Ctrl + Enter runs the cell
Where the Gaussian integral comes from
Lesson 2.6.3 stated ∫−∞∞e−x2dx=π without proof. The curve e−x2 has no antiderivative made of familiar functions, so the fundamental theorem cannot find this area. A double integral can.
Call the area I. The idea is to work out I2 instead: as a double integral over the whole plane, it can be done in polar coordinates.
1
I2=∫−∞∞e−x2dx⋅∫−∞∞e−y2dy
2
I2=∬R2e−(x2+y2)dA
3
I2=∫02π∫0∞e−r2rdrdθ
4
∫0∞re−r2dr=[−21e−r2]0∞=21
5
I2=2π⋅21=π,I=π
The factor r from the polar cell is what makes it work. In one variable e−x2 has no antiderivative; in two, the area element brings in the r that re−r2 needs.
Rule: The Gaussian integral
∬R2e−(x2+y2)dA=π∫−∞∞e−x2dx=π
The double integral is π by polar coordinates, and it is the square of the single integral. Every integral here is improper (lesson 2.6.3); making each step exact over the whole plane is a job for the Proof Gym.
Checking it with numbers
Over a disc of radius b, the same steps give π(1−e−b2). Over the square [−b,b]×[−b,b], the product rule gives (∫−bbe−x2dx)2: the square of lesson 2.6.3's table. At b=1 that is 1.4936482=2.230985.
The square contains the disc of radius b and lies inside the disc of radius 2b, which passes through its corners. The integrand is positive, so the square's volume is squeezed between the two discs' volumes.
The volume under e−(x2+y2) over the square [−b,b]2 stays between its volumes over the two discs. As b grows, all three close in on π.
b
1
2
3
4
disc of radius b
1.985865
3.084052
3.141205
3.141592
square [−b,b]2
2.230985
3.11227
3.141454
3.141593
disc of radius 2b
2.716424
3.140539
3.141593
3.141593
All three settle on π≈3.141593, so I2=π, and I=π≈1.772454, the number lesson 2.6.3 found numerically.
Try it
Each line prints b and the three volumes: the disc formula, the square of quad's one-dimensional integral, and the larger disc.
The last lines take the whole plane: SymPy gives pi, and so does dblquad with infinite limits, up to rounding.
⌘/Ctrl + Enter runs the cell
The bell in two dimensions
The same steps work for e−(x2+y2)/2. In polar coordinates the inner integral is ∫0∞re−r2/2dr=1, so
∬R2e−(x2+y2)/2dA=2π
Its square root, 2π≈2.506628, is ∫−∞∞e−x2/2dx, the number lesson 2.6.3 found by substitution. Dividing by 2π gives the surface φ(x)φ(y)=2π1e−(x2+y2)/2, with φ the standard normal density, and it has volume 1. Case study 4.7.5 reads that surface as the joint density of two independent normal returns.
Try it
SymPy finds the volume under e−(x2+y2)/2 in polar coordinates, then ∫e−x2/2dx squared.
The last line integrates φ(x)φ(y) over the plane with dblquad.
⌘/Ctrl + Enter runs the cell
Common mistakes
Keep the r.dA=rdrdθ, not drdθ: ∬(x2+y2)dA over the unit disc is 2π, not 32π.
A full turn is 2π.θ from 0 to π covers only the upper half; from 0 to 4π it covers the disc twice.
A ring of radii a and b has area π(b2−a2), not π(b−a)2.
Find the angle with atan2.xy is the same for (1,1) and (−1,−1); the quadrant decides the angle (practice set 1.7.4). And r is never negative.
Use polar coordinates for round regions, centred at the origin. A square has awkward limits in r and θ.
e−x2 has no antiderivative, but re−r2 does. The Gaussian integral works only through the double integral, where the area element supplies the r.
Polar coordinates and the Gaussian integral
0 of 12 correct
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
How to type answers
Powers with ^: x^7, 2^(1/3), a^-2.
Multiply with * or by writing side by side: 3x^2, 2(x+1).
ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
Your first answer to each question is saved: it counts towards your score and brings the question back for review.
Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.
Summary card
Polar coordinates: x=rcosθ, y=rsinθ, r=x2+y2, with θ from atan2(y, x).
The area element is dA=rdrdθ: a polar cell has sides dr and rdθ, and detJ=r.
Discs, rings and wedges centred at the origin are rectangles in (r,θ): a disc has area πa2, a ring π(b2−a2).
∬R2e−(x2+y2)dA=π in polar coordinates, and it is the square of ∫−∞∞e−x2dx, which is therefore π.