Why is the internal energy of a real gas a function of pressure and temperature only?
Solution 1
Ideal gas
In thermodynamics, the fact that the energy of an ideal gas depends only on temperature is an experimental observation from the free expansion of a diluted gas (which is approximately ideal) 1. In statistical mechanics, it can be proven 2.
Ultimately, the reason is that the atoms of an ideal gas are noninteracting point particles. They only have kinetic energy, but don't "see" each other at all. The average kinetic energy is nothing else than the temperature of the ideal gas.
Therefore, no matter how much you decrease the volume of the box: since they don't interact, the energy will remain the same if the temperature (=average kinetic energy) is unchanged.
For more realistic models, you have an interaction potential $U$ which is usually assumed to be the sum of pairwise components that depend on the distance between particle $i$ and particle $j$,
$$U(\vec r_i, \dots, \vec r_N) = \sum_{i=1,j<i}^N u(\vec r_i  \vec r_j)$$
When the volume is reduced the average interparticle distance is reduced, and therefore, because of the presence of $U$, the energy will change even if $T$ is kept constant.
Real gas
In general the energy $E$ of a real gas will be a function of all the relevant thermodynamic parameters, which are $P,V$ and $T$:
$$E_{rg} = E(P,V,T)\tag{1}\label{1}$$
However, there is always an equation of state connecting $P,V$ and $T$:
$$f(P,V,T)=0\tag{2}\label{2}$$
An example is the van der Waals equation of state:
$$\left( P + \frac{a n^2}{V^2}\right) (Vnb) = nRT$$
You can solve \ref{2} for $V$, obtaining
$$V = g(P,T) \tag{3}\label{3}$$
Substituting \ref{3} in \ref{1}, you obtain
$$E(P,V,T)=E(P,g(P,T),T)= \tilde E(P,T)$$
So that $E$ only depends on two thermodynamic variables.
1 The experiment was first performed by Joule and it works like this: you let a diluted gas, initially confined in a side of a container, freely expand in the whole container. Assuming that the container is adiabatic (no heat exchange), the work done $W$ and the heat exchanged $Q$ are both zero. Therefore, from the first law, $\Delta E=0$: the energy is unchanged. The volume has changed, and also the pressure. Experimentally, it is observed that the temperature has not changed. You conclude therefore that $E$ must be a function of $T$ only. You can find this argument in E. Fermi, Thermodynamics, Chapter 2.
2 See for example K. Huang, Statistical Mechanics, Chapter 6.5
Solution 2
For any thermodynamic equilibrium state of a single phase fluid of constant composition, the pressure, temperature, and specific volume are interrelated by the Equation of State of the fluid. So, once any two of these are specified, the third is determined. That means that the internal energy per mole (which is a function of state) is likewise determined by any two of these.
From a combination of the first and second laws of thermodynamics, we find that we an express the change in internal energy per mole between any two closely neighboring thermodynamic equilibrium states of a single phase fluid of constant composition (including nonideal gases) by the equation: $$dU=C_vdT\left[PT\left(\frac{\partial P}{\partial T}\right)_V\right]dV$$where V is the molar volume. So, in general, the internal energy is a function of two intensive properties, in this case T and V. But, in the case of an ideal gas, the equation of state is such that the second term in this equation is identically equal to zero. (Substitute P=RT/V to confirm this). So the ideal gas is a special case in which the molar internal energy is a function only of temperature.
Related videos on Youtube
MrAP
Updated on August 01, 2022Comments

MrAP 10 months
While studying thermodynamics, I read that the internal energy of an ideal gas is a function of temperature only. On searching the internet, i found an article which stated that the internal energy of a real gas is a function of temperature and pressure only. I could not find a proper reason for this.
So my question is: why is the internal energy of an ideal gas a function of temperature only and that of a real gas a function of temperature and pressure only?
Is this property of ideal gases and real gases derivable through any equation?

MrAP about 5 yearsI could not understand the last three lines: "The energy of a real gas ... dependence from $V$".

valerio about 5 years@MrAP I tried to clarify. Is it clearer now?

MrAP about 5 yearsYes. I think the heading "Real gas" should be above the line: "For more realistic models...".

valerio about 5 years@MrAP I think it's fine there. Yes I am talking about real gases, but it's still because I want to explain the ideal gas case.

Admin over 4 yearsIf the internal energy of an ideal gas depends only on $T$ how do we understand the first principle where $\Delta U= Q + W$, cause we can compress a gas at constant temperature and there will be work so internal energy varies.

S H over 3 years@user153036 not necessarily. Don't take equations on face value, it always helps to understand the context of the actual process. As the answer states above, if the temperature of an ideal gas is kept constant, the internal energy will not change. Therefore in the process you're considering, the work done in compressing the gas is translated into a heat loss (0 = Q +W ... Q = W)