# Number of modes in cavity radiation

My question is that why do we consider an octant of sphere ( and calculate the volume of that shell to find the number of modes) but not another geometric object and its differential volume element?

In $n$-space, the components $n_x$, $n_y$, and $n_z$ are the coordinate variables. Thus, they form a vector $\vec {N}$ which has magnitude given by

$$N^2 = n_x^2 + n_y^2 + n_z^2.$$

Why a sphere?

For analogy, consider a two dimensional $n$-space where $N^2 = n_x^2 + n_y^2$, where $N$ is the number of modes. Since this is the same for every combination of $n_x$, $n_y$; as a result, $N$ is constant. See the unit circle below: for each combination of $(n_x$, $n_y)$, a circle is the only geometry can keep $N$ (blue line) constant. A square, for example, would not work because $N$ would have to be longer to reach the corners than the sides.

The same is true for the sphere: in order to keep $N$ constant, you must have a sphere to accomodate all combinations of $n_x$, $n_y$, $n_z$.

Why an octant?

The number of modes $N$ is related to the volume by

$$V = \frac{4}{3}\pi N^3.$$

Problem is, our components $n_x$, $n_y$, and $n_z$ can only take on positive values since they are also counting numbers. Only one octant of the sphere can meet this requirement to have all $n_x$, $n_y$, $n_z > 0$.

So you take an eighth of the total volume.

Extra on spin

If you are talking about counting electrons, EM modes (photons), etc. you also have to account for degeneracy when counting modes. For electrons, they are spin-1/2 particles, and thus for each possible mode in the cavity, that electron can either be spin-up or spin-down. So you would have to incorporate that as well.

Each linearally independent mode counts as a unique micro state.

Notice $$\sin(kx) = -\sin(-kx)$$ so in this example $k$ and $-k$ are not unique modes. One is equal to the other with negative amplitude. So if we were to consider all the microstates in 1D, we'd just only consider the non-negative wavenumber $k$, and be sure each one state was unique.

In multiple dimensions, we choose each component of the wavevector to be non-negative, the same way. In three dimensions having all three components non-negative leave the octant allowed, $\frac12 \cdot \frac12\cdot \frac12= \frac18$ of the total space.

The modes of a cavity will be something like $\sin \left( \frac{2\pi\mathbf{n}}{L}\cdot \mathbf{x}\right)$, where $\mathbf n$ is a vector of integers. So we consider the "octant" because only the non-negative values of $n_i$ count as unique states.