Solution (source code)

= Solution

Since $p\propto L^{-1}=V^{-1/3}$, $dp/dV=-p/(3V)$. At fixed occupations, $dE=\int \mathcal E'(p)(dp/dV)\bar n(p),dp,dV$. Equating this to $-P,dV$ yields $P=(3V)^{-1}\int p\mathcal E'(p)\bar n(p),dp$.