18 · Coordinate Systems
Chapter 18

Coordinate Systems

We've seen previously that certain double and triple integrals are particularly challenging because their bounds contain complicated expressions like 1𝑥2, which lead to you having to do an integral of functions containing things like 1𝑥2, which leads to difficult trigonometric substitutions, or worse.

These sorts of expressions come up when integrating over circular, cylindrical, and spherical regions, because these are all described with equations like 𝑥2 +𝑦2 =1 or 𝑥2 +𝑦2 +𝑧2 =1 in 2 or 3. And this chapter is the bearer of good news: the reason these integrals look hard at first is that the Cartesian coordinates 𝑥,𝑦,𝑧 are not a good way to work with them. But, after adapting our viewpoint, all the square roots melt away and these integrals become straightforward to compute!

The reason is that Cartesian coordinates are good for describing flat objects: the surfaces where one variable is held constant describe lines or planes. Thus, integrals over rectangles and boxes are easy in Cartesian coordinates: their bounds are constants! To make integrals over circles, cylinders, and spheres easy, we need to find coordinates for which circles, cylinders, and spheres are described by constants. If we can change our perspective to work with these coordinates, we can often turn an integral with difficult bounds into a different integral with simpler bounds---but the same overall value.

Here are three useful diagnostic clues:

These are clues, not automatic rules. A coordinate change need not make every bound constant; its purpose is to align the coordinate grid with the geometry and thereby simplify the region, the integrand, or both.

We will use the same conversion routine throughout the chapter:

  1. Recognize geometry suited to the coordinate system.

  2. Convert the region and its bounds.

  3. Convert the integrand.

  4. Convert the area or volume element.

  5. Evaluate the resulting iterated integral.

In particular, every valid conversion must transform all three mathematical ingredients:

regionintegrandarea or volume element.

18.1Polar Coordinates

Polar coordinates are a means of representing the plane using distance 𝑟 from the origin, and angle 𝜃 from the 𝑥-axis.

Definition 18.1 (Polar Coordinates). Polar coordinates on the plane are the coordinates 𝑟,𝜃 where 𝑟 measures the distance from the origin, and 𝜃 measures the angle from the 𝑥-axis. The conversion from polar to Cartesian coordinates is

𝑥=𝑟cos𝜃,𝑦=𝑟sin𝜃.

Consequently,

𝑟2=𝑥2+𝑦2.

We ordinarily use 𝑟 0. A full revolution can be described by any angular interval of length 2𝜋; the standard choice is 0 𝜃 <2𝜋.

Figure 18.1 Two numbers, but not the two you are used to: a distance from the origin and an angle from the 𝑥-axis. Turn each knob on its own and watch what it does — 𝑟 slides the point along a ray, 𝜃 carries it around a circle. Those two curves are drawn through the point, and they are the whole idea of a coordinate system: hold one coordinate and you move along a curve, hold the other and you move along the curve that crosses it. The conversion 𝑥 =𝑟cos𝜃, 𝑦 =𝑟sin𝜃 is read straight off the dashed triangle, and 𝑟2 =𝑥2 +𝑦2 is why 𝑥2 +𝑦2 is exactly the thing these coordinates make simple.

The curves 𝑟 =constant are circles centered at the origin, while the curves 𝜃 =constant are rays from the origin. These are the coordinate curves of the polar grid.

Definition 18.2 (Area in Polar Coordinates). The area element 𝑑𝐴 was expressed in Cartesian coordinates as 𝑑𝐴 =𝑑𝑥 𝑑𝑦 by drawing a small rectangle and taking length times width. The same approach succeeds in polar coordinates, where we draw a small cell using an infinitesimal angle 𝑑𝜃 and an infinitesimal change in radius 𝑑𝑟.

Here we must be careful, however, as while 𝑑𝑟 does represent one side of the cell, 𝑑𝜃 is an angle, not a side length. The corresponding side length is an arc of a circle of radius 𝑟, and since arc length is proportional to radius we see 𝑑𝑠 =𝑟 𝑑𝜃. Together this gives

𝑑𝐴=(length)(width)=(𝑟𝑑𝜃)(𝑑𝑟)=𝑟𝑑𝑟𝑑𝜃.

