# Volume of a hypersphere

In this appendix we will compute the volume of an ${\displaystyle \ell }$-dimensional hypersphere of radius ${\displaystyle R}$, which we call ${\displaystyle V_{\ell }(R)}$. This is defined as:

${\displaystyle V_{\ell }(R)=\int \Theta (R-|{\vec {p}}|)d{\vec {p}}}$
In order to calculate it we will use a "trick". First, we change variable defining ${\displaystyle {\vec {z}}}$ so that ${\displaystyle p_{i}=Rz_{i}}$ and thus[1]:
${\displaystyle V_{\ell }(R)=R^{\ell }\int \Theta (1-|{\vec {z}}|)d{\vec {z}}=R^{\ell }V_{\ell }(1)}$
We then have:
${\displaystyle {\frac {d}{dR}}V_{\ell }(R)=\ell R^{\ell -1}V_{\ell }(1)=\int \delta (|{\vec {p}}|-R)d{\vec {p}}}$
Multiplying both sides by ${\textstyle e^{-R^{2}}}$ and integrating over ${\displaystyle R}$ from ${\displaystyle 0}$ to infinity:
${\displaystyle V_{\ell }(1)\int _{0}^{\infty }e^{-R^{2}}\ell R^{\ell -1}dR=\int _{0}^{\infty }dR\int e^{-R^{2}}\delta (|{\vec {p}}|-R)d{\vec {p}}}$
The right hand side is equal to:
${\displaystyle \int _{0}^{\infty }dR\int e^{-R^{2}}\delta (|{\vec {p}}|-R)d{\vec {p}}=\int d{\vec {p}}\int _{0}^{\infty }e^{-R^{2}}\delta (|{\vec {p}}|-R)=\int d{\vec {p}}e^{-|{\vec {p}}|^{2}}}$
Therefore:
${\displaystyle \ell V_{\ell }(1)\int _{0}^{\infty }R^{\ell -1}e^{-R^{2}}dR=\int d{\vec {p}}\prod _{i=1}^{\ell }e^{-p_{i}^{2}}=\prod _{i=1}^{\ell }\underbrace {\int dp_{i}e^{-p_{i}^{2}}} _{\sqrt {\pi }}=\pi ^{\ell /2}}$
If we now define ${\textstyle t=R^{2}}$, in the integral in the left hand side of the equation we recognise the definition of Euler's ${\displaystyle \Gamma }$ function[2]:
${\displaystyle \ell \int _{0}^{\infty }R^{\ell -1}e^{-R^{2}}dR={\frac {\ell }{2}}\int _{0}^{\infty }e^{-t}t^{{\frac {\ell }{2}}-1}dt={\frac {\ell }{2}}\Gamma \left({\frac {\ell }{2}}\right)=\Gamma \left({\frac {\ell }{2}}+1\right)}$
This way the volume of an ${\displaystyle \ell }$-dimensional sphere of unit radius is ${\textstyle V_{\ell }(1)=\pi ^{\ell /2}/\Gamma \left({\frac {\ell }{2}}+1\right)}$, and thanks to the fact that ${\displaystyle V_{\ell }(R)=R^{\ell }V_{\ell }(1)}$, in the end we have:
${\displaystyle V_{\ell }(R)={\frac {R^{\ell }\pi ^{\ell /2}}{\Gamma \left({\frac {\ell }{2}}+1\right)}}}$
Let us verify that this formula returns the values we expect for ${\displaystyle \ell =2}$ and ${\displaystyle \ell =3}$. We first note that:
${\displaystyle \Gamma \left({\frac {1}{2}}\right)=\int _{0}^{\infty }e^{-t}t^{-1/2}dt={\sqrt {\pi }}}$
${\displaystyle \Gamma \left({\frac {5}{2}}\right)={\frac {3}{2}}\Gamma \left({\frac {3}{2}}\right)={\frac {3}{2}}\cdot {\frac {1}{2}}\Gamma \left({\frac {1}{2}}\right)={\frac {3}{4}}{\sqrt {\pi }}}$
This way:
${\displaystyle V_{2}(R)={\frac {R^{2}\pi ^{2/2}}{\Gamma (2)}}={\frac {\pi R^{2}}{1!}}=\pi R^{2}\quad \quad V_{3}(R)={\frac {R^{3}\pi ^{3/2}}{{\frac {3}{4}}{\sqrt {\pi }}}}={\frac {4}{3}}\pi R^{3}}$

which is exactly what we expected.
1. We also use the fact that ${\displaystyle \Theta (R(1-z))=\Theta (1-z)}$, since ${\displaystyle R>0}$.
2. As a remainder, the ${\displaystyle \Gamma }$ function is defined as:
${\displaystyle \Gamma (n)=\int _{0}^{\infty }e^{-t}t^{n-1}dt}$
If ${\displaystyle n\in \mathbb {N} }$, then ${\displaystyle \Gamma (n)=(n-1)!}$.