Solution (source code)

= Solution

Standing-wave wave numbers are $k_n=n\pi/L$, with one positive mode index and two <polarizations>. Since $\epsilon=\hbar ck$, the continuum <density of states> is
$$
\boxed{g(\epsilon)=\frac{2L}{\pi\hbar c}.}
$$
The factor two counts <polarizations>; counting independent positive and negative traveling momenta in addition would double count standing modes. The thermal <energy> is
$$
U=\int_0^\infty g(\epsilon)\frac{\epsilon\,d\epsilon}{e^{\epsilon/(k_BT)}-1}
=\frac{2L(k_BT)^2}{\pi\hbar c}\frac{\pi^2}{6}.
$$
Thus the <one-dimensional photon-gas thermodynamics> gives
$$
\boxed{U=\frac{\pi Lk_B^2T^2}{3\hbar c}.}
$$
Replacing the mode sum by an integral requires the stated <temperature> to be large compared with the level-spacing scale. This is thermal <energy> above the vacuum contribution; a separate boundary-dependent vacuum <energy> is not included.