The next animation makes this geometric scale factor visible: the same angular width produces a longer arc farther from the origin.

Figure 18.2 A cell of the polar grid is not a little square. Two of its sides are lengths in 𝑟, but the other two are arcs, and an arc of angle Δ𝜃 at radius 𝑟 is 𝑟 Δ𝜃 long. Drag the cell outward and watch it widen while Δ𝑟 and Δ𝜃 stay exactly as they were. That is the whole content of 𝑑𝐴 =𝑟 𝑑𝑟 𝑑𝜃: the 𝑟 is a length the grid supplies, not a correction bolted on afterwards. The area works out exactly, not just approximately, when 𝑟 is taken at the middle of the cell.

For a region described by

𝛼𝜃𝛽,𝑟1(𝜃)𝑟𝑟2(𝜃),

the double integral becomes

𝑅𝑓(𝑥,𝑦)𝑑𝐴=𝛽𝛼𝑟2(𝜃)𝑟1(𝜃)𝑓(𝑟cos𝜃,𝑟sin𝜃)𝑟𝑑𝑟𝑑𝜃.

Polar coordinates do not promise constant bounds. The radial bounds may be functions of 𝜃, just as Cartesian bounds may be functions of 𝑥 or 𝑦.

Figure 18.3 Converting the region is the first of the three things a change of coordinates has to do. On the left the region is swept out by rays; on the right the very same region is drawn against 𝜃 and 𝑟, which is what the bounds describe. A disc, an annulus, and a sector are all rectangles over there — that is the whole reason to bother. But a cardioid is not, and neither is a petal: the outer bound is a function of 𝜃, exactly as an inner bound in Cartesian coordinates is a function of 𝑥. Polar coordinates make the geometry line up with the grid; they do not promise constant limits.

Just like in Cartesian coordinates, you can view this as slicing in the 𝑟 and 𝜃 directions and integrating the results.

Figure 18.4 Slicing again, the way it was done for a rectangle — but cut at constant 𝑟 and the knife is a cylinder, so the face it exposes is a curtain standing on a circle. The area of that curtain is the slice, and the 𝑟 in 𝐵(𝑟) =2𝜋0𝑓 𝑟 𝑑𝜃 is not an adjustment: it is the radius that makes the circle 2𝜋𝑟 long, so a curtain further out has more circle to stand on. Sweep outward and the areas accumulate into the whole integral. Take 𝑓 =1 and the slice is exactly the circumference 2𝜋𝑟 — adding up circumferences from the middle out gives 𝜋𝑅2, which is where the area of a disc comes from in the first place.

Starting from an integral with Cartesian coordinates 𝑥,𝑦, there is a straightforward procedure to convert to polar:

  • Rewrite the bounds of integration in terms of 𝑟 and 𝜃.

  • Convert the function by substituting 𝑥 =𝑟cos𝜃 and 𝑦 =𝑟sin𝜃 and simplifying; remember that 𝑥2 +𝑦2 =𝑟2.

  • Replace 𝑑𝐴 or 𝑑𝑥 𝑑𝑦 with the polar area element 𝑟 𝑑𝑟 𝑑𝜃.

Now you just have a standard iterated integral, but with variables named 𝑟 and 𝜃 instead of 𝑥 and 𝑦. This can be computed as normal: just doing one integral at a time.

Example 18.3 (A Radial Integral over the Unit Disc). Let 𝐷 be the region inside the unit circle in the plane. Compute the integral

𝐷(𝑥2+𝑦2)𝑑𝐴.

With the bounds being the unit circle, if we slice the integral using Cartesian coordinates we will get

111𝑥21𝑥2(𝑥2+𝑦2)𝑑𝑦𝑑𝑥.

This turns out to be a challenging integral to do, so instead we decide to try polar coordinates. Converting the bounds first shows this is a good idea: for the unit circle we have

0𝑟1,0𝜃2𝜋.

The bounds are constant! Converting the function,

𝑥2+𝑦2=(𝑟cos𝜃)2+(𝑟sin𝜃)2=𝑟2.

So our integral becomes

𝐷(𝑥2+𝑦2)𝑑𝐴=2𝜋010𝑟2𝑟𝑑𝑟𝑑𝜃.

