Unit 5, chapter 24

A ball, a radial density, and a volume cell

How a triple integral gives the mass of a ball with a radial density, how spherical coordinates use a polar angle and an azimuth, and why the spherical volume element is r² sin φ dr dφ dθ.

  • Chapter 24
  • Polar coordinates, the Jacobian and spherical coordinates

A solid unit ball has density x2+y2+z2x^2 + y^2 + z^2, the squared distance from its center, so it is light near the center and densest at the surface. What is its total mass? In rectangular coordinates every inner bound of the triple integral is a square root, but the ball and the density both depend only on the distance from the center, which suggests coordinates built from that distance and two angles. This page sets up spherical coordinates, derives the volume of a small spherical cell from its three edge lengths, and finds the mass 4π5\tfrac{4\pi}{5}.

Key terms

Triple integral

Definition Let EE be a closed bounded solid whose boundary has zero volume, for example a solid bounded by finitely many smooth surfaces, and let ff be continuous on EE. Enclose EE in a box, set f=0f = 0 outside EE, cut the box into small boxes with volumes ΔV1,…,ΔVn\Delta V_1, \dots, \Delta V_n and pick a point PiP_i in each. The triple integral of ff over EE is the limit of the Riemann sums

∭Ef dV=lim⁡h→0∑i=1nf(Pi) ΔVi,\begin{aligned} &\iiint_E f\,dV \\[0.4em] &\quad = \lim_{h \to 0} \sum_{i=1}^{n} f(P_i)\,\Delta V_i, \end{aligned}

where hh is the largest diameter of the small boxes. Under these conditions the limit exists and does not depend on the choice of the points. When EE is described by bounds a≤x≤ba \le x \le b, g1(x)≤y≤g2(x)g_1(x) \le y \le g_2(x) and k1(x,y)≤z≤k2(x,y)k_1(x, y) \le z \le k_2(x, y) with continuous bounding functions, Fubini’s theorem lets the triple integral be computed as the iterated integral with those bounds. With f=1f = 1 it gives the volume of EE.

In plain words Cut the solid into tiny pieces, multiply the value of ff in each piece by the volume of the piece, and add. When ff is a density, each product is the mass of a piece, and the sum is the total mass.

Example The unit ball x2+y2+z2≤1x^2 + y^2 + z^2 \le 1 is described by

−1≤x≤1,∣y∣≤1−x2,∣z∣≤1−x2−y2.\begin{gathered} -1 \le x \le 1, \\[0.4em] \lvert y \rvert \le \sqrt{1 - x^2}, \\[0.4em] \lvert z \rvert \le \sqrt{1 - x^2 - y^2}. \end{gathered}

The innermost integral of 11 gives the length 21−x2−y22\sqrt{1 - x^2 - y^2} of a vertical segment through the ball. The middle integral adds these lengths across the slice at a fixed xx, which is a disk of radius 1−x2\sqrt{1 - x^2}, and so it gives the area π(1−x2)\pi(1 - x^2) of that disk. Then

V=∫−11π(1−x2) dx=4π3.\begin{aligned} V &= \int_{-1}^{1} \pi (1 - x^2)\,dx \\[0.4em] &= \frac{4\pi}{3}. \end{aligned}

With the density x2+y2+z2x^2 + y^2 + z^2 in place of 11, the same bounds lead to a much longer calculation.

Spherical coordinates

Definition Spherical coordinates locate a point P=(x,y,z)P = (x, y, z) by its distance r=x2+y2+z2r = \sqrt{x^2 + y^2 + z^2} from the origin, its polar angle ϕ\phi in [0,π][0, \pi] and its azimuth θ\theta in [0,2π)[0, 2\pi). The next card describes the two angles. The conversion is

x=rsin⁡ϕcos⁡θ,y=rsin⁡ϕsin⁡θ,z=rcos⁡ϕ,\begin{gathered} x = r \sin\phi \cos\theta, \\[0.4em] y = r \sin\phi \sin\theta, \\[0.4em] z = r \cos\phi, \end{gathered}

and x2+y2+z2=r2x^2 + y^2 + z^2 = r^2. Each point off the zz-axis has exactly one such triple, with r>0r > 0 and 0<ϕ<π0 < \phi < \pi. On the zz-axis the azimuth can be anything, and at the origin both angles can be anything. This page writes rr for the distance from the origin. Many books call it ρ\rho and keep rr for the distance from the zz-axis.

