This post series summarizes some properties of spheres and ellipsoids in a n-dimensional Euclidean space. In addition we are going to study some special integrals over the volume of so called n-spheres and their surfaces. As a preparatory step we look at some useful properties of the so called Gamma-function, which almost automatically appears when one works with integrals in the ℝn and its standard 2-norm.
Spheres and ellipsoids in the ℝn are mathematically interesting by themselves. But they are also intimately related to the statistics of data samples, whose data point densities approximate Multivariate Normal Distributions [MVNs] at least in a coherent central region. Samples for real world objects, which show signs of an underlying MVN in parts of their multidimensional property space, occur e.g. in the context of Machine Learning.
Editorial remark, 12/28/2025: This post has been revised to avoid confusion with the standard definition of a “n-spheres” as n-dimensional manifolds.
Problem context(s)
Readers of this blog know that I lately wrote and still write about limited dense cores of multivariate data distributions in a parallel post series (see [1]). Cores whose internal distribution of data points approximate a MVN can numerically be analyzed and this analysis can be based on some analytic formulas. Among other things we can use the core’s data to estimate the covariance matrix of the infinite MVN – even if the sample’s real distribution strongly deviates from a MVN outside the core.
Such estimations require the evaluation of certain MVN-related integrals with Gaussians and additional terms over the volume and surface of a so called “n-ball“. The volume of a “n-ball” in the ℝn is surrounded by a (n-1)-dimensional radially symmetric surface – a so called “(n-1)-sphere” (see below for the terminology). The evaluation of the required integrals also plays a central role in numerical algorithms which automatically identify and analyze a MVN-like core of an otherwise asymmetric data distribution.
Outlook on the contents of this series and some conventions
Regarding the volume of spheres and ellipsoids in the ℝn, I present compact and relatively simple mathematical derivations. While the surface area of a “(n-1)-sphere” in the ℝn can be found by using scaling arguments, the calculation and/or approximation of the surface area of a “(n-1)–ellipsoid” is a notoriously complex problem. I discuss its relation to Gaussian distributions – and explore an exact expression found by I. Rivin; see [9] in the reference section. The central mathematical term of his formula can be approximated very well by rather simple numerical methods. I will show that this works well for some lower-dimensional examples – for which other well founded approximation formulas exist.
Why do I repeat some derivations, which can be found in references listed in the last section of this post? Well, I think the following: There is some deep wisdom buried in the mathematical argumentation. Very similar to the question, why the integral over a Gaussian exponential up to infinity should give us a result including the irrational number π. Statistics (in particular that of normal distributions), geometry and the calculus of volume and surface integrals in the ℝn are deeply interconnected. People and SW-engineers working in the field of Machine Learning should be or become aware of this inter-relation. This is actually an objective of this blog.
Regarding notation:
When we speak of a sphere or ellipsoid, we usually refer to a certain closed surface, a continuous manifold, which encloses a volume in a multidimensional space. We have to be careful to avoid contradictions with the standard definitions of “n-spheres” or “n-ellipsoids”. These terms typically refer to n-dimensional manifolds – surfaces – in the ℝn+1 enclosing a (n+1)-dimensional “volume” there. A (n-1)-sphere in this sense is the surface of a n-dimensional “ball” volume. In this terminology, the number of dimensions “n” refers to the dimensionality of the closed surface and not to the space it is embedded in. This is sometimes confusing.
In this post “n” stands for the number of dimensions of the space we work in, i.e. in the ℝn. A super-script “S” of a symbol indicates that we discuss a property of a (n-1)-sphere in the ℝn, whereas a superscript “E” indicates a property of an (n-1)-ellipsoid.
For a measured surface area we use the cursive big letter “S“, for a measured volume the letter “V“. The respective sets of data points will be symbolized by {V} and {S}. We use “(n-1)” as a subscript for surfaces to indicate their dimensionality. For the enclosed volume we instead use “n” as a subscript for the very same reason, namely dimensionality. (In a previous version of this article, I had used the same subscript “n” for surface and enclosed volume, but this has obviously created a bit of confusion for some readers used to other conventions).
Subscripts “r” or “R” indicate a variable radius r or a fixed radius R, respectively. The i-th semi-axes (= half-axes) of an ellipsoid is named ai, its inverse qi. A position vector from the origin to a data point is written as r = x = (x1, x2, …xn)T. r is given by the Euclidean 2-norm ||x||2 of a position vector x, i.e. by the vector’s “length”. Both volumes and surface areas of n-spheres and n-ellipsoids can be regarded as continuous and differentiable functions VS(r) and SS(r) of a radius r or a Mahalanobis distance dm, in the case of an ellipsoid, respectively.
With these definitions, we can already write down some elementary relations :
The last relation is based on symmetry conditions and reflects an integration over infinitesimal spherical shells in polar coordinates. For details see a section below.
Properties of the Gamma-function
When working with integrands containing Gaussian-like functions, one stumbles across the so called Gamma-function, which is also defined for complex numbers z that have a positive real part R(z); in particular negative integers are not allowed [2]:
For real z = s ∈ ℝ, this can be rewritten as
This relation also holds for complex α with R(α) > 0 [A].
The Gamma-function has a lot of nice properties:
The first one motivates its role as a generalization of the factorial function to complex numbers. Most of the relations reflect a recursive character of the Gamma function. Relation (8) is known as the so called Sterling approximation. (There are, of course, many more noteworthy properties of the Gamma-function … but the above ones are those which play a major role in our context.)
Relation to certain definite integrals involving the Gaussian function
Notably, the Gamma-function Γ(n/2) for an argument (n/2) is related to the following integrals
The last integral is one which often appears in the context of standardized Multivariate Normal Distributions; its form is close to integrals over a radial variable. But (15) is also important both for calculating the volume and the surface area of n-spheres and the volume of n-dim ellipsoids. This may come as a small surprise; but see the derivations discussed below.
We shall in addition see in forthcoming posts that the version of the integral in (15) for finite radial limits is given by complicated sums of terms containing the Gamma-function.
Volume and surface of a (n-1)-sphere in the ℝn
The volume VSn,R and the surface SSn-1,R of a sphere of radius r = R in the ℝn are given by the following formulas
These equs. can be derived from dimension and scaling arguments based on the volume vn,1 = VSn,1 and surface sn-1,1 = SSn-1,1 of unit spheres in the ℝn:
This is shown in [3] and [4]; but see my personal variant of the proof in [3] in the section below. Another derivation from first principles via induction is e.g. given by M. Jorgensen in [3]. The proof based on scaling is interesting because it relates sn-1,1 with a definite integral of a Gaussian function.
Hint: When you plot the variation of the unit sphere’s volume vn,1 as a function of the dimension n, you would find that the volume appears to approach vn,1 → 0. The reason is:
Despite the insight that a multidimensional space offers more dimensions to fill, you should be careful with interpretations. The claim that the volume shrinks to zero, should not be taken too literally. We would first need to define a proper reference measure in n dimensions. Otherwise we would compare objects in different dimensions – which does not make much sense. One reasonable interpretation is that the unit sphere takes less and less volume of an encompassing n-dim cube. An other interesting aspect is the ratio of the unit sphere’s volume to its surface area. This is shrinking with growing n. For details, an analysis and a proper interpretation see [8].
Derivation of the formulas for (n-1)-spheres
We start with the integral over the spherical volume written down in Cartesian coordinates:
We can safely assume [see e.g. [5] and [6]) that a spherical volume of radius r differs from the volume of the unit sphere by a scaling factor rn:
Of course, we consider vn,1 to be a radius independent constant ωn. Eqs. (22) follow on the one hand side from symmetry and dimension arguments for the scaling operation. But they also follow from basic principles regarding linear transformations of compact measurable sets {A} in the ℝn and linear transformations L. See e.g. [5] and [6]. The finite measure μ transforms as
In our case eqs. (22) result from the following transformation
Due to symmetry reasons, we can perform our integration (21) in spherical polar coordinates using infinitesimally thin spherical shells (in n dimensions):
But, as we regard V and S as continuous functions of r, this means due to the fundamental rule of calculus:
So far, so good. Let us call a surface element of the n-dim sphere expressed in polar coordinates ds:
ds includes a complicated series of successive projections of a vector r onto lower-dimensional sub-spaces of the ℝn. Respective terms correspond to the Jacobian matrix for the transformation from Cartesian to spherical polar coordinates in n dimensions. The Jacobian would give us a lot of trigonometric relations regarding (n-1) angles and a factor rn-1. The details are e.g. given in [7]. We can omit the details here.
The r-dependency can be taken from (22):
Eq. (31) reflects setting r=1 in (26). We still have to derive ωn = vn,1. The problem here appears to be the yet unknown complex internal structure of integral (31) over angle space. But, instead of following the trigonometry explained in [7], we use a trick:
If we had a definite integral that included the angle dependent part, but could be solved in the radial part AND over all space, then maybe we would get a valid expression. Well, there is such an integral – and here we go with one of the beautiful wonders in math:
The first relation (34) defines just a product of integrals over Gaussians, each giving a factor π1/2. Due to eq. (15) above, the integral in (34) is a term for the Gamma-function Γ(n/2). I.e.:
With the help of (31) and (14) we get the results:
This in turn means:
While these results refer to volume and surface of a (n-1)-sphere in established standard terminology, the reader can simply adjust the results to the ℝn+1 to get the results for a conventional “n-sphere”. An investigation what the use of other norms than || ||2 would mean for our results is given in [3].
Conclusion
In this post we have evaluated integrals giving us the volume and surface of n-spheres. In the next post of this series
we will derive a formula for the volume enclosed by an ellipsoid in the ℝn.
Links and literature
[1] R. Mönchmeyer, 2025, “Covariance matrix of a cut-off Multivariate Normal Distribution – II – integrals over volume and surface of an n-dimensional sphere”, blog post at
https://machine-learning.anracom.com/2025/12/12/covariance-matrix-of-a-cut-off-multivariate-normal-distribution-ii-integrals-over-volume-and-surface-of-an-n-dimensional-sphere/
[2] Wikipedia on the “Gamma Function”, https://en.wikipedia.org/wiki/Gamma_function
[3] M.Jorgensen, 2014, “Volumes of n-dimensional spheres and ellipsoids”,
https://www.whitman.edu/Documents/Academics/Mathematics/2014/jorgenmd.pdf
[4] M.G. Rozman, 2017, “The surface area and the volume of n-dimensional sphere”,
https://www.phys.uconn.edu/~rozman/Courses/P2400_17S/downloads/nsphere.pdf
[5] C. Blatter, 1974, “Analysis III”, Kap. 23 & 24, Heidelberger Taschenbücher, Springer Verlag
[6] O. Forster, 1981, “Analysis 3”, Kap. 5, Verlag Friedr,. Vieweg & Sohn
[7] J.A. Shapiro, 2012, “Hyperspherical coordinates (in N dimensions)”,
https://www.physics.rutgers.edu/grad/618/lects/hypersph.pdf
[8] M. Ivanov, 2022, “On Volumes of N-Dimensional Spheres”, Blog post at
https://mikeivanov.com/posts/2022-02-12-spheres/
[9] I. Rivin, 2003, “Surface Area of Ellipsoids”, DOI: 10.48550/arXiv.math/0306387,
https://arxiv.org/abs/math/0306387v4