Solution (source code)

= Solution

Summing over the $g$ internal states, the <number density>, <energy density>, and isotropic <pressure> are
$$
n=g\int\frac{d^3p}{(2\pi)^3}f(\mathbf p),
\qquad
\rho=g\int\frac{d^3p}{(2\pi)^3}E(\mathbf p)f(\mathbf p),
$$
and
$$
P=g\int\frac{d^3p}{(2\pi)^3}
\frac{\mathbf p^2}{3E(\mathbf p)}f(\mathbf p).
$$
The factor $\mathbf p^2/(3E)$ in the <kinetic pressure of an isotropic gas> is the angular average of one diagonal component of the momentum flux.