Wichita State University Logo

Math 344: Calculus III

15.8 Spherical Coordinates


15.8.1 Recall Polar Coordinates

We already learned the usefulness of polar coordinates when integrating over a domain with circular symmetry. The new coordinate system $\langle r,\theta \rangle$ are related to the old coordinates $\langle x,y \rangle$ by the system of equations

$$ \require{color} \definecolor{brightblue}{rgb}{.267, .298, .812} \definecolor{darkblue}{rgb}{.08, .18, .28} \definecolor{palepink}{rgb}{1, .73, .8} \definecolor{softmagenta}{rgb}{.99,.34,.86} \def\ihat{\mathbf{\hat{\mmlToken{mi}[mathvariant="bold"]{ı}}}} \def\jhat{\mathbf{\hat{\mmlToken{mi}[mathvariant="bold"]{ȷ}}}} \def\khat{\mathbf{\hat{k}}} \newcommand{\pypx}[2][x]{\dfrac{\partial #2}{\partial #1}} \newcommand{\dydx}[2][x]{\dfrac{d #2}{d #1}} \newcommand{\deltax}[2][x]{\frac{\Delta #2}{\Delta #1}} \begin{align*} x &= r\cos(\theta) \\ y &= r\sin(\theta) \end{align*} $$
Recall from Section 14.4 that we derived the equation for the tangent plane

$$ \Delta z = \frac{\partial z}{\partial x}\Delta x + \frac{\partial z}{\partial y}\Delta y $$
or

$$ \begin{align*} \Delta x &= \frac{\partial x}{\partial r}\,\Delta r + \frac{\partial x}{\partial\theta}\,\Delta\theta \\ \Delta y &= \frac{\partial y}{\partial r}\,\Delta r + \frac{\partial y}{\partial\theta}\,\Delta\theta \end{align*} $$
From this we obtain the linear equation

$$ \begin{bmatrix} \Delta x \\ \Delta y \end{bmatrix} = \begin{bmatrix} \frac{\partial x}{\partial r} & \frac{\partial x}{\partial\theta} \\ \frac{\partial y}{\partial r} & \frac{\partial y}{\partial\theta} \end{bmatrix}\,\begin{bmatrix} \Delta r \\ \Delta\theta \end{bmatrix} $$
or

$$ \begin{bmatrix} \frac{\partial z}{\partial x} \\ \frac{\partial z}{\partial y} \end{bmatrix} = \begin{bmatrix} \frac{\partial x}{\partial r} & \frac{\partial x}{\partial\theta} \\ \frac{\partial y}{\partial r} & \frac{\partial y}{\partial\theta} \end{bmatrix}\,\begin{bmatrix} \frac{\partial z}{dr} \\ \frac{\partial z}{\partial \theta} \end{bmatrix} $$
In linear algebra this is the transition matrix from one coordinate system in the tangent space with basis vectors $\left\{ \frac{\partial z}{\partial x}, \frac{\partial z}{\partial y} \right\}$ to the tangent space with basis vectors $\left\{ \frac{\partial z}{\partial\theta}, \frac{\partial z}{\partial r} \right\}$. The determinate of matrix $S$ is defined to be the change in scale introduced by this change of coordinates .

If we have a region $R$ in the tangent space with area $A$ described in rectangular coordinates, then the same area would be det$(S)$ times the area computed using equivalent polar coordinates.

Rectangular Approximation of Polar Rectangle

Figure 1

This scaling factor is called the Jacobian the determinant of the transition matrix $S$. Recall that the determinant is signed .

  • A positive determinant means that the orientation of the surface is unchanged.
  • A negative determinant means that the orientation of the surface has been reversed or flipped .

Computing the determinate we have that the Jacobian $J$ is given by

$$ \begin{align*} J &= \left|S\right| = \begin{vmatrix} \frac{\partial x}{\partial r} & \frac{\partial y}{\partial r} \\ \frac{\partial x}{\partial\theta} & \frac{\partial y}{\partial\theta} \end{vmatrix} \\ \\ &= \begin{vmatrix} \cos(\theta) & \sin(\theta) \\ -r\sin(\theta) & r\cos(\theta) \end{vmatrix} \\ \\ &= r\cos^2(\theta) + r\sin^2(\theta) = r\\ \end{align*} $$
For our double integral, we do not need the sign of the determinant. In fact we are only concerned with the scaling factor, not the orientation. Hence we have that the scaling factor using in our double integral is the absolute value of the Jacobian. Since in polar coordinates the magnitude $r$ is always greater than or equal to zero we have $|r| = r$ and

$$ \displaystyle\iint_D f(x,y)\,dA = \displaystyle\iint_D f(r\cos(\theta),r\sin(\theta)\,r\,dr\,d\theta $$
We denote the Jacobian using similar to the chain rule to remind us of the similarity

$$ J = \frac{\partial(x,y)}{\partial(r,\theta)} $$
so that

$$ \begin{align*} \displaystyle\iint_D f(x,y)\,dA &= \displaystyle\iint_D f(r\cos(\theta),r\sin(\theta)\,\left|J\right|\,dr\,d\theta \\ \\ &= \displaystyle\iint_D f(r\cos(\theta),r\sin(\theta)\,\left|\frac{\partial(x,y)}{\partial(r,\theta)}\right|\,dr\,d\theta \end{align*} $$

Example 1

Consider the function $f:\mathbb{R}^2\mapsto\mathbb{R}$ given by $f(x,y) = 1 - x^2 - y^2$. In polar coordinates we can describe this function

$$ f(x,y) = 1 - x^2 - y^2 = 1 - r^2 = f(r\cos(\theta), r\sin(\theta)) = g(r,\theta) $$
Here function $g = f$ for every vector $\langle x, y\rangle$ in $\mathbb{R}^2$. The change in coordinates is the only difference between these two maps $f$ and $g$ that represent the same function with respect to different coordinate systems.

15.8.2 Spherical Coordinates

Likewise given the change of variables from rectangular coordinates $\langle\,x,y,z\,\rangle$ to spherical coordinates $\langle\,\rho,\theta,\phi\,\rangle$.

$$ \begin{align*} x &= \rho\cos(\theta)\sin(\phi) \\ y &= \rho\sin(\theta)\sin(\phi) \\ z &= \rho\cos(\phi) \end{align*} $$

Spherical Coordinates

Figure 2

We may compute the Jacobian

$$ \begin{align*} J &= \begin{vmatrix} \frac{\partial x}{\partial\rho} & \frac{\partial x}{\partial\theta} & \frac{\partial x}{\partial\phi} \\ \frac{\partial y}{\partial\rho} & \frac{\partial y}{\partial\theta} & \frac{\partial y}{\partial\phi} \\ \frac{\partial z}{\partial\rho} & \frac{\partial z}{\partial\theta} & \frac{\partial z}{\partial\phi} \end{vmatrix} = \begin{vmatrix} \cos(\theta)\sin(\phi) & -\rho\sin(\theta)\sin(\phi) & \rho\cos(\theta)\cos(\phi) \\ \sin(\theta)\sin(\phi) & \rho\cos(\theta)\sin(\phi) & \rho\sin(\theta)\cos(\phi) \\ \cos(\phi) & 0 & -\rho\sin(\phi) \end{vmatrix} \\ \\ &= \cos(\phi)\begin{vmatrix} -\rho\sin(\theta)\sin(\phi) & \rho\cos(\theta)\cos(\phi) \\ \rho\cos(\theta)\sin(\phi) & \rho\sin(\theta)\cos(\phi) \end{vmatrix} - 0 \\ \\ &\ \qquad\qquad\qquad - \rho\sin(\phi)\begin{vmatrix} \cos(\theta)\sin(\phi) & -\rho\sin(\theta)\sin(\phi) \\ \sin(\theta)\sin(\phi) & \rho\cos(\theta)\sin(\phi) \end{vmatrix} \\ \\ &= \rho^2\sin(\phi)\cos^2(\phi)\begin{vmatrix} -\sin(\theta) & \cos(\theta) \\ \cos(\theta) & \sin(\theta) \end{vmatrix} - \rho^2\sin^3(\phi)\begin{vmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{vmatrix} \\ \\ &= \rho^2\sin(\phi)\cos^2(\phi)(-1) - \rho^2\sin^3(\phi)(1) \\ \\ &= -\rho^2\sin(\phi)\left(\cos^2(\phi) + \sin^2(\phi)\right) = -\rho^2\sin(\phi) \end{align*} $$

In our triple integral, we utilize the absolute value of the Jacobian

$$ |J| = \left|\frac{\partial(x,y,z)}{\partial(\rho,\theta,\phi)}\right| = \rho^2\sin(\phi) $$
The last equality because $\rho^2\ge 0$ and the sine function is also nonnegative on the interval $[0,\pi]$.

15.8.3 Converting Coordinates

First try each example or exercise on your own before looking at the solution.

Exercise 1

Convert the vector in rectangular coordinates $\left\langle 6,\,\frac{\pi}{3},\,\frac{\pi}{6}\right\rangle$ to spherical coordinates.

Follow Along Drawing a picture can help Spherical Coordinates Example 2
Figure 3

$$ \begin{align*} r &= \rho\sin(\phi) = 6\sin\left(\frac{\pi}{6}\right) = 6\cdot\frac{1}{2} = 3 \\ \\ z &= \rho\cos(\phi) = 6\cos\left(\frac{\pi}{6}\right) = 6\cdot\frac{\sqrt{3}}{2} = 3\sqrt{3} \end{align*} $$
30-60-90 Triangle in Circle
Figure 4
$$ \begin{align*} x &= r\cos(\theta) = 3\cos\left(\frac{\pi}{3}\right) = 3\cdot\frac{1}{2} = \frac{3}{2} \\ \\ y &= r\sin(\theta) = 3\sin\left(\frac{\pi}{3}\right) = 3\cdot\frac{\sqrt{3}}{2} = \frac{3\sqrt{3}}{2} \\ \\ \end{align*} $$
The rectangular coordinates of our vector are
$$ \left\langle \frac{3}{2},\ \frac{3\sqrt{3}}{2},\ 3\sqrt{3}\right\rangle $$

Exercise 2

Find the spherical coordinates of the vector $\left\langle 0, 2\sqrt{3}, 2 \right\rangle$ in rectangular coordinates.

Follow Along
$$ \begin{align*} \rho &= \sqrt{x^2 + y^2 + z^2} = \sqrt{0 + 12 + 4} = 4 \\ \\ \cos(\phi) &= \dfrac{z}{\rho} = \dfrac{2}{4} = \dfrac{1}{2} \end{align*} $$
Our vector in in the first octet because all of the coordinates are positive. Hence $0\le\phi\le\frac{\pi}{2}$, and $0\le\theta\le\frac{\pi}{2}$.
$$ \begin{align*} \phi &= \dfrac{\pi}{3} \\ \\ r &= \sqrt{x^2 + y^2} = \sqrt{0 + 12} = 2\sqrt{3} \\ \\ \cos(\theta) &= \dfrac{x}{r} = \dfrac{0}{2\sqrt{3}} = 0 \\ \\ \theta &= \dfrac{\pi}{2} \end{align*} $$
The spherical coordinates of the vector are $\left\langle 4, \frac{\pi}{2}, \frac{\pi}{3} \right\rangle$.

15.8.4 Computing Integrals in Spherical Coordinates

Exercise 3

Compute the volume of the solid that lies above the cone $z = \sqrt{x^2 + y^2}$ and below the sphere $x^2 + y^2 + z^2 = z$.

Follow Along

To graph the cone we square both sides of the first equation,
$$ \begin{align*} z^2 &= x^2 + y^2 \\ \\ x^2 + y^2 - z^2 &= 0 \end{align*} $$
To graph the sphere we need to complete the squares
$$ \begin{align*} x^2 + y^2 + z^2 - z &= 0 \\ \\ x^2 + y^2 + z^2 - z + \frac{1}{4} &= \frac{1}{4} \\ \\ x^2 + y^2 + \left(z - \frac{1}{2}\right)^2 &= \frac{1}{4} \end{align*} $$
We also need the curve where they intersect,
$$ \begin{align*} z^2 &= x^2 + y^2 = z - z^2 \\ \\ 2z^2 - z &= 0 \\ \\ z(2z - 1) &= 0 \\ \\ z &= \frac{1}{2} \\ \\ x^2 + y^2 &= z^2 = \frac{1}{4} \\ \end{align*} $$
Computing Volume with Spherical Coordinates
Figure 5

Getting the limits of integration correct is the most challenging. The limits on $\rho$ are from the origin to the sphere centered at $\left(0,0,\frac{1}{2}\right)$ with radius $\frac{1}{2}$, so from $\rho=0$ to the upper hemisphere of the sphere with equation
$$ \begin{align*} \rho^2 &= x^2 + y^2 + z^2 = z = \rho\cos(\phi) \\ \\ \rho &= \cos(\phi) \end{align*} $$
Thus the limits for $\rho$ are, $0\le\rho\le\cos(\phi)$.
The limits are $\theta$ are clear, $0\le\theta\le 2\pi$.
To find the limits for $\phi$ we need to use the equation of the circular path $\left\langle \frac{\cos(t)}{2},\,\frac{\sin(t)}{2},\,\frac{1}{2} \right\rangle$. We know that $z = \rho\cos(\phi)$ also so
$$ \begin{align*} \rho &= \sqrt{x^2 + y^2 + z^2} = \sqrt{\frac{1}{4} + \frac{1}{4}} = \sqrt{\frac{1}{2}} = \frac{1}{\sqrt{2}} \\ \\ \frac{1}{2} &= z = \frac{1}{\sqrt{2}}\cos(\phi) \\ \\ \cos(\phi) &= \frac{\sqrt{2}}{2} = \frac{1}{\sqrt{2}} \\ \\ \phi &= \frac{\pi}{4} \qquad\text{Think of the 45-45-90 triangle!} \end{align*} $$
The integral for computing the volume becomes
$$ \begin{align*} V &= \displaystyle\iiint dV = \displaystyle\int_{\theta=0}^{\theta=2\pi} \displaystyle\int_{\phi=0}^{\phi=\frac{\pi}{4}} \displaystyle\int_{\rho=0}^{\rho=\cos(\phi)} \rho^2\sin(\phi)\,d\rho d\phi d\theta \\ \\ &= \displaystyle\int_{\theta=0}^{\theta=2\pi} \displaystyle\int_{\phi=0}^{\phi=\frac{\pi}{4}} \left[\,\frac{\rho^3}{3}\sin(\phi)\,\right]_{\rho=0}^{\rho=\cos(\phi)}\,d\phi d\theta \\ \\ &= \displaystyle\int_{\theta=0}^{\theta=2\pi} \displaystyle\int_{\phi=0}^{\phi=\frac{\pi}{4}} \left[\,\frac{\cos^3(\phi)}{3}\sin(\phi) - 0\,\right]\,d\phi d\theta \\ \\ &= \frac{1}{3}\displaystyle\int_{\theta=0}^{\theta=2\pi} \displaystyle\int_{\phi=0}^{\phi=\frac{\pi}{4}} \cos^3(\phi)\sin(\phi)\,d\phi d\theta\qquad\left|\begin{array}{ccc} u & = & \cos(\phi) \\ du & = & -\sin(\phi)\,d\phi \\ u(0) & = & 1 \\ u\left(\frac{\pi}{4}\right) & = & \frac{1}{\sqrt{2}} \end{array} \right. \\ \\ &= \frac{1}{3}\displaystyle\int_{\theta=0}^{\theta=2\pi} \displaystyle\int_{u=1}^{u=\frac{1}{\sqrt{2}}} u^3\,(-du)\,d\theta = \frac{1}{3}\displaystyle\int_{\theta=0}^{\theta=2\pi} \left[\,\frac{u^4}{4}\,\right]_{u=\frac{1}{\sqrt{2}}}^{u=1}\,d\theta \\ \\ &= \frac{1}{3}\displaystyle\int_{\theta=0}^{\theta=2\pi} \left[\,\frac{1}{4} - \frac{1}{16}\,\right]\,d\theta = \frac{1}{16}\displaystyle\int_{\theta=0}^{\theta=2\pi}\,d\theta = \frac{1}{16}\cdot 2\pi = \frac{\pi}{8} \end{align*} $$

Creative Commons Logo - White


Your use of this self-initiated mediated course material is subject to our Creative Commons License .


Creative Commons Attribution-NonCommercial-ShareAlike 4.0

Creative Commons Logo - Black
Attribution
You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

Creative Commons Logo - Black
Noncommercial
You may not use the material for commercial purposes.

Creative Commons Logo - Black
Share Alike
You are free to share, copy and redistribute the material in any medium or format. If you adapt, remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.