Derivative of Energy wrt Volume Expectation

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.

Not sure if I fully understand your exact question, but I think it is possible to shed a bit of light on the right-hand side of Eq. (4).

Given your derivation of Eq. (3), you are assuming that the possible microstates stay the same when you change the system volume: just their energy changes. In other words, Eq. (3) only holds if the number of microstates -- or their density in phase space -- stays constant as you change $$V$$, only their energy. This means that a the volume change you consider cannot correspond to a rescaling of the particle coordinates, just a change in the volume boundaries.

For example, consider a gas or liquid whose volume is changed by moving a piston. The only effect this has on the energy of any given microstate is via the interaction between the particles and the piston: the kinetic energy and the interactions between the particles do not change and their contribution to $$\partial E_i/\partial V$$ is zero. Hence, the right-hand side of Eq. (4) is simply: $$\left\langle \frac{\partial U_{piston}}{\partial V} \right\rangle = \left\langle \frac{\partial U_{piston}}{\partial x} \frac{\partial x}{\partial V} \right\rangle = \left\langle -f_{piston} / A_{piston} \right\rangle = -P_{piston},$$ where $$U_{piston}$$ is the energy arising from interactions of particles with the piston, $$x$$ is the position of the piston, $$f_{piston}$$ is the total force of the particles in the system exerted on the piston, $$A_{piston}$$ is the piston surface area, and $$P_{piston}$$ is the average pressure the particles exert on the piston.

So, the right-hand side of Eq. (4) can simply be interpreted as the (negative of the) pressure experienced by the piston, or equivalently by the walls of the system. This indeed also corresponds to the bulk pressure of the system.

So I think the equation indeed holds, but the sum notation you use here can be a bit confusing in a continuous system. If we were considering a bulk system without explicit walls (e.g. periodic boundary conditions), Eq. (2) would still hold. We could also still consider the effect of volume moves on the free energy, like you do in the derivation of (3), but then typically a volume change would correspond to a rescaling of the system, rather than moving a piston. Such a rescaling changes both the number of accessible microstates and the spacing between particles (and hence the pair interactions). In that case, Eq. (3) would pick up an "ideal gas" contribution from the change in the number of microstates. As mentioned by user3725600 in a comment, a bulk ideal gas is a good example of where this would come into play.

• You've shown that the right side of $(4)$ is equal to $-P$ independent from $(2)$, and under the conditions I've described we also know that $(1)$ is true. This is exactly what I was looking for. I think $(5)$ is useless because what the derivative is acting on is just $U$. Mar 29 at 18:45
• Also, both you and user3725600 have brought to my attention that the summation notation is vague here, and even leaves out some important physics. Namely, the physics contained within the limits of integration on the partition function (which I have seen in the Sackur-Tetrode equation derivation). So thank you for that! Mar 29 at 18:48

TL;DR

• The partition function is a function of the volume. The dependence on volume is hidden in the energy spectrum of the system.
• I think (4) doesn't hold.
• I don't understand how you arrive at (3).
• The derivatives in (1) and (2) are different derivatives because they are taken in different coordinate systems $$(S,V,N)$$ vs $$(T,V,N)$$.

When differentiating functions of many arguments you have to specify what is your coordinate system, e.g. $$(T,V,N)$$ or $$(S,V,N)$$. The typical notation is: $$\left(\frac{\partial f}{\partial T}\right)_{V,N}$$ meaning - the derivative of $$f$$ wrt $$T$$ treating it as function of $$(T,V,N)$$ or in other words - the derivative of $$f$$ wrt $$T$$ keeping $$V$$ and $$N$$ constant. It is important because in different coordinates you can have very different results for derivatives (I can provide an example if you want).
1. I just don't see how you arrive at (3). Also the symbol $$\frac{\partial E_i}{\partial V}$$ doesn't make much sense to me. It seems to me, you are trying to be very general in your notation but it hurts your reasoning.
• I added calculation details for $(3)$. This calculation is in Pathria 3rd edition page 50, equation $(11)$. His notation is $E_r$ instead of $E_i$, but there is no fundamental difference. I don't understand why equating the two in two different coordinate systems, as you call them, would be a problem; the state equations for Enthalpy and Helmholtz Free Energy should simultaneously hold. Mar 28 at 13:25
• Also, I added the notation indicating which variables I am holding constant- I think this is where I am getting myself into trouble, since I am trying to hold $S$ and $T$ constant at different points. Mar 28 at 13:56
• Your final equation may well be right provided you strictly define what $\frac{\partial E_i}{\partial V}$ means because it is definitely not straightforward. You (and Pathria as well) also omitted the fact the bounds of the sum (integral) over possible states may depend on the volume. The simplest case is the ideal gas where the energies do not depend on the volume, but the configurational integral gives you a factor $V^N$. You also have to note the independent variables in your final formula. Mar 28 at 15:16
• I agree, $\frac{\partial E_i}{\partial V}$ is confusing, and partially this is what I am trying to understand by going through this excercise. I have updated the final formula to indicate the independent variables. So are you saying that in the calculation of $(3)$ we cannot bring the partial derivative inside the sum? I hadn't considered this... I haven't really found any textbook that addresses this. Maybe my real question is regarding $(3)$, and $(4)$ and $(5)$ don't represent anything useful due to holding $S$ and $T$ constant. Mar 28 at 15:30
• 1. $(T,S)$ is a fine coordinate system - there is no problem with that. 2. In the formula you actually have $(T,V)$ and $(S,V)$ pairs of coordinates so this is even less of a problem. I don't know if this is discussed in some textbooks (probably yes but I don't know of them). Typically, you'll either have a simple case like ideal gas where the volume integral is very simple or a complex system where you won't even bother with this kind of calculation. Mar 28 at 15:35