In plain words The segment from the origin to PP has length rr. Tilting it by the angle ϕ\phi away from the positive zz-axis gives it the height z=rcos⁡ϕz = r\cos\phi and a shadow in the xyxy-plane of length rsin⁡ϕr\sin\phi, which is never negative because sin⁡ϕ≥0\sin\phi \ge 0 for 0≤ϕ≤π0 \le \phi \le \pi. The azimuth then splits the shadow into xx and yy exactly as polar coordinates do. Squaring and adding gives r2sin⁡2ϕ (cos⁡2θ+sin⁡2θ)+r2cos⁡2ϕ=r2r^2 \sin^2\phi\,(\cos^2\theta + \sin^2\theta) + r^2 \cos^2\phi = r^2.

Example The unit ball is the coordinate box 0≤r≤10 \le r \le 1, 0≤ϕ≤π0 \le \phi \le \pi, 0≤θ≤2π0 \le \theta \le 2\pi, where including θ=2π\theta = 2\pi repeats only a half-plane, a set of zero volume. The density x2+y2+z2x^2 + y^2 + z^2 becomes r2r^2. The upper half of the ball is 0≤r≤10 \le r \le 1, 0≤ϕ≤π20 \le \phi \le \tfrac{\pi}{2}, 0≤θ≤2π0 \le \theta \le 2\pi, and the squared distance from the zz-axis, x2+y2x^2 + y^2, becomes r2sin⁡2ϕr^2 \sin^2\phi.

Polar angle and azimuth

Definition The polar angle ϕ\phi of a point PP other than the origin OO is the angle between the positive zz-axis and the segment from OO to PP, so cos⁡ϕ=z/r\cos\phi = z/r and 0≤ϕ≤π0 \le \phi \le \pi. It is 00 on the positive zz-axis, π2\tfrac{\pi}{2} in the xyxy-plane and π\pi on the negative zz-axis. The azimuth θ\theta of a point off the zz-axis is the angle of its shadow (x,y)(x, y) in the xyxy-plane, measured counterclockwise from the positive xx-axis as in polar coordinates, so cos⁡θ=x/(rsin⁡ϕ)\cos\theta = x/(r\sin\phi) and sin⁡θ=y/(rsin⁡ϕ)\sin\theta = y/(r\sin\phi). Some books, especially in physics, swap the names and use θ\theta for the polar angle and ϕ\phi for the azimuth. The formulas on this page assume the convention described here.

In plain words Picture a globe with its north pole on the positive zz-axis. The polar angle says how far the point is from the north pole, from 00 at the north pole through π2\tfrac{\pi}{2} at the equator to π\pi at the south pole. The azimuth says how far around the axis the point is, like longitude. Geographic latitude is π2−ϕ\tfrac{\pi}{2} - \phi, measured up from the equator.

Example Take P=(32,32,−1)P = (\tfrac{\sqrt3}{2}, \tfrac32, -1). Its distance from the origin is r=34+94+1=2r = \sqrt{\tfrac34 + \tfrac94 + 1} = 2, and cos⁡ϕ=−12\cos\phi = -\tfrac12 gives ϕ=2π3\phi = \tfrac{2\pi}{3}. The polar angle is larger than π2\tfrac{\pi}{2} because PP lies below the xyxy-plane. The shadow (32,32)(\tfrac{\sqrt3}{2}, \tfrac32) has length 3=2sin⁡2π3\sqrt3 = 2\sin\tfrac{2\pi}{3} and lies in the first quadrant with tan⁡θ=3\tan\theta = \sqrt3, so θ=π3\theta = \tfrac{\pi}{3}. As a check, z=2cos⁡2π3=−1z = 2\cos\tfrac{2\pi}{3} = -1 and x=3cos⁡π3=32x = \sqrt3 \cos\tfrac{\pi}{3} = \tfrac{\sqrt3}{2}.

Spherical volume element

Definition In spherical coordinates with the polar angle measured from the positive zz-axis, the volume element is

dV=r2sin⁡ϕ dr dϕ dθ.dV = r^2 \sin\phi\,dr\,d\phi\,d\theta.

Its factor is the Jacobian determinant of the map (r,ϕ,θ)↦(x,y,z)(r, \phi, \theta) \mapsto (x, y, z),

