Unit content
Gas density and molar mass from the ideal-gas law
The ideal-gas law connects a gas's macroscopic state to its amount of substance. Combining it with mass gives useful relations for gas density and molar mass.
Start from
$$pV=nR_uT$$
and use
$$n=\frac{m}{M},$$
where $m$ is mass and $M$ is molar mass. Then
$$pV=\frac{m}{M}R_uT.$$
Because mass density is
$$\rho=\frac{m}{V},$$
rearranging gives
$$\boxed{\rho=\frac{pM}{R_uT}}.$$
Thus, at the same temperature and pressure, an ideal gas with larger molar mass has larger density.
The same equation can be solved for molar mass:
$$\boxed{M=\frac{\rho R_uT}{p}}.$$
Example
A gas has density $1.84,\mathrm{g/L}$ at $100,\mathrm{kPa}$ and $300,\mathrm K$. Using
$$R_u=8.314,\mathrm{kPa,L,mol^{-1},K^{-1}},$$
its molar mass is
$$M=\frac{(1.84,\mathrm{g/L})(8.314,\mathrm{kPa,L,mol^{-1},K^{-1}})(300,\mathrm K)}{100,\mathrm{kPa}} \approx45.9,\mathrm{g/mol}.$$
If a gas sample's mass, volume, pressure and temperature are measured experimentally, this relation therefore provides an estimate of its molar mass.
The result assumes ideal behavior. At high pressure or near condensation, nonideal gas behavior can make a molar mass inferred from the ideal equation systematically inaccurate.