I remember, when I was an undergrad, at one of the beginner courses for physics, the teacher was lecturing about how to convert coordinates to and from Polar, Cylindrical, and Cartesian and how to get the equation for the volume for a sphere or the area for a circle.

So, at the time, I thought, why not increase the number of dimensions used in the method. I was at the time able to get the equation for the volume of a 4-Dimensional Sphere and shortly after that the n-Dimensional Sphere. Now, I am not saying that this is the first time someone has used this to derive the equations, but, at the time, I had a sense of discovery. In this article, I will go over the calculation made so long ago but, at the same time, fill in the holes that remained because of lack of experience as I write this article.

# Cartesian coordinate system

The Cartesian coordinate system is a coordinate system, whose idea was first published by René Descartes in 1637. A point on the coordinate system is denoted on fixed perpendicular lines. In two dimensions, we have two perpendicular lines, each an axis.

In three dimensions, we have three perpendicular lines.

In four dimensions, it becomes slightly more completed since we live in 3 Dimensional world so visualizing these 4 dimensions is near impossible without the help of mathematics. We can, however, orient our 4 perpendicular lines so that the 4th, new, lines denotes our 4th dimension.

There is, however, another way of expressing the point in space in 2-Dimensions. We can measure the distance the point is from the origin, or the zero point, and the angle between the positive x-axis and the a line pointing at the point. We can see that the range of values for the angle, $\theta$, is between $0$ and $2\pi$. So, in turn, we can figure out what the cartisiean coordinates are from the polar coordinates with the following equations

\begin{align}
x&=r\cos{\theta} \\
y&=r\sin{\theta}
\end{align}
For 3-Dimensions, start with a projection, for a point, onto the xy-plane therefore leaving us with the equation for polar coordinates and a zero for the $z$.
\begin{align}
x&=r\cos{\theta} \\
y&=r\sin{\theta} \\
z&=0
\end{align}
Now, we need another rotation denoting variable in order to represent rotation into the z-axis, I will use $\varphi$. We only need to denote the angle between the positive z-axis and the point, the range for the angle is between $0$ and $\pi$, leading to the equations.
\begin{align}
x&=r\sin{\varphi}\cos{\theta} \\
y&=r\sin{\varphi}\sin{\theta} \\
z&=r\cos{\varphi}
\end{align}
In the 4th Dimension, we take from the pattern in the last two and say that our next angle variable, $\zeta$, has a range between $0$ and $\pi$ and has the following transormation equations.
\begin{align}
x&=r\sin{\zeta}\sin{\varphi}\cos{\theta}\\
y&=r\sin{\zeta}\sin{\varphi}\sin{\theta}\\
z&=r\sin{\zeta}\cos{\varphi}\\
k&=r\cos{\zeta}
\end{align}

# Jacobian Matrices

In order to find the Area of a Circle, the Volume of a Sphere, or the, I'll call it, the volume of a 4 Dimensional Sphere we have a cool tool using matrices that are called Jacobian Matrices as they allow for a change of variables from the Cartesian system to the curved system, or any system and allow for integration. They are defined as the following

$$J=\begin{bmatrix}\frac{\partial f_1}{\partial x_1} & \dots & \frac{\partial f_1}{\partial x_n} \\ \vdots & \ddots & \vdots \\ \frac{\partial f_m}{\partial x_1} & \dots & \frac{\partial f_m}{\partial x_n} \end{bmatrix}$$
Where the functions, $f$, are the functions that transforms the coordinates. For example, for the conversion between 2D cartesian and polar coordinates the jacobian would be \begin{align}
J&=\begin{bmatrix}\frac{\partial x}{\partial r} & \frac{\partial x}{\partial \theta} \\ \frac{\partial y}{\partial r} & \frac{\partial y}{\partial \theta}\end{bmatrix} \\
&=\begin{bmatrix}\frac{\partial}{\partial r}(r\cos{\theta}) & \frac{\partial}{\partial \theta}(r\cos{\theta}) \\ \frac{\partial}{\partial r}(r\sin{\theta}) & \frac{\partial }{\partial \theta}(r\sin{\theta}) \end{bmatrix} \\
&=\begin{bmatrix}
\cos{\theta} & -r\sin{\theta} \\
\sin{\theta} & r\cos{\theta}
\end{bmatrix}
\end{align}
The determinant of the jacobian can then be used to tranform interals between coordinate systems letting us find the area of a circle.
\begin{align}
\int_{0}^{2\pi}\int_{0}^{r}\det{J}drd\theta&=\int_{0}^{2\pi}\int_{0}^{r}\begin{vmatrix}
\cos{\theta} & -r\sin{\theta} \\
\sin{\theta} & r\cos{\theta}
\end{vmatrix}drd\theta \\
&=\int_{0}^{2\pi}\int_{0}^{r} r(\sin^2(\theta)+\cos^2(\theta))drd\theta \\
&=\int_{0}^{2\pi}\int_{0}^{r} rdrd\theta \\
&=\pi r^2
\end{align}
The same can be done for the volume of the sphere with the spherical convertion resulting in $\frac{4}{3}\pi r^3$.

