Triple Integrals

Earth's density is not one number. Squeezed by the weight of everything above it, the iron core is packed roughly three times denser than the rock near the surface. So what is the planet's total mass? You can't just multiply a single density by the volume of a sphere — the density itself changes as you go deeper. You need to add up density through an entire volume, a little chunk at a time. That is exactly what a triple integral does.

A double integral adds a function over a flat region. Add one more dimension and you integrate over a solid E in space. The triple integral

\iiint_E f(x, y, z)\, dV

sums f over every infinitesimal box dV = dx\, dy\, dz packed into E. If f is a density, the result is total mass; if f \equiv 1, it is the plain volume of the solid:

\operatorname{vol}(E) = \iiint_E 1\, dV.

Iterated integrals: integrate from the inside out

Just as Fubini turned a double integral into two nested single integrals, a triple integral unwinds into three. Integrate the innermost variable first (the others held constant), then the middle, then the outer.

Worked example — a box [0,1]\times[0,2]\times[0,3]

Step 1 — set up the iterated integral for f(x,y,z) = xyz over the box. All limits are constants:

\iiint_E xyz\, dV = \int_0^1 \!\int_0^2 \!\int_0^3 xyz\; dz\, dy\, dx.

Step 2 — innermost integral (over z). Hold x, y fixed and pull them out:

\int_0^3 xyz\, dz = xy \left[ \frac{z^2}{2} \right]_0^3 = xy \cdot \frac{9}{2} = \frac{9}{2} xy.

Step 3 — middle integral (over y). Now integrate the result over y, holding x fixed:

\int_0^2 \frac{9}{2} xy\, dy = \frac{9}{2} x \left[ \frac{y^2}{2} \right]_0^2 = \frac{9}{2} x \cdot 2 = 9x.

Step 4 — outer integral (over x).

\int_0^1 9x\, dx = 9 \left[ \frac{x^2}{2} \right]_0^1 = \frac{9}{2}.

So \iiint_E xyz\, dV = \tfrac92. (Because the box has constant limits and the integrand factors as x \cdot y \cdot z, the whole thing also equals \big(\int_0^1 x\, dx\big)\big(\int_0^2 y\, dy\big)\big(\int_0^3 z\, dz\big) = \tfrac12 \cdot 2 \cdot \tfrac92 = \tfrac92 — a handy check.)

Worked example — mass of a cube with variable density

Now make it physical. A cube of material occupies [0,1]\times[0,1]\times[0,1], and its density grows toward the far corner: \rho(x,y,z) = x+y+z (in mass per unit volume). What is its total mass?

Step 1 — set up. Mass is density integrated over the solid:

M = \iiint_E (x+y+z)\, dV = \int_0^1\!\int_0^1\!\int_0^1 (x+y+z)\, dz\, dy\, dx.

Step 2 — innermost (z). Hold x,y fixed:

\int_0^1 (x+y+z)\, dz = (x+y)\cdot 1 + \left[\frac{z^2}{2}\right]_0^1 = x+y+\frac12.

Step 3 — middle (y). Integrate what's left over y:

\int_0^1 \left(x+y+\frac12\right) dy = x + \left[\frac{y^2}{2}\right]_0^1 + \frac12 = x+1.

Step 4 — outer (x).

\int_0^1 (x+1)\, dx = \left[\frac{x^2}{2}\right]_0^1 + 1 = \frac32.

The cube weighs M = \tfrac32 mass-units. Sanity check by symmetry: x, y and z play identical roles over this cube, so each of \iiint x\, dV, \iiint y\, dV, \iiint z\, dV must equal the same value — \tfrac12 — and three copies of \tfrac12 add to \tfrac32, exactly as found.

Worked example — a tetrahedron, building the limits from a sketch

Boxes have the same limits on every variable, which makes them the easy case. A genuinely 3-dimensional shape — the solid tetrahedron x \ge 0,\ y \ge 0,\ z \ge 0,\ x+y+z \le 1 — forces you to actually look at the region before you can write a single integral sign. Find its volume.

Step 1 — build the limits inside-out, from a sketch. Picture the solid: it is bounded below by the floor z=0 and above by the slanted plane z = 1-x-y. So for any fixed (x,y) inside its shadow, z runs

0 \le z \le 1-x-y.

Now flatten your gaze onto the xy-plane: the tetrahedron's shadow is the triangle x \ge 0,\ y \ge 0,\ x+y \le 1. For fixed x, y runs from the axis up to the sloped edge:

0 \le y \le 1-x, \qquad 0 \le x \le 1.

Step 2 — write and evaluate the iterated integral for f\equiv 1:

V = \int_0^1\!\int_0^{1-x}\!\int_0^{1-x-y} 1\, dz\, dy\, dx.

Step 3 — innermost (z). Trivial, since the integrand is 1:

\int_0^{1-x-y} 1\, dz = 1-x-y.

Step 4 — middle (y). Write u = 1-x for a moment so the algebra is clean:

