Using the molar volume definition, we can rewrite the ideal gas law as a ratio that will always equal one:
For real gases, however, this ratio very rarely is equal to one. This ratio is a useful metric for deviation of a gas from ideality, and it appears often enough that we can give this ratio its own definition, Z, the compressibility factor:
If Z is less than 1, the gas is more compact than we'd predict the corresponding ideal gas to be; if Z is greater than 1, the gas is more spread out than we'd predict the corresponding ideal gas to be. Graphs of compressibilities of gases are some of the first comparison graphs you tend to get exposed to in physical chemistry, and it's worth it to look closely at an example of such a graph and interpret it.
Compressibility factors as a function of temperature and pressure for nitrogen gas.
Image taken from "Retired Pchem Prof" on Wikimedia Commons; CC BY-SA 4.0.
The most vivid differences in compressibility on this graph for nitrogen are found at a temperature of 220 K. At this comparatively low temperature, nitrogen molecules are able to attract one another more than you'd expect for an ideal gas even when the pressure the gas is under gets relatively high; therefore the gas tends to be more densely packed than ideal, and the compressibility is less than 1. However, when pressure gets high enough (approximately above 230 bar), repulsion between the gas molecules because of their volume takes over, and the gas molecules are more spread out than you would expect an ideal gas to be at that pressure; the compressibility is greater than 1.
At higher temperatures, as you'd expect, there is much less attraction between the gas molecules because the speed at which the molecules are moving don't allow for a great deal of attraction. Once the temperature reaches a certain level, at no point do the gas molecules appear to attract one another into a more dense packing at all; any substantial pressure causes the repulsive effects to have greater significance.
The virial equation is even more elegantly written in terms of the compressibility factor:
Our tabulation of the second virial coefficient in the last section made note that the values of B depend on temperature. There were certain values of B for low temperatures that were negative, and for high temperatures that were positive. The immediate implication is that there is a temperature where B goes to zero, and (if we continue to ignore the higher terms of the virial expansion as we have been), the compressibility factor reverts back to one:
This Boyle temperature is unique for every gas. The virial equation doesn't give a whole lot of clarity to what the Boyle temperature actually represents, however, other than a temperature where virial properties magically go to zero.
Making the van der Waals equation fit into the form of the compressibility factor is a bit more of an algebraic challenge, but a worthwhile one to take on. Let's start by taking the van der Waals equation in terms of the molar volume, and solve the equation for pressure:
By then multiplying every term by the molar volume divided by RT, we can then build an expression that's equivalent to the compressibility factor:
We have one term in this difference with molar volume isolatable in the denominator; in order to make this equivalent to the virial equation, we need to have the other term set up like this as well. It turns out that the best first step to do this is to transform the first term into a Taylor series expansion. We start by dividing top and bottom of that fraction by the molar volume:
We now have the first term in the form 1/1-x, which can be expanded by the Taylor series into 1 + x + x2 + x3 + ... Here, x is b divided by the molar volume:
Recall the full form of the virial equation that we rederived earlier in the section in terms of the molar volume:
We've only provided values for the second virial coefficient B; that's because we made the decision that only extending the virial equation to the second term would be sufficient for approximating the real behavior of a gas. For a similar reason, we're going to limit the Taylor series expansion to eliminate terms in the molar volume squared and beyond. The simplified version of the rearranged van der Waals and virial equations, therefore, are these:
The upshot of all of this rearrangement is that we've expressed the second virial coefficient B in terms of the two van der Waals coefficients:
That's not the only benefit to this derivation. At the Boyle temperature TB, we achieve ideality in gas behavior; in terms of the virial equation, B = 0 at the Boyle temperature. Therefore we can do one more simple rearrangement:
The van der Waals constants, therefore, contain information about when the gas behaves ideally.
Building these kinds of theoretical connections between relationships is one of the core tasks we pursue in our study of physical chemistry. We can make a great deal of headway with algebraic rearrangement. Ultimately, however, we'll need the tools of the calculus to describe changes in the systems we'll study over time.