From Density to Total Mass
A solid need not have the same density everywhere. If one part of a ball is denser than another, its mass cannot be found by multiplying the whole volume by a single constant density. Instead, add the contributions from small pieces throughout the solid.
In spherical coordinates, those pieces are described by distance \(\rho\) from the origin, polar angle \(\phi\) measured down from the positive \(z\)-axis, and azimuthal angle \(\theta\) measured in the \(xy\)-plane from the positive \(x\)-axis. The corresponding Cartesian coordinates are \(x=\rho\sin\phi\cos\theta\), \(y=\rho\sin\phi\sin\theta\), and \(z=\rho\cos\phi\).
When density is already given as a function of spherical coordinates, write it as \(\delta(\rho,\phi,\theta)\) and substitute it directly. The key is to include both the density and the spherical volume factor \(\rho^2\sin\phi\). The limits must describe the solid itself; density does not change the region's bounds.
Why the Spherical Volume Factor Appears
A small spherical-coordinate box has approximate side lengths \(d\rho\) in the radial direction, \(\rho\,d\phi\) in the polar direction, and \(\rho\sin\phi\,d\theta\) in the azimuthal direction. The latter two lengths are arc lengths: the circle traced by changing \(\phi\) has radius \(\rho\), while the circle traced by changing \(\theta\) has radius \(\rho\sin\phi\).
Multiplying these three lengths gives the approximate volume of the small box. The exact volume element is obtained in the limit as the box dimensions shrink:
Mass in a small volume is approximately its density at that location times its volume. Adding these local contributions over the region, and taking the limit of finer subdivisions, gives the triple integral in the definition. This also explains why a density depending on position must remain inside the integral: its value can change from one small volume to another.
Radial Density in a Ball
A radial density depends only on the distance from the origin: \(\delta(\rho,\phi,\theta)=f(\rho)\). For a full ball of radius \(R\), the bounds are \(0\leq\rho\leq R\), \(0\leq\phi\leq\pi\), and \(0\leq\theta\leq2\pi\). The angular factors can be evaluated independently of the radial density:
This reduction applies to a full ball centered at the origin with radial density. It does not automatically apply to a region that covers only part of the sphere, because its angular bounds may not contribute the full factor \(4\pi\).
Worked Example: A Ball with Density Increasing with Distance
A ball of radius \(R\) metres has density \(\delta(\rho)=\delta_0(1+\rho/R)\), where \(\delta_0\) is measured in kilograms per cubic metre. Find its mass.
The region is a full ball, so use the radial formula. The density is nonnegative for \(0\leq\rho\leq R\). Substituting it gives
For the check, the result has units \((\text{kg}/\text{m}^3)(\text{m}^3)=\text{kg}\). The density is positive throughout the ball, and so is the computed mass. Substituting \(R=1\) metre and \(\delta_0=1\) kilogram per cubic metre gives \(M=7\pi/3\) kilograms, approximately \(7.33\) kilograms to two decimal places.
Density That Depends on Position
For a density that depends on one or more coordinates, first express those coordinates in spherical form. For example, the vertical coordinate is \(z=\rho\cos\phi\), while \(x/\rho=\sin\phi\cos\theta\) when \(\rho>0\). Then multiply the resulting density by \(\rho^2\sin\phi\) before integrating.
Worked Example: A Height-Dependent Density in an Upper Hemisphere
Consider the upper hemisphere of radius \(R\), with density \(\delta(x,y,z)=\delta_0(1+z/R)\). Here \(\delta_0\) is measured in kilograms per cubic metre. Since \(0\leq z\leq R\) in this region, the density is nonnegative. Find the mass.
The spherical bounds are \(0\leq\rho\leq R\), \(0\leq\phi\leq\pi/2\), and \(0\leq\theta\leq2\pi\). Substituting \(z=\rho\cos\phi\) gives
The angular integral used here is \(\int_0^{\pi/2}\sin\phi\,d\phi=1\) and \(\int_0^{\pi/2}\cos\phi\sin\phi\,d\phi=1/2\). As a check, the mass has units of kilograms and is positive. If the height-dependent part of the density were removed, the mass would be \(\delta_0\) times the upper hemisphere's volume, \(2\pi R^3/3\); the added term increases the mass by \(\pi\delta_0R^3/4\). Their sum is \(11\pi\delta_0R^3/12\), as computed.
Worked Example: An Angular Density in an Octant
Let \(E\) be the part of a ball of radius \(R\) in the first octant, where \(x,y,z\geq0\). Suppose its density is \(\delta=\delta_0(1+x/\rho)\) for \(\rho>0\). The value at the origin does not affect the integral. Find the mass.
In this octant, \(0\leq\phi\leq\pi/2\) and \(0\leq\theta\leq\pi/2\), with \(0\leq\rho\leq R\). Since \(x/\rho=\sin\phi\cos\theta\), the density is nonnegative. The integral is
For the angular calculation, the first term contributes \((\int_0^{\pi/2}\sin\phi\,d\phi)(\int_0^{\pi/2}d\theta)=\pi/2\). The second contributes \((\int_0^{\pi/2}\sin^2\phi\,d\phi)(\int_0^{\pi/2}\cos\theta\,d\theta)=(\pi/4)(1)=\pi/4\). The result has mass units, is positive, and exceeds the mass for constant density \(\delta_0\) in this octant, which would be \(\delta_0(\pi R^3/6)\). This increase is consistent with the added nonnegative density term.
A Common Mistake: Omitting the Volume Factor
A frequent error is to integrate the density over the angular and radial bounds but forget the factor \(\rho^2\) in the spherical volume element. For the ball in the first worked example, omitting \(\rho^2\) would produce the incorrect calculation
This is not a mass: its units are \((\text{kg}/\text{m}^3)(\text{m})=\text{kg}/\text{m}^2\), rather than kilograms. Restoring the missing factor gives
which has the correct units. The factor \(\rho^2\sin\phi\) belongs to the volume element in every spherical mass integral; it is not part of the density and should not be omitted when the density changes.
A Reliable Setup
Before evaluating a spherical mass integral, identify the region and density separately. The following sequence keeps those decisions distinct:
Translate its radial and angular extent into bounds for \(\rho\), \(\phi\), and \(\theta\).
Replace Cartesian coordinates using \(x=\rho\sin\phi\cos\theta\), \(y=\rho\sin\phi\sin\theta\), and \(z=\rho\cos\phi\), when needed.
Multiply the density by \(\rho^2\sin\phi\) and attach the three differentials.
Compute the integral, then check that its units and sign are consistent with mass.
The setup is valid when the chosen spherical bounds describe the region and the density is integrable there. If the region or density has different formulas on different parts, split the integral accordingly and add the resulting masses.
Check Your Understanding
For each question, identify the region, density, and spherical volume factor before carrying out any integration.
- Write the mass integral for a full ball of radius \(a\) with density \(\delta(\rho)=c\rho^2\), where \(c>0\).
- What spherical-coordinate expression replaces \(z\) in a density that depends on height?
- Give the spherical bounds for the first-octant part of a ball of radius \(R\).
- Why must a position-dependent density remain inside the triple integral?
- What units should result when density is measured in kilograms per cubic metre and the volume element in cubic metres?