José A. CañizoResearch · Publications · Teaching · Other

Calculating the volume of the unit ball

The volume of the unit ball in Euclidean $d$-dimensional space $\R^d$ is the well known value \begin{equation*} v_d := \frac{\pi^{d/2}}{\Gamma\big(\frac{d}{2}+1 \big)}, \qquad d \geq 1. \end{equation*} There are several ways to calculate it, and even a direct integration of the constant function $1$ over the region $B := \{x \in \R^d \mid |x| < 1 \}$ can yield the value with a little bit of work. I want to record here a method using Gaussian integrals which is especially nice, since it is also related to some integrals that appear in my work for different reasons. Of course, the Wikipedia page on the volume of the $d$-dimensional ball contains an explanation of several methods to calculate it, including the one I am writing about here; but I still want to talk about it, perhaps from a different point of view.

We will need the following formula for the integral of a radially symmetric function, which can be obtained by integrating in spherical coordinates: for any function $f \colon (0,+\infty) \to \R$ we have \begin{equation} \label{eq:1} \ird f(|x|) \d x = \omega_d \int_0^\infty r^{d-1} f(r) \d r, \end{equation} as long as the latter integral is well defined. Here $\omega_d$ denotes the area (the $d-1$-dimensional volume) of the unit sphere $S^{d-1} := \{x \in \R^d \mid |x|=1 \}$ in dimension $d$. Applying this to the function $f$ which is $1$ on $(0,1)$ and $0$ for $r \geq 1$ we obtain \begin{equation*} \omega_d = d v_d, \end{equation*} so from the value of $\omega_d$ or $v_d$ we easily have the other one also.

The key beautiful idea is the following: due to formula \eqref{eq:1}, if we find any function $f$ for which we are able to calculate the left hand side, then we will obtain the value of $\omega_d$, since the right hand side contains a one-dimensional integral which is usually easier to calculate.

Which radially symmetric function is easiest to integrate? Perhaps a function that is written as a product in every coordinate as \begin{equation} \label{eq:2} f(|x|) = g(x_1) g(x_2) \dots g(x_d), \end{equation} since then the integral can be written as a product of one-dimensional integrals. Observe that the function must be the same for each coordinate, by rotational symmetry. It turns out that the only radially symmetric functions that can be written as in \eqref{eq:2} are Gaussians. This is a beautiful fact all by itself, which is loosely connected to the theory of the Boltzmann equation (it can be used to show that the only functions for which the entropy production is $0$ for the Kac equation must be Gaussians; there is a similar argument due to Boltzmann which works for the Boltzmann equation—-see section 4.3 of this review by Villani). It can be shown that this is even true for any function which is invariant by a 90 degree rotation (see this paper by Carlen). But of course we don’t need to know this; it is enough to choose \begin{equation*} f(|x|) = e^{-|x|^2} = \Pi_{i=1}^d e^{-x_i^2} \end{equation*} to obtain \begin{equation*} \ird f(|x|) \d x = \pi^{d/2}, \end{equation*} which takes care of the left hand side of \eqref{eq:1}. For the right hand side, the change of variables $s = r^2$ shows \begin{equation*} \int_0^\infty r^{d-1} e^{-r^2} \d r = \frac{1}{2} \int_0^\infty s^{\frac{d-2}{2}} e^{-s} \d s = \frac{1}{2} \Gamma(d/2), \end{equation*} which from \eqref{eq:1} gives then \begin{equation*} \omega_d = \frac{2 \pi^{d/2}}{\Gamma(d/2)} \end{equation*} and hence \begin{equation*} v_d = \frac{\omega_d}{d} = \frac{2 \pi^{d/2}}{d \Gamma\big( \frac{d}{2} \big)} = \frac{\pi^{d/2}}{\Gamma\big( \frac{d}{2}+1 \big)}, \end{equation*} since $(d/2)\Gamma(d/2) = \Gamma(d/2 + 1)$ due to the properties of the Gamma function, which behaves in a similar way to the factorial.