The internal energy is the integral of the internal energy spectral density. The delta functions in the density of states convert this integral in a sum.
$$u=D_0\hbar\omega_c\left(\sum \limits_{\nu = 0}^{\nu\uparrow_{\text{max}}}\nu+\frac{1}{2}-\frac{g}{4}+\sum \limits_{\nu = 0}^{\nu\downarrow_{\text{max}}}\nu+\frac{1}{2}+\frac{g}{4}\right)+\left(n-\text{Int}\left(\frac{n}{D_0}\right)D_0\right)E_F.$$Here the first sum up to the highest fully occupied Landau level with spin up electrons $\nu\uparrow_{\text{max}}$ and the second sum is over the fully occupied Landau levels with spin down electrons. The last term is the contribution to the energy density due to the partially filled landau level at the Fermi energy.