TExcelTAD
Home › Calculus in Depth › Triple Integrals in Cylindrical Coordinates

Triple Integrals in Cylindrical Coordinates

Cylindrical coordinates are polar coordinates in the xyxy-plane with the height zz kept as it is. They turn solids with an axis of symmetry (cylinders, cones, paraboloids, pipes, drill holes) into boxes in (r,θ,z)(r, \theta, z), and make their triple integrals short. The key fact is the volume element dV=r dz dr dθdV = r\,dz\,dr\,d\theta.

The survey course introduces double and triple integrals in Double and Triple Integrals.

Polar double integrals come first: Double Integrals in Polar Coordinates.

The coordinate system

A point PP has cylindrical coordinates (r,θ,z)(r, \theta, z), where (r,θ)(r, \theta) are the polar coordinates of its shadow in the xyxy-plane and zz is its height:

x=rcos⁡θ,y=rsin⁡θ,z=zr2=x2+y2,tan⁡θ=y/x,z=z\begin{aligned} x &= r \cos\theta, & y &= r \sin\theta, & z &= z \\ r^2 &= x^2 + y^2, & \tan\theta &= y/x, & z &= z \end{aligned}
Equation Surface
r=cr = c circular cylinder of radius cc around the zz-axis
θ=c\theta = c half-plane through the zz-axis
z=cz = c horizontal plane
z=rz = r cone z=x2+y2z = \sqrt{x^2 + y^2}
z=r2z = r^2 paraboloid z=x2+y2z = x^2 + y^2
r=2cos⁡θr = 2 \cos\theta cylinder (x−1)2+y2=1(x - 1)^2 + y^2 = 1

To recover θ\theta from (x,y)(x, y) in code, use atan2(y, x), which picks the correct quadrant; atan(y/x) cannot tell (1,1)(1, 1) from (−1,−1)(-1, -1).

The volume element

A cylindrical wedge {r1≤r≤r2, θ1≤θ≤θ2, z1≤z≤z2}\{r_1 \le r \le r_2,\ \theta_1 \le \theta \le \theta_2,\ z_1 \le z \le z_2\} with small Δr\Delta r, Δθ\Delta\theta, Δz\Delta z has base area ≈r Δr Δθ\approx r\,\Delta r\,\Delta\theta (a polar rectangle: its curved sides have lengths r Δθr\,\Delta\theta and the radial sides Δr\Delta r) and height Δz\Delta z, so its volume is approximately

ΔV≈r Δr Δθ Δz  ⟹  dV=r dz dr dθ\Delta V \approx r\,\Delta r\,\Delta\theta\,\Delta z \qquad \implies \qquad dV = r\,dz\,dr\,d\theta

(The factor rr is also the Jacobian determinant ∣∂(x,y,z)∂(r,θ,z)∣\left\lvert \frac{\partial(x, y, z)}{\partial(r, \theta, z)} \right\rvert, see Change of Variables.) For a solid E={(r,θ)∈D, u1(x,y)≤z≤u2(x,y)}E = \{(r, \theta) \in D,\ u_1(x, y) \le z \le u_2(x, y)\} with DD a polar region α≤θ≤β\alpha \le \theta \le \beta, h1(θ)≤r≤h2(θ)h_1(\theta) \le r \le h_2(\theta):

∭Ef dV=∫αβ∫h1(θ)h2(θ)∫u1(rcos⁡θ,rsin⁡θ)u2(rcos⁡θ,rsin⁡θ)f(rcos⁡θ,rsin⁡θ,z) r dz dr dθ\iiint_E f\,dV = \int_\alpha^\beta \int_{h_1(\theta)}^{h_2(\theta)} \int_{u_1(r \cos\theta, r \sin\theta)}^{u_2(r \cos\theta, r \sin\theta)} f(r \cos\theta, r \sin\theta, z)\,r\,dz\,dr\,d\theta

Tip: Forgetting the rr is the single most common mistake. A quick check: ∫02π∫0R∫0hr dz dr dθ\int_0^{2\pi} \int_0^R \int_0^h r\,dz\,dr\,d\theta must give the cylinder volume πR2h\pi R^2 h.

Example: the ice-cream cone

EE lies above the cone z=rz = r and below the sphere x2+y2+z2=8x^2 + y^2 + z^2 = 8, i.e. z=8−r2z = \sqrt{8 - r^2}. They meet where r2=8−r2r^2 = 8 - r^2, r=2r = 2, at height z=2z = 2. So

V=∫02π∫02∫r8−r2r dz dr dθ=2π∫02(r8−r2−r2)dr=2π[−13(8−r2)3/2−r33]02=2π[(−83−83)+13⋅83/2]=2π3(162−16)=32π3(2−1)≈13.88\begin{aligned} V &= \int_0^{2\pi} \int_0^2 \int_r^{\sqrt{8-r^2}} r\,dz\,dr\,d\theta \\ &= 2\pi \int_0^2 \left(r\sqrt{8 - r^2} - r^2\right) dr \\ &= 2\pi \left[ -\tfrac{1}{3} (8 - r^2)^{3/2} - \frac{r^3}{3} \right]_0^2 \\ &= 2\pi \left[ \left(-\tfrac{8}{3} - \tfrac{8}{3}\right) + \tfrac{1}{3} \cdot 8^{3/2} \right] \\ &= \frac{2\pi}{3} (16\sqrt{2} - 16) = \frac{32\pi}{3} (\sqrt{2} - 1) \approx 13.88 \end{aligned}
python · try it yourself
import sympy as sp

