Solution (source code)

= Solution

Write $b=\pi k_B^2/(3\hbar c)$, so $U=bLT^2$. At fixed length, $dS=C_L\,dT/T$, giving $S=2bLT$ with the <entropy> constant fixed by the unique <photon> vacuum. The thermal <Helmholtz free energy> and generalized <pressure> follow:
$$
\boxed{S=\frac{2\pi Lk_B^2T}{3\hbar c},\qquad
A=U-TS=-\frac{\pi Lk_B^2T^2}{3\hbar c},\qquad
P=-\left(\frac{\partial A}{\partial L}\right)_T=\frac{\pi k_B^2T^2}{3\hbar c}=\frac UL.}
$$
The <entropy> constant can also be checked from the exact discrete <photon> partition function; the continuum approximation should not be extrapolated blindly below its level-spacing regime. In one dimension $P=U/L$, whereas the isotropic three-dimensional relation is $p=U/(3V)$. Both follow from the number of spatial directions carrying <momentum> flux.