Calculus

Triple Integrals

Add up a function over a 3D region — volume, mass, charge, moment

A triple integral ∭_V f(x,y,z) dV adds up the values of a function across a 3D region. Cartesian coordinates use dV = dx dy dz; cylindrical coordinates use dV = r dz dr dθ; spherical coordinates use dV = ρ² sinφ dρ dφ dθ. Match the coordinate system to the shape and the integral collapses.

  • Cartesian dVdx dy dz
  • Cylindrical dVr dz dr dθ
  • Spherical dVρ² sinφ dρ dφ dθ
  • Volume of a ball(4/3)πR³
  • Mass with density ρ_d∭_V ρ_d dV

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

What a triple integral computes

A double integral adds up a function over a 2D region — area weighted by f. A triple integral does the same one dimension up: chop a 3D region V into tiny boxes of volume dV, multiply f at the center of each box, and sum.

∭_V f(x,y,z) dV = lim Σᵢ f(xᵢ, yᵢ, zᵢ) ΔVᵢ as the boxes shrink.

If f ≡ 1, you're just adding up volume — the integral returns Vol(V). If f is a mass density ρ_d(x,y,z), you get total mass. If f is charge density, you get total charge. The same machinery handles moment of inertia (f = r² × density), gravitational potential, and average values.

Cartesian coordinates

The simplest setup. Pick an order — say dz dy dx — and write nested limits:

∭_V f dV = ∫_{a}^{b} ∫_{g₁(x)}^{g₂(x)} ∫_{h₁(x,y)}^{h₂(x,y)} f(x,y,z) dz dy dx.

The outer integral has constant limits, the middle limits depend on x, and the innermost depends on x and y. Cartesian coordinates work well on rectangular boxes, prisms, and regions sandwiched between two graphs z = h₁(x,y) and z = h₂(x,y).

Cylindrical coordinates

Replace (x, y) with polar (r, θ): x = r cosθ, y = r sinθ, and keep z. The volume element gains a factor of r:

dV = r dz dr dθ.

The extra r is the Jacobian of the polar transform — a sliver at radius r and angular width dθ has arc length r dθ, so its area is r dr dθ. Cylindrical coordinates excel on regions with vertical-axis symmetry: cylinders, paraboloids, cones with apex on the z-axis.

Spherical coordinates

Spherical coordinates use the radial distance ρ from the origin, the polar angle φ from the +z axis (0 ≤ φ ≤ π), and the azimuthal angle θ around the z-axis (0 ≤ θ ≤ 2π):

  • x = ρ sinφ cosθ
  • y = ρ sinφ sinθ
  • z = ρ cosφ

The volume element is dV = ρ² sinφ dρ dφ dθ. The ρ² accounts for radial scaling — a thin spherical shell at radius ρ has area proportional to ρ² — and the sinφ accounts for the fact that latitude lines shrink near the poles.

Cartesian vs cylindrical vs spherical

CartesianCylindricalSpherical
Coordinates(x, y, z)(r, θ, z)(ρ, φ, θ)
Volume element dVdx dy dzr dz dr dθρ² sinφ dρ dφ dθ
Best regionsBoxes, slabs, prismsCylinders, paraboloids, donutsBalls, shells, cones at origin
Common bound shapesz between two graphsr ≤ R(θ), z between two surfacesρ between ρ_min(φ,θ) and ρ_max(φ,θ)
Range of angular varθ ∈ [0, 2π)φ ∈ [0, π], θ ∈ [0, 2π)
Jacobian factor1rρ² sinφ
PitfallHard limits for round shapesForgetting the rConfusing φ with θ; sin vs cos

Worked example: volume of a ball

Volume of a ball of radius R using spherical coordinates:

V = ∫₀^{2π} ∫₀^π ∫₀^R ρ² sinφ dρ dφ dθ.

The radial integral is ∫₀^R ρ² dρ = R³/3. The polar integral is ∫₀^π sinφ dφ = 2. The azimuthal integral is ∫₀^{2π} dθ = 2π. Multiplying:

V = (R³/3) · 2 · 2π = (4/3)πR³.

That's Archimedes' result, recovered in three lines.

Worked example: mass of a ball with radial density

Suppose the density grows linearly with the distance from the center: ρ_d(ρ) = kρ. The mass is

M = ∫₀^{2π} ∫₀^π ∫₀^R kρ · ρ² sinφ dρ dφ dθ = k · (R⁴/4) · 2 · 2π = πkR⁴.

For a general radial density ρ_d(r) = k r^n, the same computation gives M = 4πk R^{n+3} / (n+3). Constant density (n=0) recovers M = (4/3)πkR³ — total volume times density, as it should.

