The The Ideal Gas Law assumes molecules take up no room and don't attract each other. Real molecules do both: they have size, and the forces between molecules pull them together. Most of the time these effects are tiny; sometimes they are not.
Key idea
Real gases behave most ideally at high temperature and low pressure. They stray at high pressure, where the molecules' own volume matters (the gas is harder to compress, $PV/nRT > 1$), and at low temperature, where attractions matter (the gas presses less on the walls, $PV/nRT < 1$). The van der Waals equation corrects for both: $$\left(P + \frac{an^2}{V^2}\right)(V - nb) = nRT.$$
Why it works
At low pressure the molecules are far apart: their own volume is a tiny part of the container, and they are rarely close enough to attract. At high pressure they are crowded, so the empty space they can move in, $V - nb$, is noticeably less than $V$. At low temperature they move slowly, so attractions have time to act: a molecule about to hit the wall is tugged back by its neighbors and hits more softly, lowering the pressure by $an^2/V^2$. The constant $a$ is larger for molecules with stronger intermolecular forces ($\mathrm{H_2O}$, $\mathrm{NH_3}$), and $b$ is larger for bigger molecules.
| Gas | $a$ (L²·atm/mol²) | $b$ (L/mol) |
|---|---|---|
| He | 0.0341 | 0.0237 |
| $\mathrm{N_2}$ | 1.39 | 0.0391 |
| $\mathrm{CO_2}$ | 3.59 | 0.0427 |
| $\mathrm{NH_3}$ | 4.17 | 0.0371 |
| $\mathrm{H_2O}$ | 5.46 | 0.0305 |
Worked example: Ideal against real
Find the pressure of $1.00\ \text{mol}$ of $\mathrm{CO_2}$ in $1.00\ \text{L}$ at $300\ \text{K}$, first as an ideal gas, then with the van der Waals equation.
- Ideal: $$P = \dfrac{nRT}{V} = (1.00)(0.08206)(300)/1.00 = 24.6\ \text{atm}$$
- Van der Waals: $$P = \dfrac{nRT}{V - nb} - \dfrac{an^2}{V^2} = \dfrac{24.62}{1.00 - 0.0427} - 3.59 = 25.72 - 3.59$$
- $P = 22.1\ \text{atm}$, about 10% lower: here the attractions win over the molecules' volume.
Answer: $24.6\ \text{atm}$ ideal; $22.1\ \text{atm}$ real.
Worked example: Which gas is least ideal?
At the same temperature and pressure, which deviates most from ideal behavior: He, $\mathrm{N_2}$ or $\mathrm{NH_3}$?
- Deviations at moderate conditions come mostly from attractions, measured by $a$.
- $\mathrm{NH_3}$ (polar, hydrogen bonding) has the largest $a$, 4.17; helium the smallest.
Answer: $\mathrm{NH_3}$
Common mistake
Reversing the conditions: thinking real gases stray most at high temperature and low pressure. Those are exactly the conditions where molecules are far apart and fast, so they act most ideally. Check: think of what makes a gas condense to a liquid, which is low temperature and high pressure. The closer a gas is to condensing, the less ideal it behaves.