This is easily evaluated:

10𝑟3𝑑𝑟=𝑟4410=14,

and then

2𝜋014𝑑𝜃=2𝜋4=𝜋2.

The redesigned comparison below places the Cartesian and polar setups side by side. The integral is the same; only the grid used to describe it has changed.

Figure 18.5 One region, one integral, four ways of cutting it — two in each coordinate system, so the comparison is between the systems and not between one arbitrary choice each. In 𝑥 and 𝑦 it makes no difference which way you slice: every strip ends on the circle, so the bounds are ±1𝑥2 or ±1𝑦2 and that square root is going to be in everything that follows. In 𝑟 and 𝜃 it makes no difference either, and for the opposite reason: rays all run from 0 to 1, circles all run right around, and the bounds are constants whichever is on the outside. The integrand 𝑥2 +𝑦2 becomes 𝑟2, the 𝑟 from 𝑑𝐴 turns the inner integral into 10𝑟3 𝑑𝑟, and the whole thing is four lines. The difficulty was never the order. It was the coordinates.

18.1.1Optional Reminder: Trigonometric Integrals

In general there may be sines and cosines in the resulting integral, which will require us to remember techniques for trigonometric integrals from Calculus II. Half-angle identities are useful for even powers such as

cos2𝜃=1+cos2𝜃2,sin2𝜃=1cos2𝜃2.

For example,

sin2𝜃𝑑𝜃=12(𝜃12sin2𝜃)+𝐶.

When an integral contains an odd power of sine or cosine, it is often useful to save one factor and convert the remaining even power using sin2𝜃 +cos2𝜃 =1. This sets up a 𝑢-substitution. For example,

cos5𝜃𝑑𝜃=(1sin2𝜃)2cos𝜃𝑑𝜃=sin𝜃23sin3𝜃+15sin5𝜃+𝐶.

18.1.2Integrating the Gaussian

Polar coordinates also evaluate the famous Gaussian integral. This is not merely a clever example: the Gaussian is one of the central functions of probability, statistics, physics, and data science.

Let

𝐼=𝑒𝑥2𝑑𝑥.

The graph is the familiar bell curve. The integral 𝐼 is its total area, but 𝑒𝑥2 has no elementary antiderivative, so the ordinary tools of single-variable calculus do not evaluate it directly.

Figure 18.6 The one-dimensional Gaussian, with its area gathered symmetrically from the origin outward. The curve drops extraordinarily quickly, so by the time the moving endpoints reach ±3 nearly all of the infinite area has already been captured. The number approaches 𝜋, but nothing in this one-dimensional picture explains why. That explanation begins by making a second copy of the same integral.

Because the variables are independent, we can multiply two copies and use Fubini's theorem:

𝐼2=(𝑒𝑥2𝑑𝑥)(𝑒𝑦2𝑑𝑦)=2𝑒(𝑥2+𝑦2)𝑑𝐴.

The square of an unknown area has become the volume under a two-dimensional Gaussian.

Figure 18.7 Multiplying the Gaussian by a copy of itself produces this bell surface: 𝑒𝑥2𝑒𝑦2 =𝑒(𝑥2+𝑦2). Every horizontal direction through the peak looks like the original bell curve, and every circle centered at the origin has one constant height. The surface is rotationally symmetric because its formula depends on 𝑥 and 𝑦 only through 𝑥2 +𝑦2. That is the signal to use polar coordinates.

In polar coordinates, 𝑥2 +𝑦2 =𝑟2 and 𝑑𝐴 =𝑟 𝑑𝑟 𝑑𝜃. Therefore

𝐼2=2𝑒(𝑥2+𝑦2)𝑑𝐴=2𝜋00𝑒𝑟2𝑟𝑑𝑟𝑑𝜃

The factor 𝑟 has a direct geometric meaning. A thin shell at radius 𝑟 has circumference 2𝜋𝑟, height 𝑒𝑟2, and thickness 𝑑𝑟, so it contributes

2𝜋𝑟𝑒𝑟2𝑑𝑟

to the volume.

