Small problem that has been bugging me for a while and I can't seem to demonstrate the validity of $(4)$ below. Starting with enthalpy,
$$H(S,P)-U(S,V)=PV$$
Recognizing the Legendre transform here, $$\left ( \frac{\partial U}{\partial V} \right )_S=-P = \left ( \frac{\partial \langle E_i \rangle}{\partial V}\right )_S\tag{1}$$
And since,
$$F(V,T) = U(S,V) - TS$$
$$dF = dU - TdS - SdT$$
Then using the fundamantal thermodynamic equation (leaving out changing particles),
$$dU = TdS - PdV$$
Therefore,
$$dF = - PdV -SdT$$
And,
$$\left ( \frac{\partial F}{\partial V} \right )_T = -P \tag{2}$$
We are effectively holding $S$ and $T$ constant, so no heat exchange can occur here.
If we evaluate $(2)$ as it relates to the partition function $Z$ we get, (from Pathria, Statistical Mechanics 3rd Edition, page 51 equation $11$),
$$F=-kT\ln Z$$ $$\frac{\partial F}{\partial V}=-kT\frac{\partial\ln Z}{\partial V}=\frac{-kT}{Z}\frac{\partial Z}{\partial V} = \frac{-kT}{Z}\frac{\partial }{\partial V}\sum_i \exp(-E_i/kT) $$ $$= \frac{-kT}{Z}\sum_i \frac{\partial }{\partial V} \exp(-E_i/kT) = \frac{-kT}{Z}\sum_i (-1/kT)\exp(-E_i/kT)\frac{\partial E_i}{\partial V} $$ $$= \frac{1}{Z}\sum_i \exp(-E_i/kT)\frac{\partial E_i}{\partial V} = \sum_i \rho_i \frac{\partial E_i}{\partial V} $$ $$\left ( \frac{\partial F}{\partial V} \right )_T=\left ( \left \langle \frac{\partial E_i}{\partial V}\right \rangle \right )_T = -P \tag{3}$$
Putting together $(1)$, $(2)$ and $(3)$ it seems that:
$$ \left( \frac{\partial \langle E_i \rangle}{\partial V} \right )_S=\left ( \left \langle \frac{\partial E_i}{\partial V}\right \rangle \right )_T \tag{4}$$
Evaluating the left hand side:
$$\left ( \frac{\partial}{\partial V}\frac{1}{Z}\sum_{i} E_i \exp(-E_i/kT) \right)_S \tag{5}$$
Is there an obvious simplification I am missing? We know the internal energy is a function of volume. Is the partition function a function of volume? (I thought yes).
If someone can elucidate this for me I would appreciate it. Hope the notation is clear, $E_i$ is the energy of a microstate.
$(2)$ is also true based on the Legendre Transform of the Gibbs free energy $G-F=PV$. So we know it is true, I am more interested in $(4)$ since it should also hold.