# Statistical physics is unable to prove that $TdS=d\overline{E}$

I will pose $$k_B=1$$.

Suppose a system of statistical physics with the constraints:

\begin{align} 1&=\sum_{q\in\mathbb{Q}}\rho(q)\\ \overline{E}(\beta)&=\sum_{q\in\mathbb{Q}} E(q)\exp(-\beta E(q)) \end{align}

Under these constraints, one maximizes the entropy:

$$S=-\sum_{q \in \mathbb{Q}}\rho(q)\ln \rho(q) \tag{1}$$

and finds that $$\rho(q)$$, the probability measure, is the Gibbs ensemble:

$$\rho(q)=\frac{1}{Z}\exp (-\beta E(q)) \tag{2}$$

Injecting (2) into (1), one finds that the entropy is the function:

$$S(\beta)=\ln Z(\beta) +\beta \overline{E}(\beta) \tag{3}$$

In many introductory textbooks, it is claimed that one can take the total derivative of $$S$$ as:

$$dS= \frac{\partial S}{\partial \overline{E}} d\overline{E}$$

and obtain the fundamental relation of thermodynamics:

$$dS= \beta d\overline{E} \tag{4}$$

The problem I have is that $$\overline{E}$$ is not a variable of $$S$$, but functions of $$\beta$$:

$$\overline{E}(\beta)=\sum_{q\in\mathbb{Q}} E(q)\exp(-\beta E(q))$$

As these are functions, taking the differential of $$S(\beta)$$ with respect to the function $$\overline{E}(\beta)$$ doesn't seem to make sense. In the litterature one ignores this problem and takes the derivative anyways. However, if one sticks to mathematical rigor, one may try to take a function-by-function derivative, but it will not produce $$TdS=d\overline{E}$$ as expected.

• This is a strange approach to statistical physics. What is $V(q)$? Volume of a many-particle system in statistical physics is almost never function of microscopic state, instead it is a simple macroscopic constraint that the microscopic model obeys. It is a restriction on the phase space, or available states. There are no different $V(q)$, there is only one $V$. – Ján Lalinský Aug 29 '19 at 19:53
• The fact that $\bar E$ depends on $\beta$ (thus on temperature) poses no problem. The $S$ is the equation $TdS=d\bar{E} +pdV$ is a function of $\bar{E},V$ only, the fact that $\bar{E}$ can be expressed as function of $\beta,V$ does not matter. – Ján Lalinský Aug 29 '19 at 19:57
• @JánLalinský Consider $\overline{V}$ a constraint like any other. I have not claimed that $\overline{V}$ is the volume. If $\overline{E}$ is a function of $\beta, \gamma$, then one cannot take the derivative of $S$ with respect to $\overline{E}$. Function-by-function derivatives won't produce $TdS=d\overline{E}+pd\overline{V}$. Check my attempt (bottom 3 equations). – Alexandre H. Tremblay Aug 29 '19 at 21:09
• > "a constraint like any other" -- Like what other constraint? In statistical physics set of possible $q$'s depends on macroscopic parameter volume $V$, there is no $V(q)$ if $V$ is volume. As to the meaning of derivative $\partial S/\partial \bar{E}$, this is plain partial derivative of many-variable function $S(\bar{E},V)$. The symbol $S$ in $TdS = d\bar{E} + pdV$ is function of two real variables $\bar{E},V$. There is no derivative with respect to function. – Ján Lalinský Aug 29 '19 at 21:20
• This isn't the right way of doing statistical mechanics. From the start, your $\bar{E}$ and $\bar{V}$ aren't well defined. What is $V(q)$ ? If it isn't the volume, then don't use that symbol! And there are many other problems with your approach. – Cham Aug 29 '19 at 21:33

Taking the derivative $$\partial S /\partial \overline{E}$$ is 100% a mistake that accidentally gives the right answer. It works without having to take it:
\begin{align} S(\beta)&=\ln Z(\beta) +\beta \overline{E}(\beta)\\ d S(\beta)&= \left[ \frac{\partial (\ln Z(\beta)+ \beta \overline{E}(\beta))}{\partial \beta} \right] d\beta\\ &= \left[ \frac{\partial \ln Z(\beta)}{\partial \beta} \right]d\beta + \left[\frac{\partial \beta \overline{E}(\beta)}{\partial \beta} \right] d\beta\\ &= \left[ -\overline{E}(\beta) \right]d\beta+ \left[\frac{\partial \beta }{\partial \beta}\overline{E}(\beta) + \beta \frac{\partial \overline{E}(\beta)}{\partial \beta} \right] d\beta\\ &= \left[ -\overline{E}(\beta) \right]d\beta+ \left[\overline{E}(\beta)\right]d\beta + \left[\beta \frac{\partial \overline{E}(\beta)}{\partial \beta} \right] d\beta\\ &= \left[\beta \frac{\partial \overline{E}(\beta)}{\partial \beta} \right] d\beta\\ &= \beta \left[ \frac{\partial \overline{E}(\beta)}{\partial \beta} d\beta \right] \\ &= \beta d\overline{E}(\beta) \end{align}