In a box of volume , the electromagnetic mode density in a box, including the two transverse polarizations, is
Each photon has energy , and the given mean occupation number is . Omitting the temperature-independent zero-point energy, the total energy is therefore
With the change of variables ,