Geometry

Spherical Coordinates

Radius, azimuth, and polar angle — the natural coordinates for anything centred on a point

Spherical coordinates (ρ, θ, φ) describe a point in three-dimensional space by its distance from the origin, its azimuthal angle around the z-axis, and its polar angle measured from the z-axis. The volume element is ρ²sin(φ) dρ dθ dφ, derived from the Jacobian of the change of variables. Spherical coordinates simplify integrals with radial symmetry — gravitational and electrostatic fields, the hydrogen atom, atmospheric models, multipole expansions. The convention varies: physics texts (ISO 80000-2) usually take φ as the polar angle from z and θ as the azimuth; mathematics texts often swap them.

  • Coordinatesρ ∈ [0, ∞), θ ∈ [0, 2π), φ ∈ [0, π]
  • Volume elementdV = ρ²sin(φ) dρ dθ dφ
  • Jacobian determinant|J| = ρ²sin(φ)
  • x, y, zx = ρ sin(φ) cos(θ); y = ρ sin(φ) sin(θ); z = ρ cos(φ)
  • Used forGravity, electrostatics, atomic orbitals, GPS, antennas
  • Singular atρ = 0 and φ = 0, π (the poles)

Watch the 60-second explainer

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

Three numbers locate any point in space

Spherical coordinates replace the three Cartesian numbers (x, y, z) with three numbers of a more geometric character:

  • ρ (rho) — the radial distance from the origin. Always non-negative.
  • θ (theta) — the azimuthal angle, measured counter-clockwise around the z-axis from the positive x-axis. Range: 0 to 2π.
  • φ (phi) — the polar angle (also called colatitude or zenith angle), measured from the positive z-axis. Range: 0 to π. φ = 0 is the north pole; φ = π/2 is the equator; φ = π is the south pole.

The relationship to Cartesian coordinates is best read off a sketch. Drop a perpendicular from the point P to the xy-plane, hitting it at P'. The segment OP' has length ρ sin(φ) — the radius of the latitude circle. Its x and y components are ρ sin(φ) cos(θ) and ρ sin(φ) sin(θ). The vertical lift OP'P has height ρ cos(φ). So:

x = ρ sin(φ) cos(θ)
y = ρ sin(φ) sin(θ)
z = ρ cos(φ)

Inversely:

ρ = √(x² + y² + z²)
θ = atan2(y, x)
φ = arccos(z / ρ)

(The function atan2 returns θ in the right quadrant, unlike plain arctan, which has a 180° ambiguity.)

Deriving the volume element ρ²sin(φ) dρ dθ dφ

An infinitesimal cell in spherical coordinates is bounded by surfaces of constant ρ, θ, and φ. Pictured: a curved brick whose three sides are arcs of three different radii.

  • The radial side has length — this one is just a straight segment.
  • The polar (north-south) side is an arc of the great circle of radius ρ, subtending angle dφ. Length: ρ dφ.
  • The azimuthal (east-west) side is an arc of the latitude circle of radius ρ sin(φ), subtending angle dθ. Length: ρ sin(φ) dθ.

The infinitesimal volume is the product:

dV = dρ · ρ dφ · ρ sin(φ) dθ = ρ² sin(φ) dρ dθ dφ

The same result follows mechanically from the Jacobian determinant. With (u₁, u₂, u₃) = (ρ, θ, φ),

J = ∂(x, y, z)/∂(ρ, θ, φ) =
    | sin φ cos θ    −ρ sin φ sin θ    ρ cos φ cos θ |
    | sin φ sin θ     ρ sin φ cos θ    ρ cos φ sin θ |
    | cos φ                0          −ρ sin φ        |

|det J| = ρ² sin(φ)

Expanding the determinant along the third row and simplifying with cos²θ + sin²θ = 1 gives ρ² sin(φ). Either derivation is valid; the geometric one is more memorable.

Worked example — the volume of a ball

