I'm dealing with the isothermal-isobaric ensemble, where the fixed parameters are temperature, pression and particle number: $T,P,N$.
I konw that the expression for the mean value of the volume is easily derived and is given by $\langle V \rangle=-\frac{1}{\beta}\frac{\partial}{\partial P}\log Z$, where $Z(T,P,N)=\int e^{-\beta(H(q,p)-PV(q,p))}\text{d}q\text{d}p$ is the partition function of this ensemble and $\beta=\frac{1}{kT}$ where $k$ is the Boltzmann constant.
My question is if there is a simple expression even for the mean value of the energy.
$ $
My attempt: \begin{gather*} \langle H \rangle=\frac{1}{Z}\int H(q,p)e^{-\beta(H(q,p)+PV(q,p))}\text{d}q\text{d}p= \\ =\frac{1}{Z}\int (H(q,p)+PV(q,p)-PV(q,p))e^{-\beta(H(q,p)+PV(q,p))}\text{d}q\text{d}p= \\ =\frac{1}{Z}\int (H(q,p)+PV(q,p))e^{-\beta(H(q,p)+PV(q,p))}\text{d}q\text{d}p-\frac{P}{Z}\int V(q,p)e^{-\beta(H(q,p)+PV(q,p))}\text{d}q\text{d}p= \\ =-\frac{1}{Z}\int\frac{\partial}{\partial\beta}e^{-\beta(H(q,p)-PV(q,p))}\text{d}q\text{d}p+\frac{P}{Z\beta}\int\frac{\partial}{\partial P}e^{-\beta(H(q,p)-PV(q,p))}\text{d}q\text{d}p= \\ =-\frac{1}{Z}\frac{\partial Z}{\partial\beta}+\frac{P}{Z\beta}\frac{\partial Z}{\partial P} \end{gather*} Am I right? Thank you!
Again, is there any nice expression for $\langle H^2 \rangle$? Reasoning as above (namely writing $H^2=H(H+PV-PV)=...$ and so on) I have found: \begin{gather*} \langle H^2 \rangle=\frac{1}{Z}\frac{\partial^2Z}{\partial\beta^2}+\frac{P^2}{Z\beta^2}\frac{\partial^2Z}{\partial P^2}-\frac{2P}{Z\beta}\frac{\partial^2Z}{\partial P\partial\beta}+\frac{2P}{Z\beta^2}\frac{\partial Z}{\partial P} \end{gather*}