∂(x,y,z)∂(r,ϕ,θ)=r2sin⁡ϕ,\frac{\partial(x, y, z)}{\partial(r, \phi, \theta)} = r^2 \sin\phi,

which is never negative for 0≤ϕ≤π0 \le \phi \le \pi, so it equals its own absolute value. This is the three-dimensional case of the change of variables with the absolute Jacobian. Precisely, let SS be a closed bounded set of triples (r,ϕ,θ)(r, \phi, \theta) with r≥0r \ge 0, 0≤ϕ≤π0 \le \phi \le \pi and θ\theta in an interval of length at most 2π2\pi, whose boundary has zero volume, let EE be its image, and let ff be continuous on EE. Then

∭Ef dV=∭Sf r2sin⁡ϕ dr dϕ dθ,\begin{aligned} &\iiint_E f\,dV \\[0.4em] &= \iiint_S f\,r^2 \sin\phi\,dr\,d\phi\,d\theta, \end{aligned}

with ff evaluated at (rsin⁡ϕcos⁡θ,rsin⁡ϕsin⁡θ,rcos⁡ϕ)(r\sin\phi\cos\theta, r\sin\phi\sin\theta, r\cos\phi) on the right. The map fails to be one-to-one only at the origin, on the zz-axis and, when θ\theta runs over a full turn, on the half-plane where its two end values meet. Those sets have zero volume, so they do not change the integral.

In plain words A small cell between rr and r+drr + dr, ϕ\phi and ϕ+dϕ\phi + d\phi, and θ\theta and θ+dθ\theta + d\theta is nearly a box with three perpendicular edges. The radial edge has length drdr. The edge along a meridian is an arc of a circle of radius rr, with length about r dϕr\,d\phi. The edge along a circle of latitude is an arc of a circle of radius rsin⁡ϕr\sin\phi, the distance from the zz-axis, with length about rsin⁡ϕ dθr\sin\phi\,d\theta. The product of the three lengths is r2sin⁡ϕ dr dϕ dθr^2 \sin\phi\,dr\,d\phi\,d\theta, and the curved shape of the cell changes its volume only by an amount that is small compared with this product as the steps shrink. The factor sin⁡ϕ\sin\phi makes cells with the same angular steps thin near the poles and largest at the equator.

Example Let BB be the unit ball x2+y2+z2≤1x^2 + y^2 + z^2 \le 1, including its interior, with density x2+y2+z2x^2 + y^2 + z^2. Its mass MM is

∭B(x2+y2+z2) dV.\iiint_B (x^2 + y^2 + z^2)\,dV.

The ball is the coordinate box 0≤r≤10 \le r \le 1, 0≤ϕ≤π0 \le \phi \le \pi, 0≤θ≤2π0 \le \theta \le 2\pi, with ϕ\phi measured down from the positive zz-axis and θ\theta the azimuth, and the density is continuous and nonnegative. The density contributes r2r^2 and the volume element contributes r2sin⁡ϕr^2 \sin\phi, so MM is the iterated integral

∫02π ⁣ ⁣∫0π ⁣ ⁣∫01r4sin⁡ϕ dr dϕ dθ.\int_0^{2\pi}\!\!\int_0^{\pi}\!\!\int_0^1 r^4 \sin\phi\,dr\,d\phi\,d\theta.

The bounds are constants and the integrand is a function of rr times a function of ϕ\phi, so the integral is the product of three single integrals,

∫01r4 dr=15,∫0πsin⁡ϕ dϕ=2,∫02πdθ=2π.\begin{gathered} \int_0^1 r^4\,dr = \frac15, \\[0.4em] \int_0^{\pi} \sin\phi\,d\phi = 2, \\[0.4em] \int_0^{2\pi} d\theta = 2\pi. \end{gathered}

Therefore

M=15⋅2⋅2π=4π5.M = \frac15 \cdot 2 \cdot 2\pi = \frac{4\pi}{5}.

The two factors r2r^2 in r4r^4 play different roles. One is the density of the material, and the other is the size of the cell.

Radial density

Definition A density on a solid is radial about a point CC when its value at each point PP depends only on the distance from PP to CC, that is, when it equals g(d)g(d) for a function gg of one variable, where dd is that distance. With CC at the origin, a radial density is g(r)g(r) in spherical coordinates. For the ball of radius R>0R > 0 centered at the origin and a continuous function g≥0g \ge 0 on [0,R][0, R], the angular integrals give the area of the unit sphere,

