Statistical Physics: How do we derive this equation? I'm reading through Statistical Physics by F. Mandl and there is a step in arriving at an equation that I don't follow.
He uses
$$P = \sum_r p_r \left(-\frac{\mathrm dE_r}{\mathrm dV} \right) \tag{4.8}$$
to arrive at
$$P = \frac{1}{\beta} \left(\frac{\partial \ln Z}{\partial V}\right)_{\beta} \, . \tag{4.10}$$
He says that this is analogous to
$$\bar E = \sum_r p_rE_r = -\frac{\partial \ln Z}{\partial \beta} \tag{2.26}$$
and also hints that equation 4.10 is a direct result of differentiation of
$$Z = \sum_r e^{-\beta E_r} \, . \tag{2.23}$$
I don't see the connection. How did he do it?
 A: A self-contained, careful derivation of (4.10):


*

*We consider a thermodynamic system whose state can be characterized by the macroscopic variables $(S, V, N)$, then starting with the fundamental relationship $\mathrm dU = T\,\mathrm dS -P\,\mathrm dV + \mu\,\mathrm dN$, and noting that $\beta = 1/(k T)$, one can deduce the following useful expression for the system's pressure as a function of the state variables $(\beta,V,N)$:
$$
  P = \frac{1}{k\beta}\left(\frac{\partial S}{\partial V}\right)_{\beta, N} - \left(\frac{\partial U}{\partial V}\right)_{\beta, N}
$$

*Using the following definitions of entropy $S$, macroscopic energy $U$, and the partition function $Z$:
$$
  S = -k\sum_i p_i\ln p_i, \qquad U = \sum_i p_i E_i, \qquad Z = \sum_ie^{-\beta E_i}, \qquad p_i = \frac{e^{-\beta E_i}}{Z}
$$
one can deduce the following expression for the entropy:
$$
  S = k\beta U + k\ln Z
$$

*Plugging the expression for the entropy from step 2 into the expression for the pressure in step 1 gives precisely the desired result.


For now, I leave the nitty gritty details to the reader because they are a good exercise, but more detail can be provided if requested.
Addendum. Comments on an alternative viewpoint.
If you're unwilling to take the expression for pressure in step 1 above as a starting point, then here are another line of reasoning that it seems Mandl is suggesting:


*

*Assume that the energies $E_i$ of the system at hand can be written as functions of $(V, N)$ (e.g. for $N$ non-interacting quantum particles in a box), assume that the macroscopic pressure equals the negative average change in energy for a given change in volume when the particle number is held fixed, and use the shorthand $\partial/\partial V = (\partial/\partial_V)_{\beta, N}$, then
$$
  P 
= \sum_i p_i \left[-\frac{\partial E_i}{\partial V}\right] 
= \sum_i\left[\frac{\partial p_i}{\partial V}E_i - \frac{\partial (p_iE_i)}{\partial V}\right] = \sum_i\frac{\partial p_i}{\partial V}E_i - \frac{\partial U}{\partial V}
$$

*Use the statistical definition of entropy (see above) and the fact that probabilities sum to one, to obtain
$$
  \frac{1}{k\beta}\frac{\partial S}{\partial V} = \sum_i\frac{\partial p_i}{\partial V} E_i 
$$

*Combine steps 1 and 2, restoring the more descriptive derivative notation to obtain the result
$$
  P = \frac{1}{k\beta}\left(\frac{\partial S}{\partial V}\right)_{\beta, N} - \left(\frac{\partial U}{\partial V}\right)_{\beta, N}
$$
without appealing to the fundamental relation $\mathrm dU = T\,\mathrm dS -P\,\mathrm dV + \mu\,\mathrm dN$.

*Continue with the original step 2 before the addendum.