Figure 18.8 The bell surface cut into cylindrical shells. The highlighted curtain has circumference 2𝜋𝑟 and height 𝑒𝑟2, so its area is 𝐵(𝑟) =2𝜋𝑟𝑒𝑟2; giving it thickness 𝑑𝑟 produces one piece of volume. The graph at right records those shell areas. Near the center the Gaussian is tall but the circumference is tiny; far out the circumference is larger but the Gaussian has almost vanished. Add the shells from the center outward and the accumulated volume approaches 𝜋.

Now only a one-variable substitution remains:

𝐼2=2𝜋0𝑒𝑟2𝑟𝑑𝑟=𝜋𝑒𝑟20=𝜋.

Because 𝐼 >0,

𝑒𝑥2𝑑𝑥=𝜋.

18.2Cylindrical Coordinates

Cylindrical coordinates are just the natural three dimensional extension of polar coordinates, where we use 𝑟,𝜃, and 𝑧.

Definition 18.4 (Cylindrical Coordinates). Measure two directions in space using polar coordinates, and the orthogonal direction with its standard Cartesian axis. If we convert the 𝑥𝑦-plane to polar, this means

𝑥=𝑟cos𝜃,𝑦=𝑟sin𝜃,𝑧=𝑧.

Here 𝑟 =constant gives a circular cylinder, 𝜃 =constant gives a vertical half-plane, and 𝑧 =constant gives a horizontal plane. Ordinarily 𝑟 0 and a full revolution uses an angular interval of length 2𝜋; the range of 𝑧 is determined by the solid.

Figure 18.9 Polar coordinates in the floor, with the height carried along untouched. The three surfaces you get by holding one coordinate still are drawn through the point: a cylinder where 𝑟 is fixed, a half-plane where 𝜃 is, and an ordinary horizontal plane where 𝑧 is. Any two of them meet in a curve and all three meet at exactly one point, which is what makes three numbers a coordinate system rather than three unrelated measurements.

The volume element here is just the polar area element times 𝑑𝑧.

Definition 18.5 (Volume in Cylindrical Coordinates).

𝑑𝑉=(𝑑𝐴)𝑑𝑧=𝑟𝑑𝑟𝑑𝜃𝑑𝑧,

with the differentials reordered when the bounds require it.

Figure 18.10 One cell, dissected. Two of its three sides are honest lengths, Δ𝑟 and Δ𝑧; the middle one rides the ring and is therefore an arc of length 𝑟 Δ𝜃. Multiply the three and 𝑑𝑉 =𝑟 𝑑𝑟 𝑑𝜃 𝑑𝑧 falls out — the polar area element with a height attached, and nothing more. Slide 𝑟 inward and watch the arc side shrink with it.

The paraboloid from the last chapter is exactly the geometry cylindrical coordinates were made for. Its circular projection produced square roots in Cartesian coordinates; in cylindrical coordinates, the grid itself fits the rim.

Figure 18.11 The paraboloid from the last chapter, chopped two ways. In Cartesian boxes its round rim can only ever be a staircase, and shrinking the boxes makes the steps smaller without ever making them go away. Switch to cylindrical cells and the rim stops being a problem at all — it is a coordinate surface, so the cells sit on it exactly. Each of those cells is a wedge with sides Δ𝑟, 𝑟 Δ𝜃, and Δ𝑧, which is why 𝑑𝑉 =𝑟 𝑑𝑟 𝑑𝜃 𝑑𝑧: the polar area element with a height attached. Choosing coordinates is choosing a grid that already fits the shape.

The same routine applies as before: convert the region, the integrand, and the volume element. The region gallery below shows how the six bounds arise from the coordinate surfaces.

Figure 18.12 What you are trying to produce is six bounds, and every one of them comes from a face of the solid being a coordinate surface. Step through the three coordinates and watch which faces light up: blue is where the coordinate starts, orange where it stops, and the limits in the integral below are tinted to match. On the paraboloid the 𝑧 bounds are the floor and the paraboloid itself, and the 𝑟 bound is the rim where those two meet. On the cone, 𝑧 =𝑥2+𝑦2 is simply 𝑧 =𝑟, because 𝑟 is the very thing that square root was a square root of. On the wedge every bound is a constant — which is what it means to say the region is a box in (𝑟,𝜃,𝑧).