∫02π∫0πsin⁡ϕ dϕ dθ=4π,\int_0^{2\pi} \int_0^{\pi} \sin\phi\,d\phi\,d\theta = 4\pi,

and the mass is

M=4π∫0Rg(r) r2 dr.M = 4\pi \int_0^R g(r)\,r^2\,dr.

In plain words All material at the same distance from the center has the same density, so the ball can be cut into thin spherical shells. The shell between rr and r+drr + dr has volume about 4πr2 dr4\pi r^2\,dr and density about g(r)g(r), and the mass adds up the shells. The shortcut needs a ball or a shell centered at the same point as the density.

Example The density x2+y2+z2x^2 + y^2 + z^2 is radial with g(r)=r2g(r) = r^2, and the formula gives 4π∫01r4 dr=4π54\pi \int_0^1 r^4\,dr = \tfrac{4\pi}{5} again. The density 1−(x2+y2+z2)1 - (x^2 + y^2 + z^2) is also radial, with g(r)=1−r2g(r) = 1 - r^2, and it is highest at the center. On the unit ball it gives the mass

M=4π∫01(1−r2) r2 dr=4π(13−15)=8π15.\begin{aligned} M &= 4\pi \int_0^1 (1 - r^2)\,r^2\,dr \\[0.4em] &= 4\pi\Bigl(\frac13 - \frac15\Bigr) = \frac{8\pi}{15}. \end{aligned}

The density x2+y2x^2 + y^2 is not radial. The points (1,0,0)(1, 0, 0) and (0,0,1)(0, 0, 1) are both at distance 11 from the origin, but their densities are 11 and 00.

Mass from density

Definition Let a solid EE with positive volume VV carry a continuous density δ≥0\delta \ge 0, measured as mass per unit volume. A small piece of volume ΔV\Delta V around a point PP has mass about δ(P) ΔV\delta(P)\,\Delta V, and the Riemann sums of δ\delta add these masses, so the mass of EE is

M=∭Eδ dV.M = \iiint_E \delta\,dV.

The average density is M/VM / V. It lies between the smallest and the largest value of δ\delta on EE, which gives a quick check on a computed mass.

In plain words Density says how much mass a unit of volume holds near a point. Integrating it over the solid adds up the masses of all the small pieces. Dividing the total by the volume gives the constant density that would produce the same mass.

Example For the ball BB, M=4π5M = \tfrac{4\pi}{5} and V=4π3V = \tfrac{4\pi}{3}, so the average density is 35\tfrac35. The density r2r^2 runs from 00 at the center to 11 on the surface, and it is less than 11 inside, so 0<M<4π30 < M < \tfrac{4\pi}{3}, as found. The average 35\tfrac35 is well above 13\tfrac13, the average of r2r^2 when the radius is chosen uniformly from [0,1][0, 1], because the outer shells hold most of the volume. The outer half of the radius, 12≤r≤1\tfrac12 \le r \le 1, contains 78\tfrac78 of the volume and 3132\tfrac{31}{32} of the mass. As another check, the densities r2r^2 and 1−r21 - r^2 add to 11, and their masses 4π5\tfrac{4\pi}{5} and 8π15\tfrac{8\pi}{15} add to 4π3\tfrac{4\pi}{3}, the volume of the ball.

Check yourself

  1. The spherical shell 1≤x2+y2+z2≤41 \le x^2 + y^2 + z^2 \le 4 has density 1/(x2+y2+z2)1/(x^2 + y^2 + z^2). Find its mass.
Show the answer

The shell is 1≤r≤21 \le r \le 2, 0≤ϕ≤π0 \le \phi \le \pi, 0≤θ≤2π0 \le \theta \le 2\pi, and the density is 1/r21/r^2, which is continuous on the shell because the origin is not in it. The density cancels the r2r^2 of the volume element, so the mass is

∫02π ⁣ ⁣∫0π ⁣ ⁣∫12sin⁡ϕ dr dϕ dθ.\int_0^{2\pi}\!\!\int_0^{\pi}\!\!\int_1^2 \sin\phi\,dr\,d\phi\,d\theta.

