Derivation of relativistic pressure As you can find in many cosmology textbooks, the relativistic pressure in quantum statistical mechanics can be witten as below:
$$p=g \int \frac{d^3P}{(2 \pi \hbar)^3} \frac{c^2 |\mathbf{P}|^2}{3E(\mathbf{P})}f(\mathbf{P})\tag{D.1.4}$$
where $f(\mathbf{P})$ is the fermi/bose distribution function:
$$f(\mathbf{P})=\frac{1}{\exp[\frac{E(\mathbf{P})-\mu}{k_B T}]\pm 1}\tag{D.1.1}$$
and the relativistic energy $E(\mathbf{P})$ is as usual:
$$E(\mathbf{P})=\sqrt{c^2|\mathbf{P}|^2+m^2 c^4}$$
I want to know how to derive the first equation, particularly the portion of $\frac{c^2 |\mathbf{P}|^2}{3E(\mathbf{P})}$.
Any comment and help would be appreciated.
References:


*

*http://tmcosmos.org/cosmology/cosmology-web/node31.html (Japanese). 

 A: Consider a particle bouncing back and forth between two walls parallel to yz-plane separated by length $L_x$. The momentum of the particle in the normalized direction of the walls is $p_x$, so a momentum change of $2p_x$ occurs on every collision. The velocity of the particle in the direction is $v_x = c^2 p_x/E$ because
$$p_x = \gamma m v_x, \quad E = \gamma m c^2.$$
Then the time between collisions is $2L_x/v_x$. The average force on the wall is
$$F_{\text{av}} = \frac{\Delta p_x}{\Delta t} = \frac{2 p_x}{2L_x E/p_x c^2} = \frac{1}{L_x} \frac{c^2p_x^2}{E}.$$
Dividing both sides by the area of the walls, $L_y L_z$, we have the pressure
$$P = \frac{1}{V} \frac{c^2p_x^2}{E}.$$
Finally, we sum over all the particles by integrating over the phase space density, giving 
$$P_{\text{tot}} = \int d\mathbf{p} \, \frac{f(\mathbf{p})}{(2\pi \hbar)^3} \, \frac{c^2 p_x^2}{E}=\int d\mathbf{p} \, \frac{f(\mathbf{p})}{(2\pi \hbar)^3} \, \frac{c^2 p^2}{3E}.$$
Here, we use the relation which holds for average: $\langle p^2 \rangle = \langle p_x^2 \rangle + \langle p_y^2 \rangle + \langle p_z^2 \rangle = 3 \langle p_x^2 \rangle$. Since the integration sums over all the particles, we can use the relation which only holds for average.