\int_0^{u} (u-y)\, dy = \left[uy - \frac{y^2}{2}\right]_0^{u} = u^2 - \frac{u^2}{2} = \frac{u^2}{2} = \frac{(1-x)^2}{2}.

Step 5 — outer (x).

V = \int_0^1 \frac{(1-x)^2}{2}\, dx = \frac12 \left[-\frac{(1-x)^3}{3}\right]_0^1 = \frac12 \cdot \frac13 = \frac16.

The classic payoff: a unit tetrahedron carved out of a unit cube by a single slanted plane holds exactly \tfrac16 of the cube's volume. The hard part was never the calculus — it was reading the limits off the sketch correctly.

Coordinates that match the solid's symmetry

Boxes are easy; cylinders and spheres are not, in Cartesian coordinates. As in the polar case, the cure is to change coordinates — and the volume element picks up a Jacobian factor.

Cylindrical coordinates: polar in the plane, plus a height

Use polar (r, \theta) for x, y and keep z as the height: x = r\cos\theta, y = r\sin\theta, z = z. The polar area element r\, dr\, d\theta simply gains a dz:

dV = r\, dz\, dr\, d\theta.

Worked example — volume of a cylinder, radius a, height h

Step 1 — set up with f \equiv 1. The solid is 0 \le r \le a, 0 \le \theta \le 2\pi, 0 \le z \le h:

V = \int_0^{2\pi} \!\int_0^a \!\int_0^h 1 \cdot r\, dz\, dr\, d\theta.

Step 2 — innermost (z). Nothing depends on z, so it contributes a factor h:

\int_0^h r\, dz = r h.

Step 3 — middle (r). Here the Jacobian r matters:

\int_0^a r h\, dr = h \left[ \frac{r^2}{2} \right]_0^a = \frac{a^2 h}{2}.

Step 4 — outer (\theta). A constant integrand over a full turn multiplies by 2\pi:

\int_0^{2\pi} \frac{a^2 h}{2}\, d\theta = 2\pi \cdot \frac{a^2 h}{2} = \pi a^2 h.

The familiar V = \pi a^2 h — base area times height — drops out, and the extra r was exactly what made it right.

Spherical coordinates: for balls and shells

For spherical symmetry use radius \rho, polar angle \varphi (down from the z-axis), and azimuth \theta: x = \rho\sin\varphi\cos\theta, y = \rho\sin\varphi\sin\theta, z = \rho\cos\varphi. Its volume element carries a \rho^2 \sin\varphi:

dV = \rho^2 \sin\varphi\; d\rho\, d\varphi\, d\theta.

For a continuous f on a solid E, the triple integral is an iterated integral whose volume element depends on the coordinates:

The art of a triple integral is rarely the integration — it is the setup, and the setup is dictated by the solid's symmetry. A rule of thumb:

For instance, the volume of a ball of radius a is brutal in Cartesian coordinates but a one-liner in spherical:

V = \int_0^{2\pi}\!\int_0^{\pi}\!\int_0^a \rho^2 \sin\varphi\; d\rho\, d\varphi\, d\theta = 2\pi \cdot 2 \cdot \frac{a^3}{3} = \frac{4}{3}\pi a^3.

(The three factors are \int_0^{2\pi} d\theta = 2\pi, \int_0^\pi \sin\varphi\, d\varphi = 2, and \int_0^a \rho^2\, d\rho = a^3/3.) Pick the coordinates the solid is shaped like, and the hard integral becomes three easy ones.

Three habits separate a clean triple-integral setup from a wrong one:

Nobody has ever lowered the Earth onto a giant scale, yet geophysicists will tell you its mass to four significant figures. The trick is a triple integral in spherical shells. Seismic waves bouncing through the planet reveal how density changes with depth — light silicate rock near the crust, crushingly dense iron-nickel down in the core — so density is really a function of one thing only: distance \rho from the centre. Slice the Earth into thin concentric shells, each at radius \rho with thickness d\rho, and add up density times shell volume, 4\pi\rho^2\, d\rho, from the centre out to the surface — precisely a spherical triple integral in which the \theta and \varphi integrations have already been done for you, leaving that tidy 4\pi\rho^2 shell area. Carry out the remaining single integral over \rho and out comes the mass of an entire world: about 5.97 \times 10^{24} kilograms — never touched, only integrated.

A medical CT scanner runs the same idea forward rather than backward: it never "sees" a volume directly, only thin 2-D X-ray slices. Software stacks those slices and effectively performs a triple integral over the body to reconstruct the 3-D density map your doctor looks at — \iiint, assembled one slice of a slice at a time.

See the solid sliced

A triple integral can be read as a stack of slices: integrate over a cross-section, then sweep the slice through the solid. This side-on view shows the solid's profile; drag the height slider to move the slicing plane and watch the cross-section's radius change. Switch the shape to feel how cylindrical (constant radius) and spherical (radius bulging in the middle) symmetries differ.

See it explained