The volume of a solid ball of radius R is the integral of dV over the region 0 ≤ ρ ≤ R, 0 ≤ θ < 2π, 0 ≤ φ ≤ π:

V = ∫₀^R ∫₀^{2π} ∫₀^π ρ² sin(φ) dφ dθ dρ
  = ∫₀^R ρ² dρ · ∫₀^{2π} dθ · ∫₀^π sin(φ) dφ
  = (R³/3) · 2π · 2
  = (4/3) π R³

The integrals separated because the integrand factors and the limits are constants — the kind of clean factorisation only spherical coordinates allow. Try this in Cartesians and you will need ∫√(R² − x²) terms and the trigonometric substitution from hell.

Integrating a radial function

If f depends only on ρ — say f(ρ) — the angular integrals collapse:

∫∫∫ f(ρ) dV = ∫₀^∞ f(ρ) ρ² dρ · ∫₀^{2π} dθ · ∫₀^π sin(φ) dφ
            = 4π ∫₀^∞ f(ρ) ρ² dρ

This is the workhorse formula. The mass of a star with radial density profile ρ_m(r) is 4π ∫ ρ_m(r) r² dr. The total charge in a spherically symmetric cloud is 4π ∫ ρ_q(r) r² dr. The probability of finding an electron in a hydrogen 1s orbital between radii a and b is 4π ∫_a^b |ψ(r)|² r² dr. Same integral; different physics.

Gravity outside a uniform shell

One classic application — Newton's shell theorem. A spherically symmetric mass distribution with total mass M produces, at any external point at distance r from the centre, the same gravitational field as a point mass M at the centre.

The proof is a direct integral in spherical coordinates. Place the field point on the z-axis at distance r > R. The potential at that point from a thin shell of radius a (with surface density σ) is:

Φ = −G ∫∫ σ / d  dA

where d = √(r² + a² − 2ar cos φ) is the distance from a shell point to the field point and dA = a² sin(φ) dθ dφ is the shell area element. Substituting u = cos φ (so du = −sin φ dφ), the φ integral becomes elementary, and θ integrates to 2π. The total potential collapses to −GM/r — exactly the potential of a point mass at the origin. The shell theorem falls out of the geometry.

Cartesian vs cylindrical vs spherical — comparison

CartesianCylindricalSpherical
Coordinates(x, y, z)(r, θ, z)(ρ, θ, φ)
Volume elementdx dy dzr dr dθ dzρ² sin(φ) dρ dθ dφ
Jacobian1rρ² sin(φ)
Best symmetryBoxes, planesCylinders, pipes, vortex flowBalls, central forces, atoms
Singular pointsNoner = 0 (axis)ρ = 0; φ = 0, π
Gradient ∂/∂(coord 1)∂/∂x∂/∂r∂/∂ρ
Laplacian radial part∂²/∂x² + ...(1/r) ∂/∂r(r ∂/∂r)(1/ρ²) ∂/∂ρ(ρ² ∂/∂ρ)
Natural forCubes, latticesPipes, cans, wiresPlanets, atoms, antennas

The Jacobians explain everything. The lone "1" for Cartesians says boxes don't shrink as you move through them. The factor "r" for cylindricals says the azimuthal arc length r dθ shrinks as you approach the axis. The factor "ρ² sin(φ)" for sphericals says you simultaneously shrink in the polar arc and in the latitude circle as you approach the poles.

Gradient, divergence, and Laplacian

In spherical coordinates the differential operators acquire metric factors:

∇f = (∂f/∂ρ) ρ̂ + (1/ρ)(∂f/∂φ) φ̂ + (1/(ρ sin φ))(∂f/∂θ) θ̂

∇·F = (1/ρ²) ∂(ρ² F_ρ)/∂ρ
     + (1/(ρ sin φ)) ∂(sin φ · F_φ)/∂φ
     + (1/(ρ sin φ)) ∂F_θ/∂θ