Example 18.6 (A Paraboloid over a Disc). Let 𝐸 be bounded by the 𝑥𝑦-plane and 𝑧 =1 𝑥2 𝑦2. Compute

𝐸𝑧𝑑𝑉.

The circular geometry tells us to convert the 𝑥𝑦-coordinates to polar and leave 𝑧 alone. The surfaces become

𝑧=0,𝑧=1𝑟2.

Their intersection is 𝑟 =1, so the converted bounds are

0𝜃2𝜋,0𝑟1,0𝑧1𝑟2.

The integrand 𝑧 is unchanged, while 𝑑𝑉 =𝑟 𝑑𝑧 𝑑𝑟 𝑑𝜃. Therefore

𝐸𝑧𝑑𝑉=2𝜋0101𝑟20𝑧𝑟𝑑𝑧𝑑𝑟𝑑𝜃=2𝜋01012(1𝑟2)2𝑟𝑑𝑟𝑑𝜃=2𝜋0112𝑑𝜃=𝜋6.

Example 18.7 (A Cone Capped by a Plane). Let

𝐸={(𝑥,𝑦,𝑧)𝑧𝑥2+𝑦2, 𝑧4}.

Compute 𝐸𝑥2 𝑑𝑉.

The cone becomes 𝑧 =𝑟, and its intersection with 𝑧 =4 gives 𝑟 =4. Also,

𝑥2=𝑟2cos2𝜃,𝑑𝑉=𝑟𝑑𝑧𝑑𝑟𝑑𝜃.

Thus

𝐸𝑥2𝑑𝑉=2𝜋0404𝑟𝑟2cos2𝜃𝑟𝑑𝑧𝑑𝑟𝑑𝜃=(2𝜋0cos2𝜃𝑑𝜃)(40𝑟3(4𝑟)𝑑𝑟)=𝜋2565=256𝜋5.

Cylindrical coordinates need not use polar coordinates in the 𝑥𝑦-plane. If a solid is symmetric around the 𝑥-axis, we may instead use polar coordinates in the 𝑦𝑧-plane and leave 𝑥 unchanged.

Example 18.8 (A Cylinder around the $x$-Axis). Let

𝐸={(𝑥,𝑦,𝑧)𝑦2+𝑧21, 1𝑥4}.

Compute 𝐸𝑥𝑧 𝑑𝑉.

In the 𝑦𝑧-plane set

𝑦=𝑟cos𝜃,𝑧=𝑟sin𝜃,

and leave 𝑥 alone. Then

𝐸𝑥𝑧𝑑𝑉=2𝜋01041𝑥(𝑟sin𝜃)𝑑𝑥𝑟𝑑𝑟𝑑𝜃=0,

because 2𝜋0sin𝜃 𝑑𝜃 =0. Geometrically, the positive and negative contributions cancel across the plane 𝑧 =0.

18.3Spherical Coordinates

Spherical coordinates are a coordinate system in 3 in which we represent a point by its radius, azimuthal angle, and polar angle.

Definition 18.9 (Spherical Coordinates). We write spherical coordinates as (𝜌,𝜃,𝜙), where 𝜌 is distance from the origin, 𝜃 is the azimuthal angle measured from the positive 𝑥-axis in the 𝑥𝑦-plane, and 𝜙 is measured down from the positive 𝑧-axis. The conversion formulas are

𝑥=𝜌cos𝜃sin𝜙,𝑦=𝜌sin𝜃sin𝜙,𝑧=𝜌cos𝜙.

Consequently,

𝜌2=𝑥2+𝑦2+𝑧2.

The standard ranges for all of space are

𝜌0,0𝜃<2𝜋,0𝜙𝜋.

The surfaces 𝜌 =constant are spheres, 𝜃 =constant gives vertical half-planes, and 𝜙 =constant gives cones.

Figure 18.13 Three numbers again: how far out, how far around, and how far down from the pole. The two angles are the thing to get straight, because they are swept in two different planes — 𝜃 in the floor, 𝜙 from the north pole down — and the surfaces they cut out are correspondingly different. Holding 𝜌 gives a sphere and holding 𝜃 gives a half-plane, as you would expect; but holding 𝜙 gives a cone, not a plane and not a band. Note the point's shadow: its distance from the axis is 𝜌sin𝜙, which is where every sin𝜙 in this chapter comes from.

