# How does one calculate partial derivatives with two constant variables in statistical mechanics

I came across this relation which I have yet to be able to prove or find proof of: $$kT^2\left(\frac{\partial \ln\mathscr{Z}}{\partial T}\right)_{V,\mu}=\langle H\rangle-\mu\langle N\rangle$$ I was able to get it to: $$\left(\frac{\partial \ln\mathscr{Z}}{\partial T}\right)_{V,\mu}=\left(\frac{\partial \ln\mathscr{Z}}{\partial T}\right)_{V,f}+\frac{\partial \ln\mathscr{Z}}{\partial T}$$ For context, $$\mathscr{Z}$$ is the grand canonical partition function and $$f=e^{\frac{\mu}{kT}}$$, making $$f\equiv f(\mu)$$.

I need help getting past this part since the final solution it yields is $$\frac{\partial \ln\mathscr{Z}}{\partial T}=0$$, which makes no sense knowing that $$\ln\mathscr{Z}=\frac{PV}{kT}$$.I tried calculating the derivatives via the only method I know: $$\left(\frac{\partial u}{\partial x}\right)_y=\frac{\partial (u,y)}{\partial (x,y)}$$ but I still keep getting the same $$=0$$ answer.

Giving further context: $$\langle H\rangle=-\left(\frac{\partial \ln \mathscr{Z}}{\partial \beta}\right)_{f,V},\,\, \beta=\frac{1}{kT}$$ $$\langle N\rangle=kT\frac{\partial \ln\mathscr{Z}}{\partial\mu}$$

Edit: I had forgotten to write $$\ln\mathscr{Z}$$ instead of only $$\mathscr{Z}$$ in the first derivatives.

• @TobiasFünke Thank you for your answer. I have the following expressions: $\mathscr{Z}=\sum_{N=0}^{\infty}f^NZ_N(V,T)$ and $Z_N(V,T)=\int\frac{dpdq}{N!h^{3N}}e^{-\beta H(p,q)}$. I understand your answer to a certain extent, what I don't understand is how the two derivatives keeping variables constant are different from each other. Commented Oct 25, 2022 at 16:04
• I've deleted the comment because I think it does not answer your question/ does not help much. Commented Oct 25, 2022 at 16:07
• Ok, no problem. I think I've narrowed my question to how is $\left(\frac{\partial \ln L}{\partial T}\right)_{V,\mu}$ different from $\left(\frac{\partial \ln L}{\partial T}\right)_{V,f}$ if $\frac{\partial}{\partial f}=\frac{kT}{f}\frac{\partial}{\partial \mu}$, which isn't much of a difference. Commented Oct 25, 2022 at 16:13
• One the other hand, if we say that $\mathscr{Z}\equiv\mathscr{Z}(V,f,\mu)$, then $d\mathscr{Z}=A dV+B df + C d\mu$. This means that the first term is $B$ and the second is $C$. How is then $B-C=\frac{\partial \mathscr{Z}}{\partial T}$? Commented Oct 25, 2022 at 16:17
• Sorry, I think I cannot help here. I really don't understand the use of $f$. It seems that $f$ is a function of both $\mu$ and $T$, no? For me, it really just complicates things. What is the source/ reference of this calculation/ notation? Commented Oct 25, 2022 at 16:19

Once the fugacity $$f$$ is defined as $$f=e^{\beta \mu}$$ (with $$\beta=1/k_BT$$), $$f$$ becomes a function of $$T$$ and $$\mu$$. Therefore, $$\mathscr{Z}(T,V,f)=\mathscr{Z}(T,V,f(T,\mu))$$ and the expression $$\left(\frac{\partial \mathscr{Z}}{\partial T}\right)_{V,\mu}=\left(\frac{\partial \mathscr{Z}}{\partial T}\right)_{V,f}+\frac{\partial \mathscr{Z}}{\partial T}$$
is better written as $$\left(\frac{\partial \mathscr{Z}}{\partial T}\right)_{V,\mu}=\left(\frac{\partial \mathscr{Z}}{\partial T}\right)_{V,f}+\left( \frac{\partial \mathscr{Z}}{\partial f}\right)_{V,T}\left( \frac{\partial f}{\partial T} \right)_{\mu}\tag{1}$$ From here, it is quite easy to get the result. Indeed, $$\mathscr{Z}={\sum_{N=0}^{\infty}} f^N Z_N(V,T)$$ where $$Z_N(V,T)= \frac{1}{N!h^{3N}}\int d^{3N}qd^{3N}p ~~e^{-\frac{H(q,p)}{k_BT}}$$ for classical systems (but a corresponding expression exists for quantum systems). Taking into account that the grand-canonical (GC) average of any observable $$A$$ can be written in terms of the corresponding canonical average (c) as $$\langle A \rangle_{GC}= \frac{1}{\mathscr{Z}}{\sum_{N=0}^{\infty}} f^N Z_N(V,T) \langle A \rangle_c,$$ Equation $$(1)$$ can be divided bt $${\mathscr{Z}}$$. Then, by using $$\langle H\rangle=-\left(\frac{\partial \ln \mathscr{Z}}{\partial \beta}\right)_{f,V}=k_BT^2\left(\frac{\partial \ln \mathscr{Z}}{\partial T}\right)_{f,V},$$ and the two derivatives $$\left( \frac{\partial \mathscr{Z}}{\partial f}\right)_{V,T}= {\sum_{N=0}^{\infty}} N f^{N-1} Z_N(V,T)$$ and $$\left( \frac{\partial f}{\partial T} \right)_{\mu}=-\frac{\mu}{k_BT^2}f,$$ we can easily obtain the required result.
• Thank you very much for your answer! I must ask, though, why are your keeping $V$ constant on the third term? What I mean is, why is $\frac{\partial \mathscr{Z}}{\partial T}=\left(\frac{\partial \mathscr{Z}}{\partial f}\right)_{V,T}\left(\frac{\partial f}{\partial T}\right)_{V,\mu}$ instead of simply $\frac{\partial \mathscr{Z}}{\partial T}=\left(\frac{\partial \mathscr{Z}}{\partial f}\right)_{T}\left(\frac{\partial f}{\partial T}\right)_{\mu}$, or even not keeping any of the variables $V, \mu, T$ constant at all? Commented Oct 26, 2022 at 12:17
• I see. I'm trying to wrap my head around working with this kind of derivatives, I'm sorry for the excessive questions. I still can't see how that last formula would be solved. I tried solving it but came back empty handed. For the derivative $\left(\frac{\partial}{\partial T}\frac{PV}{kT}\right)_{V,\mu}$ (where $\ln \mathscr{Z}=PV/kT$) and which may be rewritten as $\left(\frac{\partial}{\partial T}\frac{PV\mu}{(kT)^2\ln(\lambda^3(T)n(N,V))}\right)_{V,\mu}$, am I supposed to take any other non-constant (apart from $\mu$ and $V$) as functions of T? For example as $P(T)=NkT/V$ Commented Oct 26, 2022 at 16:13
• @HGCMF, $P=NkT/V$, is specific for a perfect gas. The formulas you are trying to derive are completely general. I'll add a few more details to my answer. Commented Oct 26, 2022 at 20:55