∇²f = (1/ρ²) ∂/∂ρ (ρ² ∂f/∂ρ)
    + (1/(ρ²sin φ)) ∂/∂φ (sin φ ∂f/∂φ)
    + (1/(ρ²sin²φ)) ∂²f/∂θ²

The 1/ρ and 1/(ρ sin φ) factors come from the same arc-length scales that determine the volume element. Each angular derivative ∂/∂(angle) needs to be divided by the corresponding arc length so that ∇f has units of (units of f) per metre, not (units of f) per radian.

For a radially symmetric function f(ρ), the angular derivatives vanish and ∇²f reduces to (1/ρ²) d/dρ (ρ² df/dρ) — equivalently, (1/ρ) d²(ρf)/dρ². This is why Coulomb's potential −1/ρ has Laplacian zero everywhere except the origin.

Multipole expansion and spherical harmonics

Any function on the sphere f(θ, φ) can be expanded as a sum of spherical harmonics Yₗᵐ(θ, φ):

f(θ, φ) = Σ_{ℓ=0}^∞ Σ_{m=−ℓ}^{ℓ} c_{ℓm} Y_{ℓm}(θ, φ)

The Yₗᵐ are eigenfunctions of the angular Laplacian with eigenvalue −ℓ(ℓ+1). Combined with radial functions Rₙₗ(ρ), they form a complete basis for solving the Laplace and Helmholtz equations in spherical regions. The hydrogen atom's wavefunctions ψ_{n,ℓ,m}(ρ, θ, φ) = Rₙₗ(ρ) Yₗᵐ(θ, φ) are the canonical example.

The same spherical harmonics describe the cosmic microwave background's temperature anisotropy (the famous "power spectrum" Cₗ comes from squaring its harmonic coefficients), the geomagnetic field, gravitational fields of non-spherical planets, and acoustic radiation patterns. They are the angular Fourier basis for the universe.

Where spherical coordinates earn their keep

  • Gravitational and electrostatic fields. Around a point mass or point charge, the field has spherical symmetry. Spherical coordinates make Gauss's law trivial — the flux through a sphere equals the enclosed mass or charge times a constant.
  • The hydrogen atom. The Schrödinger equation separates into radial and angular pieces; the angular part is solved by spherical harmonics, the radial part by Laguerre polynomials. Quantum numbers (n, ℓ, m) are labels in this spherical decomposition.
  • Geophysics and atmospheres. Earth's gravitational field, the geoid, atmospheric pressure profiles, tides — all naturally written in spherical coordinates with the planet's centre at ρ = 0.
  • GPS and astronomy. Right ascension and declination are spherical coordinates of the celestial sphere. Positions on Earth use latitude (related to π/2 − φ) and longitude (θ).
  • Antenna radiation patterns. The far field of an antenna is a function on the sphere; gain patterns are usually plotted as G(θ, φ).
  • Cosmology. Maps of the cosmic microwave background and large-scale galaxy distributions live on the celestial sphere; their power spectra are spherical-harmonic decompositions.

Common mistakes

  • θ–φ swap. The single most common error. Always confirm whether your textbook's φ is from z (physics convention) or from the equator. The volume element looks the same but the formulas for x, y, z change.
  • Forgetting sin(φ) in the volume element. The naive ρ² dρ dθ dφ misses the latitude factor — your "volume of a ball" comes out to π² R³ instead of (4/3)π R³.
  • arctan instead of atan2. Plain arctan returns θ in (−π/2, π/2), losing quadrant information. Always use atan2(y, x), which uses the signs of x and y to return θ in the full (−π, π].
  • Using radians vs degrees inconsistently. Mixing degree-mode trig with radian formulas is a classic source of factor-of-(180/π) errors.
  • Treating ρ̂, θ̂, φ̂ as constant. The unit vectors of spherical coordinates rotate as you move through space — they are functions of position. ∂ρ̂/∂φ ≠ 0, which is why the divergence formula has those metric factors.
  • Forgetting metric factors in ∇ and ∇². The angular derivatives must be divided by the corresponding arc-length scales (ρ for φ, ρ sin φ for θ). Otherwise units don't match and the answer is wrong by powers of ρ.

