I am stuck trying to derive the residual Gibbs free energy; though, I succeeded deriving the departure function but stuck with the residual part.
The departure function is $$ \frac{\mathrm{d}G(\text{departure})}{RT}=\int(Z-1)\frac{\mathrm{d}P}{P} $$ where $$G(\text{departure}))=G-G(\text{Ideal Gas})=\frac{ZRT}{P}\mathrm{d}P- \frac{RT}{P}\mathrm{d}P $$
To get the residual Gibbs free energy we need to write the integral $$ \int(Z-1)\frac{dP}{P} $$ in terms of molar volume and $T$ instead of $P$ and $T$.
The final answer is $$ \frac{dG(\text{residual})}{RT}=\int(Z-1)({VdV)}+Z-1-ln(Z). $$