Chapter 2: Vectors in Space
2.7 Cylindrical and Spherical Coordinates
Study guide for Calculus Volume 3 (Gilbert Strang, 2016 edition)
Independent study guide. Not affiliated with OpenStax or Rice University.
Big idea
Rectangular coordinates treat the three axes as interchangeable, which is exactly wrong for objects that have an axis of symmetry or a center of symmetry. A circular cylinder of radius $3$ needs the awkward equation $x^2 + y^2 = 9$ in rectangular coordinates, and a sphere of radius $5$ needs a sum of three squares. Both objects are simple, and a coordinate system matched to their symmetry says so in one short equation.
Cylindrical coordinates are polar coordinates in the horizontal plane with the height carried along unchanged. A point is located by how far it sits from the $z$-axis, which direction it lies in, and how high it is. Anything built around an axis, such as a pipe, a helix or a paraboloid of revolution, becomes easy to describe, and the conversion formulas are the polar ones you already know with a third line that says $z$ equals $z$.
Spherical coordinates instead measure distance from a single point. A point is located by its distance from the origin, the same horizontal angle as before, and a second angle that says how far the point has tilted away from the vertical axis. Spheres centered at the origin become a single equation, and cones with vertex at the origin become another. This is the natural language for anything radial: gravitational fields, planetary positions, radiation from a point source.
None of this introduces new geometry. It is a change of description, and the only real work is bookkeeping: knowing which angle is which, keeping angles in their allowed ranges, and resolving the ambiguity that trigonometric inverses always introduce. Once that is secure, you convert in whichever direction makes the current problem easier, which is what the multiple integration chapter will demand constantly.
Decoder
In this course spherical coordinates are written $(\rho, \theta, \varphi)$, where $\rho$ is the distance from the origin, $\theta$ is the same angle used in polar and cylindrical coordinates measured in the $xy$-plane from the positive $x$-axis, and $\varphi$ is measured from the positive $z$-axis down toward the point.
State that convention out loud every time, because books differ. Some texts swap the names of the two angles, and some measure the second angle up from the $xy$-plane rather than down from the $z$-axis. Formulas copied from a source using a different convention will look almost right and produce wrong answers, so check which angle is which before trusting any formula you did not derive.
With this convention the ranges are $\rho \ge 0$, $0 \le \varphi \le \pi$ and $\theta$ running once around, typically $0 \le \theta < 2\pi$. The angle $\varphi$ never exceeds $\pi$: it starts at $0$ on the positive $z$-axis, reaches $\pi/2$ in the $xy$-plane, and ends at $\pi$ on the negative $z$-axis. Allowing $\varphi$ to run all the way to $2\pi$ would cover every point twice.
The classic mistake is in the other direction, converting rectangular to angles. The equation $\tan\theta = y/x$ has two solutions in a full turn, and the calculator returns only one of them. Check which quadrant the point $(x,y)$ lies in and adjust by $\pi$ when necessary. The angle $\varphi$ has no such trouble, since $\cos\varphi = z/\rho$ determines $\varphi$ uniquely on $[0,\pi]$.
Definitions and results
Cylindrical coordinates. A point is written $(r, \theta, z)$, where $(r, \theta)$ are polar coordinates of its projection onto the $xy$-plane and $z$ is the usual height. Normally $r \ge 0$.
Cylindrical to rectangular. $x = r\cos\theta$, $y = r\sin\theta$, $z = z$.
Rectangular to cylindrical. $r = \sqrt{x^2 + y^2}$, $\tan\theta = y/x$ with the quadrant of $(x,y)$ deciding $\theta$, and $z = z$. On the $z$-axis, $r = 0$ and $\theta$ is undefined.
Spherical coordinates. A point is written $(\rho, \theta, \varphi)$ with $\rho \ge 0$ the distance from the origin, $\theta$ the horizontal angle from the positive $x$-axis, and $\varphi$ the polar angle measured from the positive $z$-axis, $0 \le \varphi \le \pi$.
Spherical to rectangular. The projection into the horizontal plane has length $\rho\sin\varphi$, so
$$ x = \rho \sin\varphi \cos\theta, \qquad y = \rho \sin\varphi \sin\theta, \qquad z = \rho \cos\varphi $$
Rectangular to spherical. $\rho = \sqrt{x^2 + y^2 + z^2}$, then $\cos\varphi = z/\rho$ for $\rho \ne 0$, and $\theta$ is found from $\tan\theta = y/x$ exactly as in the cylindrical case.
Between the two curved systems. Comparing the projections gives $r = \rho\sin\varphi$, $\theta = \theta$ and $z = \rho\cos\varphi$, and in reverse $\rho = \sqrt{r^2 + z^2}$ and $\tan\varphi = r/z$. These are useful when a problem starts in one system and finishes in the other.
Coordinate surfaces. Holding one coordinate fixed gives a surface. In cylindrical coordinates, $r = c$ is a circular cylinder about the $z$-axis, $\theta = c$ is a vertical half-plane hinged on that axis, and $z = c$ is a horizontal plane. In spherical coordinates, $\rho = c$ is a sphere centered at the origin, $\varphi = c$ is a half-cone with vertex at the origin, becoming the $xy$-plane at $c = \pi/2$, and $\theta = c$ is again a half-plane.
Choosing a system. Match the symmetry of the object. Rotational symmetry about a line suggests cylindrical coordinates with that line as the $z$-axis; symmetry about a point suggests spherical coordinates centered there. A surface that is awkward in one system is often one line long in another.
Worked examples
Between rectangular and cylindrical
Convert $(-3, 3, 5)$ to cylindrical coordinates.
The horizontal distance is $r = \sqrt{9 + 9} = 3\sqrt{2}$, and $\tan\theta = 3/(-3) = -1$. The point $(-3, 3)$ is in the second quadrant, so $\theta = 3\pi/4$ rather than $-\pi/4$. The height is unchanged, giving $\left( 3\sqrt{2}, \; \tfrac{3\pi}{4}, \; 5 \right)$.
Check by converting back: $x = 3\sqrt{2}\cos(3\pi/4) = 3\sqrt{2} \cdot \left(-\tfrac{\sqrt{2}}{2}\right) = -3$ and $y = 3\sqrt{2} \cdot \tfrac{\sqrt{2}}{2} = 3$, as required.
Going the other way, convert $\left( 4, \tfrac{2\pi}{3}, -1 \right)$ to rectangular coordinates:
$$ x = 4\cos\tfrac{2\pi}{3} = -2, \qquad y = 4\sin\tfrac{2\pi}{3} = 2\sqrt{3}, \qquad z = -1 $$
Between rectangular and spherical
Convert $(1, \sqrt{3}, 2)$ to spherical coordinates.
First the distance: $\rho = \sqrt{1 + 3 + 4} = \sqrt{8} = 2\sqrt{2}$. Then
$$ \cos\varphi = \frac{z}{\rho} = \frac{2}{2\sqrt{2}} = \frac{1}{\sqrt{2}} \quad \Longrightarrow \quad \varphi = \frac{\pi}{4} $$
Finally $\tan\theta = \sqrt{3}/1$, and the point $(1, \sqrt{3})$ is in the first quadrant, so $\theta = \pi/3$. The spherical coordinates are $\left( 2\sqrt{2}, \; \tfrac{\pi}{3}, \; \tfrac{\pi}{4} \right)$.
Check all three rectangular coordinates. With $\sin\varphi = \tfrac{\sqrt{2}}{2}$, the product $\rho\sin\varphi = 2\sqrt{2} \cdot \tfrac{\sqrt{2}}{2} = 2$, so $x = 2\cos(\pi/3) = 1$, $y = 2\sin(\pi/3) = \sqrt{3}$, and $z = 2\sqrt{2} \cdot \tfrac{\sqrt{2}}{2} = 2$. All three match.
Now convert $\left( 6, \tfrac{\pi}{6}, \tfrac{2\pi}{3} \right)$ to rectangular coordinates. Here $\sin\varphi = \tfrac{\sqrt{3}}{2}$ and $\cos\varphi = -\tfrac{1}{2}$, so
$$ x = 6 \cdot \tfrac{\sqrt{3}}{2} \cdot \tfrac{\sqrt{3}}{2} = \tfrac{9}{2}, \qquad y = 6 \cdot \tfrac{\sqrt{3}}{2} \cdot \tfrac{1}{2} = \tfrac{3\sqrt{3}}{2}, \qquad z = 6 \cdot \left(-\tfrac{1}{2}\right) = -3 $$
The negative $z$ is expected, since $\varphi = 2\pi/3$ is past the horizontal plane.
A cone in three languages
The surface $z = \sqrt{x^2 + y^2}$ is the upper half of a cone.
In cylindrical coordinates the square root is exactly $r$, so the equation is simply $z = r$. In spherical coordinates, substitute $r = \rho\sin\varphi$ and $z = \rho\cos\varphi$ to get $\rho\cos\varphi = \rho\sin\varphi$. For $\rho \ne 0$ this means $\tan\varphi = 1$, so
$$ \varphi = \frac{\pi}{4} $$
One constant describes the whole surface, which is the point of the spherical system: this cone is a coordinate surface. For the same reason, the cylinder $x^2 + y^2 = 9$ is $r = 3$ in cylindrical coordinates but the clumsier $\rho\sin\varphi = 3$ in spherical ones. Symmetry, not habit, decides which system to use.
A sphere that is not centered at the origin
Describe the surface $x^2 + y^2 + z^2 = 4z$.
Since $\rho^2 = x^2 + y^2 + z^2$ and $z = \rho\cos\varphi$, the equation becomes $\rho^2 = 4\rho\cos\varphi$, and dividing by $\rho$ where it is nonzero gives
$$ \rho = 4\cos\varphi $$
To see what this is, complete the square in rectangular coordinates: $x^2 + y^2 + (z-2)^2 = 4$, a sphere of radius $2$ centered at $(0,0,2)$, passing through the origin. The spherical equation agrees with that picture. At $\varphi = 0$, straight up, it gives $\rho = 4$, the top of the sphere, and at $\varphi = \pi/2$, in the horizontal plane, it gives $\rho = 0$, the origin. Values of $\varphi$ beyond $\pi/2$ would give a negative $\rho$, which correctly says the sphere lies entirely above the $xy$-plane.
Practice
These problems run in both directions between all three systems, including converting points and rewriting equations of planes, cylinders, cones, spheres and paraboloids in whichever system makes them shortest.
Practice
Generated problems for this section, graded instantly.
Quiz
Five items on converting points between rectangular, cylindrical and spherical coordinates and on recognizing the surfaces given by simple equations in each system.
Quiz
5 problems with a score at the end.