Using these coordinate definitions we can compute the volume element in spherical coordinates: it will be a product of the length in the 𝜌 direction, the length in the 𝜃 direction, and the length in the 𝜙 direction.

  • Length in the 𝜌 direction is 𝑑𝜌.

  • Varying 𝜃 with 𝜌 and 𝜙 fixed traces a circle of latitude of radius 𝜌sin𝜙, so a small angle has length 𝜌sin𝜙 𝑑𝜃.

  • Varying 𝜙 traces a meridian circle of radius 𝜌, so a small angle has length 𝜌 𝑑𝜙.

Definition 18.10 (Volume in Spherical Coordinates).

𝑑𝑉=𝑑𝜌(𝜌sin𝜙𝑑𝜃)(𝜌𝑑𝜙)=𝜌2sin𝜙𝑑𝜌𝑑𝜙𝑑𝜃,

with the differentials reordered when the bounds require it.

Figure 18.14 Three edges, three lengths, and only one of them is what you first guess. Outward is Δ𝜌, an honest distance. Along the meridian the cell rides a circle of radius 𝜌, so that edge is 𝜌 Δ𝜙. But along the circle of latitude it rides a circle of radius 𝜌sin𝜙 — the distance from the axis, not from the origin — so that edge is 𝜌sin𝜙 Δ𝜃. Multiply the three and 𝑑𝑉 =𝜌2sin𝜙 𝑑𝜌 𝑑𝜙 𝑑𝜃 falls out. Slide 𝜙 toward either pole and watch the latitude circle shrink to nothing, taking the cell with it: that is the sin𝜙, and it is a radius rather than a fudge factor.

As before, the bounds are read from the coordinate surfaces that form the solid. Spherical coordinates are especially effective when those surfaces are spheres, cones, and vertical half-planes.

Figure 18.15 The same reading, one system further, and here the faces are the coordinate surfaces almost without exception: a sphere is 𝜌 constant, a cone is 𝜙 constant, a half-plane is 𝜃 constant. So the six bounds can be read off the picture with no slicing and no projecting — which is the whole reason to change coordinates in the first place. The capped ball is the honest exception: its flat top is 𝜌cos𝜙 =0.95, so that bound depends on 𝜙. Good coordinates make bounds simple; they do not promise to make them constant.

Example 18.11 (A Symmetry Observation). Let 𝐸 be the ball of radius 2 centered at the origin. Compute

𝐸𝑧𝑑𝑉.

Since 𝑧 =𝜌cos𝜙, the spherical setup is

2𝜋0𝜋020(𝜌cos𝜙)𝜌2sin𝜙𝑑𝜌𝑑𝜙𝑑𝜃.

The integral is zero because the positive contribution above the 𝑥𝑦-plane cancels the negative contribution below it. Equivalently,

𝜋0sin𝜙cos𝜙𝑑𝜙=0.

The central computational example uses bounds with a direct geometric meaning: two spheres determine the radial interval, the 𝑥𝑦-plane selects the upper half, and a full turn supplies the azimuthal interval.

Example 18.12 (Volume of a Hemispherical Shell). Find the volume of

𝐸={(𝑥,𝑦,𝑧)1𝑥2+𝑦2+𝑧24, 𝑧0}.

The two spheres give 1 𝜌 2. The solid goes all the way around the 𝑧-axis, so 0 𝜃 2𝜋. Because it lies above the 𝑥𝑦-plane, the polar angle runs from the positive 𝑧-axis down to the equator: 0 𝜙 𝜋/2. Thus

Volume(𝐸)=2𝜋0𝜋/2021𝜌2sin𝜙𝑑𝜌𝑑𝜙𝑑𝜃=(2𝜋0𝑑𝜃)(𝜋/20sin𝜙𝑑𝜙)(21𝜌2𝑑𝜌)=(2𝜋)(1)(73)=14𝜋3.

Polar, cylindrical, and spherical coordinates are all examples of a larger idea: a coordinate change is a map that bends one grid into another while stretching its cells by different amounts. The next chapter develops that general theory and explains how the required area scale factor is computed.