r, th, z = sp.symbols("r theta z", nonnegative=True)
lim = [(z, r, sp.sqrt(8 - r**2)), (r, 0, 2), (th, 0, 2 * sp.pi)]
V = sp.integrate(r, *lim)
Mz = sp.integrate(z * r, *lim)
print("volume:", sp.simplify(V), "≈", round(float(V), 4))
print("centroid height z̄:", sp.nsimplify(sp.simplify(Mz / V)), "≈", round(float(Mz / V), 4))
volume: 32*pi*(-1 + sqrt(2))/3 ≈ 13.8804
centroid height z̄: 3/4 + 3*sqrt(2)/4 ≈ 1.8107

Example: an integral that wants cylindrical coordinates

∫−22∫−4−x24−x2∫x2+y22(x2+y2) dz dy dx\int_{-2}^{2} \int_{-\sqrt{4-x^2}}^{\sqrt{4-x^2}} \int_{\sqrt{x^2+y^2}}^{2} (x^2 + y^2)\,dz\,dy\,dx

The xx, yy limits describe the disk r≤2r \le 2, and zz runs from the cone z=rz = r up to the plane z=2z = 2. In cylindrical coordinates:

∫02π∫02∫r2r2⋅r dz dr dθ=2π∫02r3(2−r) dr=2π(8−325)=16π5\int_0^{2\pi} \int_0^2 \int_r^2 r^2 \cdot r\,dz\,dr\,d\theta = 2\pi \int_0^2 r^3 (2 - r)\,dr = 2\pi \left(8 - \frac{32}{5}\right) = \frac{16\pi}{5}

Moment of inertia of a cylinder

A solid cylinder of radius RR, height hh and constant density ρ\rho has mass M=ρπR2hM = \rho\pi R^2 h. Its moment of inertia about its axis is

Iz=∭(x2+y2) ρ dV=ρ∫02π∫0R∫0hr2⋅r dz dr dθ=ρ⋅2π⋅h⋅R44=12MR2I_z = \iiint (x^2 + y^2)\,\rho\,dV = \rho \int_0^{2\pi} \int_0^R \int_0^h r^2 \cdot r\,dz\,dr\,d\theta = \rho \cdot 2\pi \cdot h \cdot \frac{R^4}{4} = \tfrac{1}{2} M R^2

A thin-walled tube of the same mass has I=MR2I = M R^2 (all mass at distance RR), so a solid wheel is easier to spin up than a hoop. A rotating game object's inertia tensor contains exactly these numbers.

python · try it yourself
import numpy as np

rng = np.random.default_rng(11)
R, h, rho = 0.5, 2.0, 1.0
M = rho * np.pi * R**2 * h

# Monte Carlo in cylindrical coordinates: sample r with density ∝ r (r = R·√u) so points are uniform in volume
N = 200_000
r = R * np.sqrt(rng.random(N))
I_mc = M * np.mean(r**2)
print(f"I_z exact ½MR² = {0.5 * M * R**2:.5f}   Monte Carlo = {I_mc:.5f}")

# the classic mistake: r uniform in [0, R] crowds points near the axis
r_bad = R * rng.random(N)
print(f"with r uniform (wrong)     = {M * np.mean(r_bad**2):.5f}")
I_z exact ½MR² = 0.19635   Monte Carlo = 0.19664
with r uniform (wrong)     = 0.13122

Sampling rr uniformly ignores the factor rr in dVdV: it puts as many points in the thin inner ring as in the wide outer ring, so it underestimates the inertia by a third (the expected value of r2r^2 becomes R2/3R^2/3 instead of R2/2R^2/2).

In software

  • Uniform sampling of disks and cylinders. r=Rur = R\sqrt{u}, θ=2πv\theta = 2\pi v (uu, vv uniform on [0,1][0, 1]) is the standard way to pick random points in a disk for particle emitters, sampling area lights and depth-of-field lens samples; the square root is the factor rr of dAdA in disguise (inverse-CDF sampling of the density 2r/R22r/R^2).
  • Physics. Inertia of wheels, shafts, capsules and cylinder colliders; buoyancy volumes of partially submerged cylinders.
  • CAD/CAM and manufacturing. Volumes removed by drills and lathe cuts are solids of revolution integrated in cylindrical coordinates.

Exercises

Exercise 1: Convert

Convert the point with Cartesian coordinates (−1,1,5)(-1, 1, 5) to cylindrical coordinates, and describe the surface r=4sin⁡θr = 4 \sin\theta.

Answer

(2,3π4,5)\left(\sqrt{2}, \frac{3\pi}{4}, 5\right). r=4sin⁡θr = 4 \sin\theta is the circular cylinder x2+(y−2)2=4x^2 + (y - 2)^2 = 4.

