Volume derivative form of the heat-capacity difference (source code)

= Volume derivative form of the heat-capacity difference
{title2=$C_p-C_V=[(\partial U/\partial V)_T+p](\partial V/\partial T)_p$}

For a fixed-composition simple compressible <thermodynamic system> with smooth <equations of state>, write the <internal energy> as $U(T,V)$ and the <enthalpy> as $H=U+pV$. Differentiating $H$ at constant <pressure> and applying the <multivariable chain rule> gives
$$
C_p=\left(\frac{\partial U}{\partial T}\right)_p+p\left(\frac{\partial V}{\partial T}\right)_p,\qquad\left(\frac{\partial U}{\partial T}\right)_p=\left(\frac{\partial U}{\partial T}\right)_V+\left(\frac{\partial U}{\partial V}\right)_T\left(\frac{\partial V}{\partial T}\right)_p.
$$
Subtracting the <heat capacity at constant volume> proves the displayed identity. For an <ideal gas>, $(\partial U/\partial V)_T=0$ and $(\partial V/\partial T)_p=Nk_B/p$, so $C_p-C_V=Nk_B$. For a nonideal material the <internal energy> change with <volume (thermodynamics)> contributes as well as expansion <work>.