# 4D Hypersphere Volume

We already know the transformation from 4D Spherical to Cartesian coordinates so we can start to build our Jacobian Matrix. \begin{align}J&=
\begin{bmatrix}
\frac{\partial x}{\partial r} & \frac{\partial x}{\partial \theta} & \frac{\partial x}{\partial \phi} & \frac{\partial x}{\partial \zeta} \\
\frac{\partial y}{\partial r} & \frac{\partial y}{\partial \theta} &
\frac{\partial y}{\partial \phi} & \frac{\partial x}{\partial \zeta} \\
\frac{\partial z}{\partial r} & \frac{\partial z}{\partial \theta} &
\frac{\partial z}{\partial \phi} & \frac{\partial z}{\partial \zeta} \\
\frac{\partial k}{\partial r} & \frac{\partial k}{\partial \theta} &
\frac{\partial k}{\partial \phi} & \frac{\partial k}{\partial \zeta}
\end{bmatrix} \\
&=\begin{bmatrix}
\cos{\theta}\sin{\zeta}\sin{\varphi} & -r\sin{\zeta}\sin{\theta}\sin{\varphi} & r\cos{\theta}\cos{\varphi}\sin{\zeta} & r\cos{\zeta}\cos{\theta}\sin{\varphi} \\
\sin{\zeta}\sin{\theta}\sin{\varphi} &
r\cos{\theta}\sin{\zeta}\sin{\varphi} &
r\cos{\varphi}\sin{\zeta}\sin{\theta} &
r\cos{\zeta}\sin{\theta}\sin{\varphi} \\
\cos{\varphi}\sin{\zeta} & 0 &
-r\sin{\zeta}\sin{\phi} & r\cos{\zeta}\cos{\varphi} \\
\cos{\zeta} & 0 & 0 & -r\sin{\zeta}
\end{bmatrix}
\end{align}
After using Mathematica to find the determinant of the Jacobian we have $$\det{J}=r^3\sin^2{\zeta}\sin{\phi}$$ Now, to find the volume by integrating. $$\int_{0}^{\pi}\int_{0}^{\pi}\int_{0}^{2\pi}\int_{0}^{r}r^3\sin^2{\zeta}\sin{\phi}drd\theta d\phi d\zeta=\frac{\pi^2r^4}{2}$$ We can do the same for the next couple of dimensions to have the following sequence.

$n$ $2$ $3$ $4$ $5$ $6$
$V_n(r)$ $\pi r^2$ $\frac{4\pi r^3}{3}$ $\frac{\pi^2 r^4}{2}$ $\frac{8\pi^2 r^5}{15}$ $\frac{\pi^3 r^6}{6}$

# nD Sphere

Let's try to define an equation that generates the nD volume. Let's call it $V_n(r)$. We can see that the radius' power has the value of n so, we can set it as so with an unknown constant multiplier. $$V_n(r)=c_nr^n$$ Our constants are

$n$ $2$ $3$ $4$ $5$ $6$
$c_n$ $\pi$ $\frac{4\pi}{3}$ $\frac{\pi^2}{2}$ $\frac{8\pi^2}{15}$ $\frac{\pi^3}{6}$

At this point, we can see that the numerator has the sequence of $$1,4,1,8,\dots=\pi^{\lfloor \frac{n}{2} \rfloor}\begin{cases}1,&\text{n is even} \\ 2^{\frac{n+1}{2}},&\text{n is odd}\end{cases}$$ and the denominator of $$1,3,2,15,6,\dots=\begin{cases}(\frac{n}{2})!,&\text{n is even} \\ n!!,&\text{n is odd}\end{cases}$$ Using this, we can see that $$c_n=\frac{\pi^{\frac{n}{2}}}{\Gamma(\frac{n}{2}+1)}=\frac{2\pi^{\frac{n}{2}}}{n\Gamma(\frac{n}{2})}$$ You can see a more formal proof at this link.