The rr interval has length 11, the ϕ\phi integral is 22 and the θ\theta integral is 2π2\pi, so the mass is 1⋅2⋅2π=4π1 \cdot 2 \cdot 2\pi = 4\pi. Every thin shell of thickness drdr carries the same mass 4π dr4\pi\,dr, since its volume 4πr2 dr4\pi r^2\,dr is multiplied by the density 1/r21/r^2.

  1. A classmate computes the volume of the unit ball with ϕ\phi running from 00 to 2π2\pi and θ\theta from 00 to π\pi, as the integral below, and gets 00. What went wrong?
∫0π ⁣ ⁣∫02π ⁣ ⁣∫01r2sin⁡ϕ dr dϕ dθ\int_0^{\pi}\!\!\int_0^{2\pi}\!\!\int_0^1 r^2 \sin\phi\,dr\,d\phi\,d\theta
Show the answer

The integral over ϕ\phi is ∫02πsin⁡ϕ dϕ=0\int_0^{2\pi} \sin\phi\,d\phi = 0, so the result is 00, which cannot be the volume of a ball. These ranges do reach every point, since the triple (r,ϕ,θ)(r, \phi, \theta) with π<ϕ<2π\pi < \phi < 2\pi names the same point as (r,2π−ϕ,θ+π)(r, 2\pi - \phi, \theta + \pi), and apart from a set of zero volume each point is reached once. The trouble is the sign. For π<ϕ<2π\pi < \phi < 2\pi the Jacobian r2sin⁡ϕr^2 \sin\phi is negative, while the change of variables formula uses its absolute value, and r2sin⁡ϕr^2 \sin\phi equals its absolute value only when 0≤ϕ≤π0 \le \phi \le \pi. With the convention 0≤ϕ≤π0 \le \phi \le \pi and 0≤θ≤2π0 \le \theta \le 2\pi the volume is

∫02π ⁣ ⁣∫0π ⁣ ⁣∫01r2sin⁡ϕ dr dϕ dθ,\int_0^{2\pi}\!\!\int_0^{\pi}\!\!\int_0^1 r^2 \sin\phi\,dr\,d\phi\,d\theta,

which equals 13⋅2⋅2π=4π3\tfrac13 \cdot 2 \cdot 2\pi = \tfrac{4\pi}{3}.

  1. Find the integral of z2z^2 over the unit ball BB, and check the answer with the symmetry of the ball and the mass 4π5\tfrac{4\pi}{5} found above.
Show the answer

In spherical coordinates z2=r2cos⁡2ϕz^2 = r^2 \cos^2\phi, so on the box 0≤r≤10 \le r \le 1, 0≤ϕ≤π0 \le \phi \le \pi, 0≤θ≤2π0 \le \theta \le 2\pi the integrand times the volume factor is r4cos⁡2ϕsin⁡ϕr^4 \cos^2\phi \sin\phi. The bounds are constants and this is a function of rr times a function of ϕ\phi, so the integral is the product of three single integrals,

∫01r4 dr=15,∫0πcos⁡2ϕsin⁡ϕ dϕ=23,∫02πdθ=2π.\begin{gathered} \int_0^1 r^4\,dr = \frac15, \\[0.4em] \int_0^{\pi} \cos^2\phi \sin\phi\,d\phi = \frac23, \\[0.4em] \int_0^{2\pi} d\theta = 2\pi. \end{gathered}

The middle one comes from the substitution w=cos⁡ϕw = \cos\phi, with dw=−sin⁡ϕ dϕdw = -\sin\phi\,d\phi. It sends ϕ=0\phi = 0 to w=1w = 1 and ϕ=π\phi = \pi to w=−1w = -1 and turns the integral into ∫−11w2 dw=23\int_{-1}^{1} w^2\,dw = \tfrac23. The result is

15⋅23⋅2π=4π15.\frac15 \cdot \frac23 \cdot 2\pi = \frac{4\pi}{15}.

The ball looks the same from every axis, so the integrals of x2x^2, y2y^2 and z2z^2 over it are equal. Their sum is the integral of x2+y2+z2x^2 + y^2 + z^2, which is 4π5\tfrac{4\pi}{5}, so each one is 13⋅4π5=4π15\tfrac13 \cdot \tfrac{4\pi}{5} = \tfrac{4\pi}{15}, in agreement.

How this lesson connects