Worked example: moment of inertia of a solid cylinder

The moment of inertia of a solid cylinder of radius R, height h, uniform density ρ_d about its central axis is the integral of r² (squared distance from axis) times density:

I = ∫₀^{2π} ∫₀^R ∫₀^h r² · ρ_d · r dz dr dθ = ρ_d · 2π · h · ∫₀^R r³ dr = (1/2) ρ_d · 2π · h · R⁴ / 2.

Multiplying out: I = (π ρ_d h R⁴) / 2. Since the cylinder's mass is M = ρ_d · πR² h, this simplifies to I = (1/2) M R² — the textbook result, derived without memorising it.

Setting up the bounds

Choosing the order of integration is the trickiest part. A reliable recipe:

  1. Sketch the region V — at least its 2D projection onto the floor (xy-plane).
  2. Pick the innermost variable. Its limits are functions of the other two; they describe the "height" of V above each base point.
  3. The middle variable's limits are functions of the outer variable; they describe the projection.
  4. The outer variable has constant limits — the extreme range of that coordinate.

If the bounds look ugly in one coordinate system, reorder, or switch to cylindrical or spherical. Half the work of triple integration is choosing well; once the bounds are right, the integration is mechanical.

Where triple integrals show up

  • Mass and center of mass. Total mass is ∭_V ρ_d dV; the x-coordinate of the center of mass is (1/M) ∭_V x ρ_d dV.
  • Moment of inertia. I_z = ∭_V (x² + y²) ρ_d dV — the rotational analogue of mass.
  • Gravitational potential. The potential at point P from a body V with density ρ_d is −G ∭_V ρ_d / |P − r| dV.
  • Probability. A trivariate probability density f(x,y,z) integrated over a region gives the probability of an event in that region.
  • Heat content. Total heat in a body is ∭_V c ρ_d T dV where c is specific heat and T temperature.
  • Electromagnetism. Total charge inside a region is ∭_V ρ_charge dV; magnetic dipole moment is (1/2) ∭_V r × J dV.

Common mistakes

  • Dropping the Jacobian factor. Cylindrical needs the extra r; spherical needs ρ² sinφ. Forgetting them computes a meaningless quantity in coordinate space, not real volume.
  • Wrong order of integration. The innermost variable's limits depend on the outer two; the outer variable must have constant limits. Mixing this up gives the wrong region.
  • φ vs θ confusion in spherical. Conventions differ — physicists often swap φ and θ. Pick one (the math convention used here: φ from the z-axis, θ azimuthal) and stick with it for the whole integral.
  • Forgetting that sinφ is non-negative on [0,π]. So |sinφ| = sinφ in spherical bounds — no absolute value needed there.
  • Setting up the bounds without a sketch. A 2D projection onto the floor takes 30 seconds and prevents an hour of confusion later.

Frequently asked questions

What does a triple integral compute?

It adds up f(x,y,z) over a 3D region V. With f as density, you get total mass; with f = 1, you get volume. More generally: charge, moment of inertia, average values, gravitational potential.

When should I use cylindrical or spherical coordinates?

Cylindrical (r, θ, z) for vertical-axis symmetry: cylinders, paraboloids, cones whose apex sits on the z-axis. Spherical (ρ, φ, θ) for spherical symmetry: balls, shells, cones at the origin. Matching the coordinate system to the symmetry usually collapses the integral.

Why does dV gain extra factors in cylindrical and spherical coordinates?

Each tiny coordinate box has different physical dimensions. A wedge of arc length r dθ contributes dV = r dz dr dθ in cylindrical. In spherical, an arc of ρ dφ in the polar direction and ρ sinφ dθ in azimuth gives dV = ρ² sinφ dρ dφ dθ. These are the Jacobians of the change of variables.

How do you compute the mass of a sphere with radial density?

If ρ_d(r) = k r^n, the mass is ∫₀^{2π} ∫₀^π ∫₀^R k r^n · r² sinφ dr dφ dθ = 4π k R^{n+3} / (n+3). Constant density (n=0) gives (4/3)πk R³ as expected.

How do you set up the bounds for a triple integral?

Outer limits constant; middle limits depend on the outer variable; innermost limits depend on the outer two. Sketch the region's 2D projection to read the outer/middle bounds; let the heights above each base point give the innermost.

What's the difference between a triple integral and a surface integral?

A triple integral covers a 3D solid (the inside of a ball, a slab). A surface integral covers a 2D surface in 3D (the surface of the ball, a face of the slab). The divergence theorem connects the two: ∯_S F·dS = ∭_V (∇·F) dV.