Why doesn't $dU=nC_{v}\,dT$ hold for all substances? Consider the following proof for change in internal energy of real gases, liquids and solids(assuming Non-$PV$ work $=0$):

*

*Let X denote real gases, liquids, and solids

*The First law of thermodynamics is $dU=dQ-dW=dQ-PdV$, which also holds for X

*At constant volume, $dU_{v}=dQ_{v}-0$.

*Now, $dQ_{v}=nC_{v}\,dT$ is a trivial expression and thus, will also hold for X.

*So we have $dU=nC_{v}\,dT$.

*Since U is a state function(in terms of V and T), $dU_{v}=dU$ since the path is irrelevant.

*Thus, we get $dU=nC_{v}\,dT$ for all X.

However, some sources indicate that $dU=nC_{v}\,dT$ is applicable only for ideal gases. Are they correct? If so, what is the mistake in this proof?
Addendum:
It seems the issue is in point 6 in that $dU_{v}=du$ cannot be used. This is because the internal energy change does not depend on the path, but if you are choosing an alternative path to calculate $du$ (like isochoric), that path needs to exist between the two states. So $dU=nC_{v}\,dT$ is true for an isochoric process for all X, but not in general for any process. But, why doesn't this issue arise in ideal gases?
 A: The issue is in point 6 in that $du_v=du$ cannot be used. This is because the internal energy change does not depend on the path but if you are choosing an alternative path to calculate du(like isochoric), that path needs to exist between the two states. so $du_v=nC_vdT$ is true for an isochoric process for all X, but not in general for any process.
Now, why doesn't this issue arise in ideal gases?
Let us consider an ideal gas going from $(P_1,V_1,T_1)$ to $(P_2,V_2,T_2)$. Regardless of whether the process is reversible or irreversible, $PV=nRT$ will hold at the endpoints so we can rewrite as $(\frac{kT_1}{V_1},V_1,T_1)$ to $(\frac{kT_2}{V_2},V_2,T_2)$. Now, since U is a state function, we can devise a path convenient to us to calculate $\Delta U$. Now,let us devise a path in 2 steps:-
Step 1: $(\frac{kT_1}{V_1},V_1,T_1)$ to $(\frac{kT_1}{V_2},V_2,T_1)$
Step 2: $(\frac{kT_1}{V_2},V_2,T_1)$ to $(\frac{kT_2}{V_2},V_2,T_2)$
In step 1, $\Delta U=0$ since U is only a function of T in ideal gases. In step 2, $\Delta U=nC_v\Delta T$ since it is an isochoric process.
Combining we get, $\Delta U=0+nC_v\Delta T=nC_v\Delta T$
Thus, we have proved that $\Delta U=nC_v\Delta T$ for any process of an ideal gas. Now, this analysis doesn't hold for a real gas because $\Delta U\neq0$ in step 1 since U is a function of V and T both. However, if the process in a real gas is isochoric, then $\Delta U=nC_v\Delta T$ does hold since we have eliminated step 1.
In conclusion, although  $\Delta U$ (and in general, change in any state function) does not depend on the path taken, the path is not to be completely ignored because you need to prove that your alternative path can in fact exist.
A: For a constant volume transformation, the relation is always true: it is simply a definition of Cv !
A: There is a difference between a constant volume (isochoric) process (step 3 in your "proof") and the infinite number of possible paths between two equilibrium states where the initial and final volume is the same.
For a gas where the initial and final volume is the same, it is true that $dq=nC_{v}dt$, even if the volume is not constant for the path between the two states (i.e., it is true for all paths between the two states).
When the initial and final volumes of a gas is not the same, it is only true that $du=nC_{v}dT$ in the case of an ideal gas. See my derivation here: How can internal energy be $\Delta{U} = nC_{v}\Delta{T}$?
Hope this helps.
