Why is it valid to always use the particle in a box model in density of states calculations? Suppose we would like to calculate the density of states of some 3-D system given the dispersion relation $\omega = f(k)$. In every such example I have come across (for instance, with phonon dispersion), we use the fact that the k-space density of states is $D(k) = \frac{\pi^3}{V}$, where V is the volume of the system. From this, we can find $D(\omega)$ as usual. My question is why the expression $D(k) = \frac{\pi^3}{V}$ is always valid, since this expression comes from assuming that the system behaves like a particle in a box with hard wall boundary conditions and applying the associated quantisation on $k$. I have read that the density of states does not depend on the shape of the system and so such an assumption is valid, but I do not see why this is true, or why the constant $k$-space DOS should hold for more complicated systems.
 A: The density of states does depend on the situation. There are two issues: potential energy, and averaging.
The particle in a hard-wall box model is suitable for cases where the particles move freely, without any potential energy function except at the walls. This is accurate in free space and a good approximation for phonons in solids. For some of the states of electrons in crystalline solids it is quite accurate under certain approximations. However for a cloud of particles in another type of potential well, such as a harmonic potential for example, the density of states function will be different. It will depend on the potential.
Next, on averaging. The statement $D(k) = \pi^3 / V$ is a statement about the average density (in the hard wall box model) after averaging over a region in $k$ space large enough to contain many states. Really the density of states is sharply peaked at certain $k$ values, and zero in between. The details of exactly where the states lie does depend on the shape of the box. But if the box is large and one is averaging over many states, then these details do not affect the average.
For a cavity of finite size, on the other hand, things go differently. This may or may not be important, depending on the temperature. For example, the spectral energy density of cavity radiation does differ from the Planck form, when the wavelength becomes comparable to the dimensions of the cavity. Indeed, for flat cavities at low temperature you can treat the cavity as two-dimensional instead of three-dimensional, on the argument that the modes in the small dimension are not excited. This argument requires that one brings in the discreteness of the modes.