Frequently asked questions

Why is the volume element ρ²sin(φ) dρ dθ dφ?

It is the absolute value of the determinant of the Jacobian matrix of the transformation (ρ, θ, φ) → (x, y, z). Geometrically, an infinitesimal cell in spherical coordinates is a curved box with sides dρ (radial), ρ sin(φ) dθ (azimuthal arc), and ρ dφ (polar arc). Multiplying these gives ρ²sin(φ) dρ dθ dφ. The sin(φ) factor accounts for the shrinking azimuthal circles as you approach the poles.

What is the difference between the physics and mathematics conventions?

The ISO 80000-2 convention (used in physics, engineering, and most modern textbooks) names ρ the radial distance, θ the azimuthal angle (around z), and φ the polar angle (from z). The traditional mathematics convention swaps θ and φ — θ from z, φ around z. Always check which convention a source uses before plugging into a formula. The volume element ρ²sin(polar angle) dρ d(azimuth) d(polar angle) is the same; only the letter changes.

Why are spherical coordinates good for the hydrogen atom?

The Coulomb potential between proton and electron depends only on radial distance: V(r) = −e²/(4πε₀ r). In spherical coordinates the Laplacian separates as a radial piece plus an angular piece, and the Schrödinger equation factors into a radial equation R(ρ) and an angular equation Y(θ, φ). The angular part is solved by spherical harmonics; the radial part by associated Laguerre polynomials. The resulting orbitals are labelled by quantum numbers (n, ℓ, m) — labels that exist because the symmetry of the problem is spherical.

How do I integrate over a ball of radius R?

Set ρ from 0 to R, θ from 0 to 2π, and φ from 0 to π. The volume is ∫₀^R ∫₀^{2π} ∫₀^π ρ²sin(φ) dφ dθ dρ = (4/3)πR³. For a function f(ρ) that depends only on radius, the angular integrals collapse to 4π and you are left with 4π ∫₀^R f(ρ) ρ² dρ — the workhorse formula for Gauss's law applied to spherical charge distributions, gravitational shells, and atomic orbitals.

Why does sin(φ) appear and not cos(φ)?

Because φ is measured from the positive z-axis, the radius of the latitude circle at polar angle φ is ρ sin(φ). At the north pole (φ = 0) and south pole (φ = π), this radius collapses to zero, which is why integrals near the poles weight by sin(φ). If instead you measured the angle from the equator (latitude rather than colatitude), you would get cos. Pilots and navigators commonly use latitude, so flight-physics textbooks sometimes look different from physics textbooks — it is the same geometry written from a different reference.

What is the gradient in spherical coordinates?

∇f = (∂f/∂ρ) ρ̂ + (1/ρ)(∂f/∂φ) φ̂ + (1/(ρ sin φ))(∂f/∂θ) θ̂. The 1/ρ and 1/(ρ sin φ) factors are inverse arc-length scales — they convert angular derivatives into derivatives per unit physical distance. The corresponding Laplacian is ∇²f = (1/ρ²) ∂/∂ρ(ρ² ∂f/∂ρ) + (1/(ρ²sin φ)) ∂/∂φ(sin φ ∂f/∂φ) + (1/(ρ²sin²φ)) ∂²f/∂θ². Forgetting the metric factors is one of the most common student errors.

Are spherical coordinates singular at the poles?

Yes — at ρ = 0 and at the poles φ = 0 and φ = π, the coordinate map is not invertible. Multiple (θ, φ) pairs name the same physical point (e.g., the entire φ = 0 circle is the north pole). For most calculus this is fine — the singular points form a measure-zero set and integrals work — but for differential geometry you need overlapping charts to cover the sphere smoothly. This is why no single coordinate system covers a sphere globally without singularity (the hairy ball theorem is a topological cousin of this fact).