Enthalpy Departure

I'm trying to fill in the steps from my textbook on the derivation of enthalpy departure from ideal gas behavior. My textbook gives the variation of mass-specific enthalpy with temperature pressure as
$$\left ( \frac{\partial h}{\partial p} \right )\_T=v-T\left ( \frac{\partial v}{\partial T} \right )\_p$$


Integrating from pressure $p'$ to $p$ at fixed temperature $T$,
$$h(T,p)-h(T,p')=\int\_{p'}^{p}\left [ v-T\left ( \frac{\partial v}{\partial T} \right )\_p\right ]dp$$


If we use the superscript $^\*$ to denote ideal gas property values, adding and subtracting $h^\*(T)$ from the left hand side of the equation gives
$$\left [h(T,p)-h^\*(T) \right ]-\left [h(T,p')-h^\*(T) \right ]=\int\_{p'}^{p}\left [ v-T\left ( \frac{\partial v}{\partial T} \right )\_p\right ]dp$$


By the assumptions of the ideal gas model, we have


$$\lim\_{p'\rightarrow 0}\left [h(T,p')-h^\*(T) \right ]=0$$


and in this limit, the following expression is obtained
$$h(T,p)-h^\*(T)=\int\_{0}^{p}\left [ v-T\left ( \frac{\partial v}{\partial T} \right )\_p\right ]dp$$
This can be thought of as the change in specific enthalpy as the pressure is increased from zero to the given pressure isothermally. This equation can be evaluated with $pvT$ data.


The integral in the last equation can be expressed in terms of the compressibility factor $Z$ and the reduced temperature $T\_R$ and reduced pressure $p\_R$. Solving $Z=pv/RT$ gives


$$v=\frac{ZRT}{p}$$


On differentiation,


$$\left ( \frac{\partial v}{\partial T} \right )\_p=\frac{RZ}{p}+\frac{RT}{p}\left ( \frac{\partial Z}{\partial T} \right )\_p$$


$$v-T\left ( \frac{\partial v}{\partial T} \right )\_p=\frac{ZRT}{p}-T\left [ \frac{RZ}{p}+\frac{RT}{p}\left ( \frac{\partial Z}{\partial T} \right )\_p \right ]=-\frac{RT^2}{p}\left ( \frac{\partial Z}{\partial T} \right )\_p$$


This equation can be written in terms of the reduced properties $T\_R$ ad $p\_R$ as


$$v-T\left ( \frac{\partial v}{\partial T} \right )\_p=-\frac{RT\_c}{p\_c}\cdot \frac{T\_R^2}{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}$$


Introducing this last equation into the equation


$$h(T,p)-h^\*(T)=\int\_{0}^{p}\left [ v-T\left ( \frac{\partial v}{\partial T} \right )\_p\right ]dp$$


gives, on rearrangement,


$$\frac{h^\*(T)-h(T,p)}{RT\_c}=T\_R^2\int\_{0}^{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}\frac{dp\_R}{p\_R}=T\_R^2\int\_{0}^{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}d\ln p\_R$$


**What I'm failing to understand is how we get from the equation**


$$v-T\left ( \frac{\partial v}{\partial T} \right )\_p=\frac{ZRT}{p}-T\left [ \frac{RZ}{p}+\frac{RT}{p}\left ( \frac{\partial Z}{\partial T} \right )\_p \right ]=-\frac{RT^2}{p}\left ( \frac{\partial Z}{\partial T} \right )\_p$$


**to the equation**


$$v-T\left ( \frac{\partial v}{\partial T} \right )\_p=-\frac{RT\_c}{p\_c}\cdot \frac{T\_R^2}{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}$$


**and then to the equation**


$$\frac{h^\*(T)-h(T,p)}{RT\_c}=T\_R^2\int\_{0}^{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}\frac{dp\_R}{p\_R}=T\_R^2\int\_{0}^{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}d\ln p\_R$$


In a couple books I've looked at, the algebraic and calculus manipulations are just glossed over and ignored. I'm hoping someone can help me fill in the steps.




Conclusion:


$$v-T\left ( \frac{\partial v}{\partial T} \right )\_p=-\frac{RT^2}{p}\left ( \frac{\partial Z}{\partial T} \right )\_p=-\frac{RT\_R^2T\_c^2}{p\_Rp\_c}\left ( \frac{\partial Z}{\partial( T\_RT\_c)}\right )\_p$$


$$\left( \frac{\partial Z}{\partial( T\_RT\_c)}\right )\_p=\frac{1}{T\_c}\left( \frac{\partial Z}{\partial( T\_R)}\right )\_p=\frac{1}{T\_c}\left( \frac{\partial Z}{\partial T\_R}\right )\_{p\_R}$$
$$-\frac{RT\_R^2T\_c^2}{p\_Rp\_c}\left ( \frac{\partial Z}{\partial( T\_RT\_c)}\right )\_p=-\frac{RT\_c}{p\_c}\cdot \frac{T^2\_R}{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}$$


$$h(T,p)-h^\*(T)=\int\_{0}^{p}\left [ v-T\left ( \frac{\partial v}{\partial T} \right )\_p\right ]dp=-\int\_{0}^{p\_R}\frac{RT\_c}{p\_c}\cdot \frac{T\_R^2}{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}d(p\_Rp\_c)$$


$$\Rightarrow \frac{p\_c\left [h^\*(T)-h(T,p) \right ]}{RT\_c}=\frac{T\_R^2}{p\_R}\int\_{0}^{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}p\_cdp\_R$$


$$\Rightarrow\frac{h^\*(T)-h(T,p)}{RT\_c}= T\_R^2\int\_{0}^{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}\frac{dp\_R}{p\_R}=T\_R^2\int\_{0}^{p\_R}\left ( \frac{\partial Z}{\partial T\_R} \right )\_{p\_R}d\ln p\_R$$


 1