# Internal energy of an ideal gas as a function of volume

Okay so I've been reading a bit on Thermodynamics and I found something that I couldn't wrap around my head. For an ideal gas, the change in internal energy is equal to

$$\Delta U = Q + W$$

And also, if the internal energy is a function of volume and temperature, we can write

$$\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$$

Which is the same as

$$\mathrm{d}U = \pi_T \mathrm{d}V+C_V \mathrm{d}T$$

Now the book I'm reading, Atkins' Physical Chemistry, argues that $\pi_T$ is equal to zero for ideal gases. The book reasoned by using the expression $U = \frac{NfkT}{2}$, where $f$ is the number of degrees of freedom. My question is, if the internal energy of an ideal gas is independent of its volume, then how it is possible then that doing work to the system changes its internal energy? As $$W=-\int_{V_i}^{V_f}P(V)\mathrm{d}V$$ Clearly there is a change in volume (e.g. from pushing a piston). Furthermore, the expression $U = \frac{NfkT}{2}$ can easily be converted into $U = \frac{fPV}{2}$ by invoking the ideal gas law.

Since it is claimed that the internal energy of an ideal gas is independent of its volume, the above reasoning that I came in conclusion doesn't seem to support it. I know there must be something wrong with my reasoning, but I can't figure it out. What am I doing wrong here?

• The jargon word in physics is "ensemble"; you are correct to notice that there is an increase in internal energy in the "microcanonical ensemble" $dU = T dS - P dV + \sum_i \mu_i dN_i$ where the piston is off in space far away from anything, but when you transition from $U$ to the Helmholtz free energy $F = U - TS$ to get $dF = -S dT - P dV + \sum_i \mu_i dN_i$ you are transforming to the "canonical ensemble" where the piston is in good thermal contact with an infinite reservoir held at a fixed temperature. In the situation you describe, this reservoir steals all of the work $W$ that you did. Aug 12, 2015 at 14:00
• @ChrisDrost that should probably be an answer Aug 12, 2015 at 18:58
• @DavidZ only if I add a lot of explanation about what all of that means. I'll think about that... Aug 12, 2015 at 20:23

So if we consider $U$ as a function of volume and entropy we get $$\mathrm{d}U = \left(\frac{\partial U}{\partial S}\right)_V \mathrm{d}S + \left(\frac{\partial U}{\partial V}\right)_S \mathrm{d}V.$$ Now $P = \left(\frac{\partial U}{\partial V}\right)_S$ and is certainly not equal to 0.
The particular case of an ideal gas is unusual because it terns out that the internal energy is only a function of temperature. This means $\left(\frac{\partial U}{\partial X}\right)_T = 0$ for any variable $X$. If we choose our thermodynamic degrees of freedom to be variable other than $T$ however, say for concreteness $S$ and $V$ again, then we are treating $T$ as a function of $S$ and $V$ as well and so $U$ gains a dependence on $V$ and $S$ through $T$.