Solution (source code)

= Solution

In a box of volume $V$, the <electromagnetic mode density in a box>, including the two transverse <polarization of an electromagnetic wave>[polarizations], is
$$
dN=2\frac{V}{(2\pi)^3}d^3k
=\frac{V}{\pi^2}k^2\,dk.
$$
Each <photon> has energy $\hbar\omega=\hbar ck$, and the given <Planck photon distribution>[mean occupation number] is $(e^{\hbar ck/T}-1)^{-1}$. Omitting the temperature-independent <zero-point energy>, the total energy is therefore
$$
E=\frac{V\hbar c}{\pi^2}
\int_0^\infty\frac{k^3}{e^{\hbar ck/T}-1}\,dk.
$$
With the <change of variables> $x=\hbar ck/T$,
$$
E=\frac{VT^4}{\pi^2\hbar^3c^3}
\int_0^\infty\frac{x^3}{e^x-1}\,dx.
$$