# Macroscopic quantities (like isothermal compressibility) from fluctuations and the partition function

I'm trying to make sense of the following generalized expression from Wikipedia page on partition function:

$$\langle (\Delta X)^2\rangle=\frac{\partial \langle X\rangle}{\partial \beta Y}=\frac{\partial^2 \ln Z}{\partial (\beta Y)^2}$$

where $$X$$ and $$Y$$ are generalized conjugate pairs of extensive and intensive variables, respectively (e.g., $$X$$ could be volume and $$Y$$ could be pressure), and $$\beta = 1/k_B T$$.

I have figured out the second equality in the equation but I'm having difficulty relating L.H.S of the first equality with the rest of the equation.

I'm not able to find a derivation of this in the literature. Help would be highly appreciated. (That's the 'derivation' part of the question).

A related derivation, specific to pressure and volume, that I'm looking for is that of isothermal compressibility in the canonical ensemble (I haven't found it yet; I may have found something in the grand-canonical ensemble but I'm not sure if we really need to invoke grand-canonical in order to find a relation for isothermal compressibility in terms of the partition function; again help highly appreciated). The equation is as follows:

$$\beta_T = \frac{\langle (\Delta V)^2\rangle}{V k_B T}$$

where $$\beta_T$$ and $$\beta$$ have nothing to do with each other, and by definition,

$$\beta_T \equiv -\frac{1}{V}\left(\frac{\partial V}{\partial p}\right)_{T,N}$$

In addition, for the 'validity' part of the question, it appears that this calculation is a standard procedure for any/most conjugate thermodynamic pairs. However, while looking for a derivation, I came across a caution in Reif, Fundamentals of Statistal and Thermal Physics, page 221, stating:

"Calculating the dispersion $$\langle (y - \langle y\rangle)^2\rangle$$ of some quantity $$y$$ is a much more delicate matter. There is no guarantee that the dispersion is the same when calculated under conditions where $$E$$ is precisely specified ... or under conditions where only the mean energy $$\langle E\rangle$$ is specified. As a matter of fact, one would expect the dispersion to be greater in the second case. In particular, if $$y$$ were the energy $$E$$ of the system, its dispersion would vanish in the first case where $$E$$ is precisely specified, but would not vanish in the second case where only the mean value $$E$$ is specified."

Therefore I'm a bit confused as to how valid this equation is (or maybe this passage is somewhat irrelevant, in which case this question is mainly about the derivation only).

edit 1: $$\langle (\Delta X)^2\rangle$$ is defined as:

$$\langle (\Delta X)^2\rangle \equiv \langle(X-\langle X\rangle)^2\rangle$$

edit 2: I guess I'm mainly interested in the canonical ensemble. Am I right in thinking, you need canonical (or grand-canonical) to have this equation, since this equation relies on having a $$\exp(-\beta E)$$ in the partition function? (But then I'm not looking for grand-canonical, so that leaves us with canonical ensemble. Does that make sense?)

Here's a formal derivation, ignoring any subtlety about different ensembles, etc. For brevity, I'm just going to write the partition function \begin{align} Z(Y) = \int dX \,e^{-XY} \end{align} Then \begin{align} \langle X \rangle(Y) = \frac{1}{Z(Y)}\int dX\,X e^{-XY}. \end{align} Differentiating with respect to $$Y$$, \begin{align} -\partial_Y \langle X \rangle &= -\partial_Y\left(\frac{1}{Z}\right)\int dX \,X e^{-XY} - \frac{1}{Z}\partial_Y\left(\int dX X \,e^{-XY}\right)\\ &= -\frac{1}{Z^2}\left(\int dX\,X e^{-XY}\right)^2 + \frac{1}{Z}\left(\int dX X^2 \,e^{-XY}\right)\\ &= \langle X^2\rangle - \langle X \rangle^2. \end{align}
• Your $Z$ is missing a $\beta$? Also why should $E$ equal $XY$? For isothermal compressibility, why should $E$ equal $pV$ (or $-pV$, whichever sign is correct)? If you ignore ensemble specification, why should $Z$ have an exponential in the integrand? (which mainly appears in canonical and grand-canonical $Z$, not in the microcanonical). – user101043 Mar 27 at 4:22
• I was just trying to demonstrate in general how you get that identity for any two conjugate variables. I'm not saying $XY$ is the energy of anything. Just that if $X$ and $Y$ are conjugate they'll show up in the energy as $E = \pm XY + \ldots$ and then we can use this identity. And $\beta = 1$, if you like. – d_b Mar 27 at 4:35