How a map stretches area, the Jacobian that measures it, spherical coordinates, and why balls in high dimensions are nearly empty
The right coordinates can turn a hopeless integral into an easy one, but changing coordinates changes the size of the pieces you add up. A map from one plane to another stretches some regions and squeezes others, and one number, the Jacobian determinant, says by how much at every point. Watch a grid bend, build a ball from shells, and follow the volume of a ball into dimensions where almost all of it is peel.
Pick a map and drag the highlighted cell around the left-hand grid. Its image on the right is a curved quadrilateral; shrink the cell and watch it straighten into the parallelogram whose area is |det J| times the original. Animate the morph to see the grid warp out of the identity.
Colour shows the area factor: sky where the map keeps orientation, rose where it reverses it, brighter where area is stretched more (on a log scale). The morph is (1 − s)(u, v) + s T(u, v), so midway the readouts refer to that blended map. The image area is measured by the shoelace formula on 128 points around the curved boundary; the partial derivatives in J are exact, from the symbolic differentiator.
Near a point, a smooth map T(u, v) = (x(u, v), y(u, v)) is almost linear. Moving by Δu changes the image by about T_u Δu, where T_u = (x_u, y_u) is the vector of partial derivatives in u, and moving by Δv changes it by about T_v Δv. So a small rectangle of sides Δu and Δv goes to something very close to the parallelogram spanned by those two vectors, and the area of a parallelogram is the absolute value of a determinant:
area ≈ |det J| Δu Δv, J = [ x_u x_v ; y_u y_v ], det J = x_u y_v − x_v y_u
Cutting a region into such cells, adding up f times the image areas and letting the cells shrink gives the change of variables formula
∬_R f(x, y) dx dy = ∬_S f(x(u, v), y(u, v)) |det J| du dv
where T carries S one-to-one onto R. For polar coordinates det J = r, which is the r in r dr dθ from Double and Triple Integrals. The sign of det J says whether T keeps or reverses orientation: a reflection has determinant −1, and the fold in the demo has det J = 2v, negative on the half it turns over. Where det J = 0 the map crushes area to nothing, like polar coordinates at r = 0.
Euler worked out the change of variables for double integrals in 1769, and Lagrange extended it to triple integrals in 1773 while computing the gravitational attraction of ellipsoids. The determinants are named after Carl Gustav Jacob Jacobi, who studied these functional determinants systematically in 1841.
Move the point with the sliders and watch its three coordinate surfaces follow. The amber box is a step of each coordinate: compare its exact volume with the product of its edges, then switch to cylindrical coordinates, or build a ball out of shells.
Conventions: θ is the angle around the z-axis, as in polar coordinates, and φ is measured down from the positive z-axis (many physics books swap the two letters). Drag to orbit the scene. The exact box volume is (ρ₂³ − ρ₁³)/3 · (cos φ₁ − cos φ₂) · Δθ in spherical coordinates and (r₂² − r₁²)/2 · Δθ · Δz in cylindrical; the volume element is evaluated at the box’s inner corner, the white dot.
Spherical coordinates locate a point by its distance ρ from the origin, its angle θ around the z-axis and its angle φ down from the positive z-axis:
x = ρ sin φ cos θ, y = ρ sin φ sin θ, z = ρ cos φ
Stepping each coordinate a little sweeps out a box with three nearly perpendicular edges. Changing ρ moves the point straight out, a distance dρ. Changing φ swings it along a circle of radius ρ, a distance ρ dφ. Changing θ swings it around the z-axis along a circle of radius ρ sin φ, its distance from the axis, a distance ρ sin φ dθ. Multiplying the three gives the volume element
dV = ρ² sin φ dρ dφ dθ
and this is exactly |det J| for the map (ρ, φ, θ) ↦ (x, y, z), a 3 × 3 determinant that works out to ρ² sin φ. The volume of a ball of radius R is then ∫₀^2π ∫₀^π ∫₀ᴿ ρ² sin φ dρ dφ dθ = 2π · 2 · R³/3 = 4πR³/3. Integrating out the two angles first leaves ∫₀ᴿ 4πρ² dρ: a ball is a stack of spherical shells of area 4πρ² and thickness dρ, which is how the ball in the demo is built.
Cylindrical coordinates (r, θ, z) are polar coordinates in the xy-plane with height added. Only the θ-edge is stretched, by r, so dV = r dr dθ dz. Use them when a solid has an axis of symmetry, like a cylinder, a cone or a paraboloid, and spherical coordinates when it has a centre.
The volume of the unit ball rises and then falls as the dimension grows. Throw darts at the cube around it and watch the hit rate collapse; then switch to the peel view to see where a high-dimensional ball keeps its volume.
Darts are uniform in the cube [−1, 1]ⁿ (500 per frame); the right panel shows the most recent 2,500 by their first two coordinates, so the circle is the ball’s shadow, not a slice of it. Exact volumes use Γ from the Lanczos approximation, accurate to about 15 digits. Vₙ is the volume of the ball of radius 1; a ball of radius R has volume Vₙ Rⁿ, so “the volume peaks at n = 5” is a statement about the unit radius only.
The unit ball in n dimensions is the set where x₁² + … + xₙ² ≤ 1, and scaling it by R scales its volume by Rⁿ. To find Vₙ, use polar coordinates in just the last two variables. For a fixed (xₙ₋₁, xₙ) at distance r from the origin, the remaining n − 2 coordinates fill a ball of radius √(1 − r²), of volume Vₙ₋₂ (1 − r²)^((n−2)/2). Integrating over the disc with dA = r dr dθ:
Vₙ = ∫₀^2π ∫₀¹ Vₙ₋₂ (1 − r²)^((n−2)/2) r dr dθ = (2π/n) Vₙ₋₂
Starting from V₀ = 1 (a point) and V₁ = 2 (the segment [−1, 1]) this gives V₂ = π, V₃ = 4π/3, V₄ = π²/2, V₅ = 8π²/15 ≈ 5.264, and the closed form Vₙ = π^(n/2)/Γ(n/2 + 1), where Γ is Euler’s gamma function, with Γ(k + 1) = k! and Γ(½) = √π. The recursion explains the peak: each step multiplies by 2π/n, which is bigger than 1 until n reaches 7, so the even volumes grow up to V₆ and the odd ones up to V₅; after that the factors fall below 1 and Vₙ races to zero faster than any exponential. (The peak at n = 5 belongs to radius 1; a different radius moves it.)
The cube [−1, 1]ⁿ has volume 2ⁿ, which grows without bound, so the ball’s share Vₙ/2ⁿ collapses: already in ten dimensions it is a quarter of a percent. And because volume scales like Rⁿ, the ball of radius 1 − ε holds only (1 − ε)ⁿ of the unit ball’s volume; the rest, nearly all of it when n is large, lies in a thin outer shell. These facts are everyday working knowledge in statistics and machine learning, where data live in hundreds of dimensions: random points are almost all near the boundary, and almost all pairs of them are far apart.
Spot a mistake or have an idea?