For completeness, since there is already a well-explained answer addressing how and why $\mathrm{d}U=0$ for an isothermal process is a hallmark of an ideal gas, here is a short derivation of a general expression for the energy.
Start from the total differential for the free energy:
$$
\mathrm{d}U =
\left(\frac{\partial U}{\partial V}\right)_T \mathrm{d}V
+\left(\frac{\partial U}{\partial T}\right)_V \mathrm{d}T
\tag{1}\label{eq:total-differential}
$$
Define the heat capacity at constant volume as
$$
C_V =
\left(\frac{\partial U}{\partial T}\right)_V.
\tag{2}\label{eq:heat-cap-const-v}
$$
Evaluate the partial derivative with respect to $V$ in \eqref{eq:total-differential} from the 1st law of thermodynamics:
\begin{align}
\mathrm{d}U &=
-P\mathrm{d}V + T\mathrm{d}S \\
\rightarrow \left(\frac{\partial U}{\partial V}\right)_T &=
-P + T\left(\frac{\partial S}{\partial V}\right)_T
\tag{3}\label{eq:first-law}
\end{align}
Make use of the following Maxwell relation:
$$
\left(\frac{\partial S}{\partial V}\right)_T=
\left(\frac{\partial P}{\partial T}\right)_V
$$
So \eqref{eq:first-law} becomes
\begin{align}
\left(\frac{\partial U}{\partial V}\right)_T &=
-P + T\left(\frac{\partial P}{\partial T}\right)_V
\tag{4}\label{eq:with-Maxwell}
\end{align}
Then inserting the results of \eqref{eq:heat-cap-const-v} and \eqref{eq:with-Maxwell} into \eqref{eq:total-differential} we obtain the general result (when only $pV$ work is done):
$$
\mathrm{d}U =
\left[ -P + T\left(\frac{\partial P}{\partial T}\right)_V \right]
\mathrm{d}V + C_V \mathrm{d}T
\tag{5}
$$
If you plug in the equation of state for an ideal gas you then obtain
$$\left(\frac{\partial U}{\partial V}\right)_T = 0$$
and the expected result
$$\mathrm{d}U = C_V \mathrm{d}T.$$