Solution (source code)

= Solution

At fixed particle number, $dU=T\,dS-P\,dV$. The stated <Maxwell relation> gives
$$
\left(\frac{\partial U}{\partial V}\right)_T=T\left(\frac{\partial P}{\partial T}\right)_V-P=\frac{aN^2}{V^2},\qquad U(T,V)=f(T)-\frac{aN^2}{V}+C.
$$
For the intended classical monatomic <Van der Waals gas>, <equipartition> supplies $f(T)=3Nk_BT/2$: the attractive mean-field term is <temperature> independent and there are three translational quadratic degrees of freedom. Consequently,
$$
\boxed{U_i=\frac32Nk_BT_i-\frac{3aN^2}{V_0}+C.}
$$
The <caloric closure of the van der Waals equation> is essential. \b[Caloric assumption:] the <pressure> equation alone determines the volume dependence, but not the function $f(T)$. The monatomic kinetic-energy model is the additional assumption behind the claimed formula.<Statistical Physics by David Tong>[Chapter 2: classical monatomic gases and the van der Waals mean-field interaction]{ref}