# Equations for internal energy and their relevance to the derivation of the equation for entropy for perfect gases

My lecture handout proves derives an expression for entropy thus:

For a perfect gas $U=U(T)$ (i.e. is not dependent on volume; only temperature). Therefore, $(\frac{\partial U}{\partial V})_T=0$

Therefore:

Equation 1) $$dU=(\frac{\partial U}{\partial V})_TdV+(\frac{\partial U}{\partial T})_VdT=C_VdT$$ Since $(\frac{\partial U}{\partial T})_V=C_V$

Now, for a reversible change:

Equation 2) $$dU=dq_{rev}+dw_{rev}=dq_{rev}-PdV$$

Equation 3) $$dq_{rev}=PdV+dU=\frac{nRT}VdV+C_VdT$$ Then divide by $T$ to make the equation equal to entropy rather than heat:

$$dS=\frac{nR}{V}dV+C_VdT$$

I have a couple of issues with this. Mainly stemming from the fact that $U=U(T)$ and therefore that $(\frac{\partial U}{\partial V})_T=0$. I understand it on a physical level why this is the case (no intermolecular forces). I am not asking for a proof of this; I just have an issue with the implications of this. Let me explain:

An equation for dU is:

$$dU=TdS-PdV$$

This is understandable. $TdS$ accounts for heat transfer in/out of a system and $PdV$ accounts for work done by/on the system. However, surely this equation implies that $U=U(S,T)$ since both $dS$ and $dT$ appear in the expression.

The crux of it is: how can $dU=C_VdT$ and $dU=TdS-PdV$. Please help me understand what's going on here.

Your equation $dU = TdS - pdV$ is valid for all pure substances, not just ideal gases. It is telling you that if you knew an equation that explicitly defined $U$ as a function of $S$ and $T$, then you could calculate all other thermodynamic properties of that substance, i.e. if you knew that $U=f(S, V)$, then you could easily calculate $T$ and $p$ because $T=\frac{\partial f(S, V)}{\partial S}$ and $p=\frac{\partial f(S, V)}{\partial V}$. This is because $S$ and $V$ are canonical variables for $U$.
Now let's apply the ideal gas equation $dU=C_V dT$. You can integrate this to yield $U=C_V T + K$. Unfortunately, this does not express $U$ as a function of $S$, but rather of $T$. So how do we proceed? This physics.se question has a good general answer.
But in this specific case things are bit easier. Let's find $dS$ from the equation you were given.
$dS =\frac{1}{T}(dU + p dV)=\frac{1}{T}(C_V dT + \frac{RT}{V}dV)=C_V \frac{dT}{T} + R \frac{dV}{V}$
Since you now know $dS$ and from the ideal gas law you also know $p dV$, you have an expression for $dU$ from which you can derive all thermodynamic quantities.