Solution (source code)

= Solution

\b[Molecules.] In a dilute classical gas, collisions establish a <Maxwell-Boltzmann distribution>. The normalized <speed> distribution and its first two moments are
$$
f(v)=4\pi\left(\frac{m}{2\pi k_BT}\right)^{3/2}v^2e^{-mv^2/(2k_BT)},
\quad \overline v=\sqrt{\frac{8k_BT}{\pi m}},\quad
\overline{v^2}=\frac{3k_BT}{m}.
$$
<Momentum> transfer to a wall gives $p=nm\overline{v^2}/3=nk_BT$. Translational <internal energy> is $U=3Nk_BT/2$; rotational and vibrational degrees of freedom add <energy> when thermally populated, without changing the dilute ideal-gas <pressure> law. Classical <equipartition> gives $k_BT/2$ per quadratic contribution, but quantum level spacing can freeze out modes.

Only the molecules moving towards a surface contribute to its one-sided number flux:
$$
J=\frac14n\overline v=\frac{p}{\sqrt{2\pi mk_BT}}.
$$
For an <effusive molecular energy flux>, faster molecules are preferentially sampled, giving mean translational <energy> $2k_BT$ per crossing molecule and $F_E=2k_BTJ$. This differs from multiplying $J$ by the bulk mean $3k_BT/2$. Collisions and finite molecular interactions produce transport and departures from the ideal-gas <equation of state>.

\b[<Photons>.] All <photons> travel at $c$ in vacuum, so their thermal distribution is over <frequency>, not over a range of speeds. The two polarizations and Bose-Einstein occupation with zero <chemical potential> give
$$
u_\nu\,d\nu=\frac{8\pi h\nu^3}{c^3}
\frac{d\nu}{e^{h\nu/(k_BT)}-1},\qquad
u\equiv\int_0^\infty u_\nu\,d\nu=a_RT^4,
\quad a_R=\frac{8\pi^5k_B^4}{15h^3c^3}.
$$
Here the spectral quantity is $u_\nu$ and the total <energy> <density> is $u$. <Momentum flux> gives $p=u/3$, while isotropic angular averaging gives the one-sided <energy> flux $F_E=cu/4=\sigma_{\rm SB}T^4$ through a small aperture of a black-body cavity. The <photon> number flux is similarly $cn_\gamma/4$.

\b[Both pressures arise from <momentum> transfer, but their <equations of state> differ:] a classical molecular gas has $pV=Nk_BT$ with fixed molecule number, whereas a <photon gas> has $pV=U/3$, $U=a_RVT^4$ and an equilibrium <photon> number that changes with <temperature>. <Photon> creation and absorption by the walls are essential to the zero-chemical-potential equilibrium description.