Solution
r=1+1=2,θ=atan2⁡(1,−1)=3π4,z=5r=4sin⁡θ  ⟹  r2=4rsin⁡θ  ⟹  x2+y2=4y  ⟹  x2+(y−2)2=4\begin{aligned} &r = \sqrt{1 + 1} = \sqrt{2}, \quad \theta = \operatorname{atan2}(1, -1) = \frac{3\pi}{4}, \quad z = 5 \\ &r = 4 \sin\theta \implies r^2 = 4r \sin\theta \implies x^2 + y^2 = 4y \implies x^2 + (y - 2)^2 = 4 \end{aligned}

No zz appears, so the surface is a vertical cylinder over that circle.

Exercise 2: Volume between paraboloids

Find the volume of the solid between z=x2+y2z = x^2 + y^2 and z=8−x2−y2z = 8 - x^2 - y^2.

Answer

16π≈50.2716\pi \approx 50.27.

Solution

They meet where r2=8−r2r^2 = 8 - r^2, r=2r = 2.

V=∫02π∫02∫r28−r2r dz dr dθ=2π∫02(8r−2r3) dr=2π(16−8)=16πV = \int_0^{2\pi} \int_0^2 \int_{r^2}^{8-r^2} r\,dz\,dr\,d\theta = 2\pi \int_0^2 (8r - 2r^3)\,dr = 2\pi (16 - 8) = 16\pi

Exercise 3: Mass with variable density

A cylinder r≤1r \le 1, 0≤z≤30 \le z \le 3 has density ρ=1+r\rho = 1 + r (heavier at the rim). Find its mass.

Answer

5π≈15.7085\pi \approx 15.708.

Solution
m=∫02π∫01∫03(1+r) r dz dr dθ=2π⋅3⋅(12+13)=6π⋅56=5πm = \int_0^{2\pi} \int_0^1 \int_0^3 (1 + r)\,r\,dz\,dr\,d\theta = 2\pi \cdot 3 \cdot \left(\frac{1}{2} + \frac{1}{3}\right) = 6\pi \cdot \frac{5}{6} = 5\pi

Exercise 4: Check by code

Evaluate ∭Ez dV\iiint_E z\,dV, where EE is inside the cylinder x2+y2=4x^2 + y^2 = 4, above z=0z = 0 and below the plane z=4−yz = 4 - y, both with SymPy in cylindrical coordinates and with SciPy's tplquad in Cartesian coordinates.

Answer

34π≈106.81434\pi \approx 106.814.

Solution
∫02π∫02∫04−rsin⁡θzr dz dr dθ=∬(4−rsin⁡θ)22⋅r dr dθ=∫02π∫02(8r−4r2sin⁡θ+r3sin⁡2θ2)dr dθ=16⋅2π−0+2⋅π=34π\begin{aligned} \int_0^{2\pi} \int_0^2 \int_0^{4 - r \sin\theta} z r\,dz\,dr\,d\theta &= \iint \frac{(4 - r \sin\theta)^2}{2} \cdot r\,dr\,d\theta \\ &= \int_0^{2\pi} \int_0^2 \left(8r - 4r^2 \sin\theta + \frac{r^3 \sin^2\theta}{2}\right) dr\,d\theta \\ &= 16 \cdot 2\pi - 0 + 2 \cdot \pi = 34\pi \end{aligned}

The middle term vanishes because ∫02πsin⁡θ dθ=0\int_0^{2\pi} \sin\theta\,d\theta = 0, and the last one uses ∫02r32 dr=2\int_0^2 \frac{r^3}{2}\,dr = 2 and ∫02πsin⁡2θ dθ=π\int_0^{2\pi} \sin^2\theta\,d\theta = \pi. Both computations below agree.

python · try it yourself
import sympy as sp
import numpy as np
from scipy import integrate
r, th, z = sp.symbols("r theta z")
I = sp.integrate(z * r, (z, 0, 4 - r * sp.sin(th)), (r, 0, 2), (th, 0, 2 * sp.pi))
print(I, round(float(I), 3))
val, _ = integrate.tplquad(lambda z, y, x: z, -2, 2, lambda x: -np.sqrt(4 - x*x), lambda x: np.sqrt(4 - x*x),
                           lambda x, y: 0, lambda x, y: 4 - y)
print(round(val, 3))
34*pi 106.814
106.814

Test yourself

What is the volume element in cylindrical coordinates?

  1. dz dr dθdz\,dr\,d\theta
  2. r dz dr dθr\,dz\,dr\,d\theta
  3. r2 dz dr dθr^2\,dz\,dr\,d\theta
  4. rsin⁡θ dz dr dθr \sin\theta\,dz\,dr\,d\theta

In cylindrical coordinates, the equation z=rz = r describes…

  1. a cylinder
  2. a plane
  3. a paraboloid
  4. a cone

To pick uniform random points in a disk of radius RR, choose θ=2πv\theta = 2\pi v and r=r = …

  1. R⋅uR \cdot u
  2. R⋅uR \cdot \sqrt{u}
  3. R⋅u2R \cdot u^2
  4. R/uR/u