How to Calculate Gas Density Using the Ideal Gas Law

Learn how to calculate the density of a gas using the ideal gas equation. Follow step-by-step worked examples covering unit conversions, molar mass, absolute pressure, gas mixtures, and corrections for gases collected over water.

Two identical 1.00 L containers hold different gases at the same temperature and pressure. One contains helium, and the other contains carbon dioxide. According to the ideal gas law, both containers hold the same number of moles of gas. Does that mean they have the same density?

No. A mole of carbon dioxide has much more mass than a mole of helium. The containers have the same volume and contain the same number of particles, but the mass of those particles is different.

This is the key to calculating gas density using the ideal gas law: you need the gas’s molar mass, its absolute pressure, and its absolute temperature.

The equation you need is:

\[ \boxed{\rho=\frac{PM}{RT}} \]

where \(\rho\) is gas density, \(P\) is absolute pressure, \(M\) is molar mass, \(R\) is the ideal gas constant, and \(T\) is temperature in kelvin.

For the usual HSC Chemistry combination of pressure in kPa, molar mass in g mol\(^{-1}\), and temperature in K, the answer will be in g L\(^{-1}\).

01Deriving the gas density equation

You probably already know the ideal gas equation:

\[ PV=nRT \]

It connects pressure, volume, amount of gas, and temperature.

But density is defined as mass divided by volume:

\[ \rho=\frac{m}{V} \]

So how do we get from an equation involving moles to one involving mass?

The missing link is molar mass.

Molar mass tells us how much one mole of a substance weighs:

\[ M=\frac{m}{n} \]

Rearranging:

\[ n=\frac{m}{M} \]

Substitute this into the ideal gas equation:

\[ PV=\frac{m}{M}RT \]

Rearrange to make mass divided by volume the subject:

\[ \frac{m}{V}=\frac{PM}{RT} \]

Since mass divided by volume is density:

\[ \boxed{\rho=\frac{PM}{RT}} \]

That’s the equation you need.

Notice something important: density increases with pressure and molar mass, but decreases with temperature.

At the same pressure and temperature, a gas with a larger molar mass has a greater density.

If you need to revisit the relationships behind this derivation, see Ideal Gas Law and Gas Relationships for HSC Chemistry.

02Getting the units right

Most mistakes in gas density calculations happen before a student even reaches the calculator.

The equation is only useful if your units match the value of \(R\).

For HSC Chemistry, the most convenient combination is:

\[ R=8.314\ \mathrm{kPa\,L\,mol^{-1}\,K^{-1}} \]

With this value, use:

QuantitySymbolRequired unit
Pressure\(P\)kPa
Molar mass\(M\)g mol\(^{-1}\)
Temperature\(T\)K
Gas constant\(R\)8.314 kPa L mol\(^{-1}\) K\(^{-1}\)
Density\(\rho\)g L\(^{-1}\)

You can also use other consistent combinations:

PressureMolar massGas constantDensity
kPag mol\(^{-1}\)8.314 kPa L mol\(^{-1}\) K\(^{-1}\)g L\(^{-1}\)
Pakg mol\(^{-1}\)8.314 Pa m\(^3\) mol\(^{-1}\) K\(^{-1}\)kg m\(^{-3}\)
atmg mol\(^{-1}\)0.08206 L atm mol\(^{-1}\) K\(^{-1}\)g L\(^{-1}\)

For most HSC calculations, stick with kPa and litres. It keeps the arithmetic straightforward.

Temperature must be in kelvin

The ideal gas equation uses absolute temperature, not degrees Celsius.

Convert using:

\[ T(\mathrm K)=t(^{\circ}\mathrm C)+273.15 \]

For example:

\[ 25.0^{\circ}\mathrm C=298.15\ \mathrm K \]

Never substitute \(25.0\) directly into the density equation.

Pressure must be absolute

This is another important detail.

Absolute pressure is measured relative to a perfect vacuum. Gauge pressure is measured relative to the surrounding atmospheric pressure.

The relationship is:

\[ P_{\mathrm{absolute}} = P_{\mathrm{gauge}}+P_{\mathrm{atmospheric}} \]

A positive gauge pressure means the gas pressure is above atmospheric pressure. A negative gauge pressure means it is below atmospheric pressure.

You must use absolute pressure in the ideal gas equation.

If a question gives atmospheric pressure and gauge pressure separately, add them before calculating density.

03How gas density can be measured experimentally

The ideal gas equation predicts gas density, but how could you check whether that prediction matches an actual gas sample?

The challenge is that gases have relatively low densities. We need a way to measure the mass of a known volume of gas accurately.

One approach uses a rigid container of known volume.

The apparatus

Imagine a calibrated glass bulb with a stopcock. The bulb is connected through a valve to a vacuum pump and a supply of dry gas. A pressure sensor measures the gas pressure, and a thermometer measures its temperature.

The bulb can also be placed on a balance.

The experiment follows this sequence:

  1. Measure the internal volume of the rigid bulb.
  2. Evacuate the bulb to remove the air inside.
  3. Close the valve and weigh the evacuated bulb. Record its mass as \(m_1\).
  4. Introduce the dry gas until it reaches the desired pressure.
  5. Allow the gas to reach thermal equilibrium with its surroundings.
  6. Record the absolute pressure and temperature.
  7. Isolate the bulb and weigh it again. Record its mass as \(m_2\).

The mass of the gas is the difference:

\[ m_{\mathrm{gas}}=m_2-m_1 \]

Its experimentally measured density is:

\[ \boxed{\rho_{\mathrm{experimental}} =\frac{m_2-m_1}{V}} \]

What should the experiment show?

Suppose the gas is carbon dioxide, and its pressure and temperature are known.

The ideal gas equation predicts a particular density. The balance provides an independent measurement of the gas’s mass, allowing the experimental density to be calculated.

If the two values agree closely, the result supports the use of the ideal-gas model under those conditions.

If they disagree, there are several possibilities:

  • The gas may not have reached the measured temperature.
  • The pressure measurement may be incorrect.
  • The gas may contain air or water vapour.
  • The gas may have leaked.
  • The real gas may deviate from ideal behaviour.

The last point is a limitation of the model, rather than necessarily an experimental mistake.

The ideal-gas model assumes that gas particles occupy negligible volume and experience negligible intermolecular attractions. Real gas particles have volume and interact with one another.

The model generally works better at relatively low pressures and high temperatures, particularly when the gas is far from condensing.

For a more detailed explanation of these limitations, see When Is the Ideal-Gas Model a Good Approximation?.

Worked example: Compare measured and predicted carbon dioxide density

An evacuated rigid bulb has an internal volume of \(0.5000\ \mathrm L\) and a mass of \(125.432\ \mathrm g\).

After filling the bulb with dry carbon dioxide, its mass increases to \(126.331\ \mathrm g\).

The gas is at an absolute pressure of \(101.3\ \mathrm{kPa}\) and a temperature of \(25.0^{\circ}\mathrm C\).

Calculate:

(a) The experimentally measured density of carbon dioxide.

(b) The density predicted by the ideal gas equation.

(c) Whether the two results agree.

All measurements are illustrative data.

MeasurementValue
Empty evacuated bulb mass125.432 g
Filled bulb mass126.331 g
Bulb volume0.5000 L
Absolute pressure101.3 kPa
Temperature25.0°C
Molar mass of CO\(_2\)44.01 g mol\(^{-1}\)

Step 1

Subtract the mass of the evacuated bulb from the mass of the filled bulb:

\[ \begin{aligned} m_{\mathrm{gas}} &=126.331-125.432\\ &=0.899\ \mathrm g \end{aligned} \]

Step 2

Use the definition of density:

\[ \begin{aligned} \rho_{\mathrm{experimental}} &=\frac{m}{V}\\ &=\frac{0.899}{0.5000}\\ &=1.798\ \mathrm{g\,L^{-1}} \end{aligned} \]

Step 3

\[ T=25.0+273.15=298.15\ \mathrm K \]

Step 4

Use:

\[ \rho=\frac{PM}{RT} \]

Substitute the known values:

\[ \begin{aligned} \rho &=\frac{(101.3)(44.01)} {(8.314)(298.15)}\\ &=1.799\ \mathrm{g\,L^{-1}} \end{aligned} \]

Step 5

The experimental density is \(1.798\ \mathrm{g\,L^{-1}}\), while the ideal-gas prediction is \(1.799\ \mathrm{g\,L^{-1}}\).

These values agree extremely closely at the stated precision.

The result supports the ideal-gas approximation for this illustrative sample. It does not prove that carbon dioxide behaves as a perfectly ideal gas.

04An important correction: Gas collected over water

Now consider a slightly different experimental setup.

You collect a gas by allowing it to displace water in an inverted measuring cylinder.

The volume of gas is easy to measure, but there is a problem: the gas inside the cylinder is not completely dry.

Some water evaporates into the space above the liquid. The collected sample contains both the gas you want and water vapour.

This changes the pressure calculation.

Why does water vapour matter?

According to Dalton’s law of partial pressures, the total pressure of a gas mixture is the sum of the partial pressures of its components.

For a gas collected over water:

\[ P_{\mathrm{total}} = P_{\mathrm{gas}}+P_{\mathrm{water}} \]

Therefore:

\[ \boxed{ P_{\mathrm{gas}} = P_{\mathrm{total}}-P_{\mathrm{water}} } \]

You must use the partial pressure of the dry gas in your density calculation.

If you substitute the total pressure instead, you will calculate a density that is too high.

The water vapour pressure depends on temperature. In an HSC question, the required value will generally be supplied.

There is one more experimental detail: if the water levels inside and outside the measuring cylinder are equal, the total gas pressure equals atmospheric pressure.

If the water levels differ, a hydrostatic pressure correction is needed before subtracting the water vapour pressure.

Worked example: Calculate the density of nitrogen collected over water

A sample of nitrogen is collected over water in an inverted measuring cylinder.

The following illustrative measurements are recorded:

MeasurementValue
Total gas pressure101.3 kPa
Water vapour pressure3.17 kPa
Temperature25.0°C
Gas volume0.750 L
Molar mass of nitrogen28.02 g mol\(^{-1}\)

The water levels inside and outside the cylinder are equal.

Calculate:

(a) The density of dry nitrogen.

(b) The mass of dry nitrogen collected.

Assume ideal behaviour and that the gas is saturated with water vapour.

Step 1

Subtract the water vapour pressure from the total pressure:

\[ \begin{aligned} P_{\mathrm{N_2}} &=P_{\mathrm{total}}-P_{\mathrm{H_2O}}\\ &=101.3-3.17\\ &=98.13\ \mathrm{kPa} \end{aligned} \]

This is the pressure to use in the density equation.

Step 2

\[ T=25.0+273.15=298.15\ \mathrm K \]

Step 3

\[ \begin{aligned} \rho &=\frac{PM}{RT}\\ &=\frac{(98.13)(28.02)} {(8.314)(298.15)}\\ &=1.109\ \mathrm{g\,L^{-1}} \end{aligned} \]

Step 4

Rearrange the density equation:

\[ m=\rho V \]

Substitute:

\[ \begin{aligned} m&=(1.109)(0.750)\\ &=0.832\ \mathrm g \end{aligned} \]

The sample contains approximately \(0.832\ \mathrm g\) of dry nitrogen.

Why would using the total pressure be incorrect?

If you used \(101.3\ \mathrm{kPa}\) instead of \(98.13\ \mathrm{kPa}\), you would include the contribution of water vapour in the pressure attributed to nitrogen.

The calculated nitrogen density would be approximately \(1.145\ \mathrm{g\,L^{-1}}\), which is too high.

The important lesson is that the pressure in the density equation must belong to the gas whose density you are calculating.

05A quick decision process before calculating

Before substituting values, check what the question actually gives you.

Question detailWhat you should do
Temperature in °CConvert to K
Pressure in gauge unitsConvert to absolute pressure
Gas collected over waterSubtract water vapour pressure
Gas is a mixtureCalculate its average molar mass
Molar mass is not givenCheck whether density can be used to calculate it
Gas is stated to be idealUse \(\rho=PM/(RT)\)
Gas is at high pressure or low temperatureConsider whether the ideal-gas approximation is appropriate

For a pure, dry gas with known molar mass, the calculation is straightforward:

  1. Identify the molar mass.
  2. Convert temperature to kelvin.
  3. Make sure pressure is absolute and belongs to the gas being studied.
  4. Select the correct value of \(R\).
  5. Substitute into \(\rho=PM/(RT)\).
  6. Check that your answer has the correct units.

One final distinction is worth remembering.

Experimental corrections and ideal-gas assumptions are not the same thing.

Correcting gauge pressure, subtracting water vapour pressure, or accounting for a temperature difference makes your experimental inputs more accurate.

It does not make a real gas behave ideally. If intermolecular forces or particle volume become significant, the ideal-gas model itself may no longer be sufficiently accurate.

06Questions and solutions

The following questions build from a straightforward density calculation to situations where you need to combine gas composition, pressure corrections, and changes in experimental conditions.

Question 1

A sample of pure oxygen is held at an absolute pressure of \(100.0\ \mathrm{kPa}\) and a temperature of \(20.0^{\circ}\mathrm C\).

The molar mass of oxygen is \(32.00\ \mathrm{g\,mol^{-1}}\).

Calculate the density of the oxygen, assuming ideal behaviour. Give your answer in \(\mathrm{g\,L^{-1}}\).

Solution 1

The density of oxygen is \(1.31\ \mathrm{g\,L^{-1}}\).

Use the ideal-gas density equation:

\[ \rho=\frac{PM}{RT} \]

First, convert the temperature:

\[ T=20.0+273.15=293.15\ \mathrm K \]

The pressure is already absolute and expressed in kPa, so use:

\[ R=8.314\ \mathrm{kPa\,L\,mol^{-1}\,K^{-1}} \]

Substitute:

\[ \begin{aligned} \rho &=\frac{(100.0)(32.00)} {(8.314)(293.15)}\\ &=\frac{3200}{2437.25}\\ &=1.31\ \mathrm{g\,L^{-1}} \end{aligned} \]

The oxygen has a density of approximately \(1.31\ \mathrm{g\,L^{-1}}\) under the stated conditions.

The key is to convert Celsius to kelvin before substituting. Using \(20.0\) directly would produce an incorrect result.

Question 2

A pure gas is contained in a rigid vessel at \(35.0^{\circ}\mathrm C\).

A pressure gauge connected to the vessel reads \(+145\ \mathrm{kPa}\). The atmospheric pressure is \(100.8\ \mathrm{kPa}\).

The molar mass of the gas is \(58.12\ \mathrm{g\,mol^{-1}}\).

Calculate the gas density, assuming ideal behaviour.

A student substitutes \(145\ \mathrm{kPa}\) directly into the ideal-gas density equation. Explain why this gives an incorrect answer and whether it overestimates or underestimates the density.

Solution 2

The correct gas density is \(5.58\ \mathrm{g\,L^{-1}}\). Using the gauge pressure directly would underestimate the density.

The first step is to recognise that the gauge does not measure absolute pressure.

Step 1: Calculate the absolute pressure.

Use:

\[ P_{\mathrm{absolute}} = P_{\mathrm{gauge}}+P_{\mathrm{atmospheric}} \]

Therefore:

\[ \begin{aligned} P_{\mathrm{absolute}} &=145+100.8\\ &=245.8\ \mathrm{kPa} \end{aligned} \]

Step 2: Convert the temperature to kelvin.

\[ T=35.0+273.15=308.15\ \mathrm K \]

Step 3: Calculate the density.

\[ \begin{aligned} \rho &=\frac{PM}{RT}\\ &=\frac{(245.8)(58.12)} {(8.314)(308.15)}\\ &=5.58\ \mathrm{g\,L^{-1}} \end{aligned} \]

Step 4: Explain the student’s error.

The student used \(145\ \mathrm{kPa}\), which represents only the pressure above atmospheric pressure.

The actual pressure of the gas relative to a vacuum is \(245.8\ \mathrm{kPa}\).

Because density is directly proportional to absolute pressure when molar mass and temperature are constant, using the smaller gauge pressure produces a density that is too low.

The distinction between gauge and absolute pressure is especially important in questions involving pressurised gas cylinders.

Question 3

A sealed vessel contains an ideal gas mixture consisting of:

  • \(25.0\%\) methane by mole.
  • \(75.0\%\) argon by mole.

The mixture is at an absolute pressure of \(105.0\ \mathrm{kPa}\) and a temperature of \(298.0\ \mathrm K\).

The molar masses are:

  • Methane: \(16.04\ \mathrm{g\,mol^{-1}}\).
  • Argon: \(39.95\ \mathrm{g\,mol^{-1}}\).

Calculate:

(a) The average molar mass of the mixture.

(b) The density of the mixture.

(c) The mass of gas in a \(1.50\ \mathrm L\) sample.

Solution 3

The average molar mass is \(33.97\ \mathrm{g\,mol^{-1}}\), the mixture density is \(1.44\ \mathrm{g\,L^{-1}}\), and a \(1.50\ \mathrm L\) sample has a mass of \(2.16\ \mathrm g\).

The important difference from the earlier questions is that this vessel contains two gases.

You cannot simply use the molar mass of methane or argon. You need the average molar mass of the mixture.

Step 1: Calculate the average molar mass.

For a gas mixture, use the mole fractions:

\[ \overline M=\sum x_iM_i \]

Here, \(x_i\) represents the mole fraction of each gas.

Therefore:

\[ \begin{aligned} \overline M &=(0.250)(16.04)\\ &\quad +(0.750)(39.95)\\ &=4.01+29.9625\\ &=33.97\ \mathrm{g\,mol^{-1}} \end{aligned} \]

Step 2: Calculate the mixture density.

Use the average molar mass in the density equation:

\[ \rho=\frac{P\overline M}{RT} \]

Substitute:

\[ \begin{aligned} \rho &=\frac{(105.0)(33.97)} {(8.314)(298.0)}\\ &=1.44\ \mathrm{g\,L^{-1}} \end{aligned} \]

Step 3: Calculate the mass of the \(1.50\ \mathrm L\) sample.

Use:

\[ m=\rho V \]

Therefore:

\[ \begin{aligned} m&=(1.44)(1.50)\\ &=2.16\ \mathrm g \end{aligned} \]

The sample has a mass of approximately \(2.16\ \mathrm g\).

Notice that the average molar mass is weighted by mole fraction, not mass fraction. The mixture contains more argon by mole, so argon makes the larger contribution to the average molar mass.

Question 4

An unknown dry gas is collected in a calibrated vessel.

The following illustrative measurements are recorded:

MeasurementValue
Mass of gas0.887 g
Gas volume0.500 L
Absolute pressure100.0 kPa
Temperature25.0°C

Assume ideal behaviour.

(a) Calculate the experimental density of the gas.

(b) Use the ideal gas equation to estimate its molar mass.

(c) The gas is known to be either carbon dioxide or nitrous oxide. Can the density measurement distinguish between these two possibilities? Explain your reasoning.

Solution 4

The experimental density is \(1.774\ \mathrm{g\,L^{-1}}\), and the estimated molar mass is approximately \(44.0\ \mathrm{g\,mol^{-1}}\).

The density measurement cannot distinguish between carbon dioxide and nitrous oxide.

Step 1: Calculate the experimental density.

Use:

\[ \rho=\frac{m}{V} \]

Substitute:

\[ \begin{aligned} \rho &=\frac{0.887}{0.500}\\ &=1.774\ \mathrm{g\,L^{-1}} \end{aligned} \]

Step 2: Convert the temperature.

\[ T=25.0+273.15=298.15\ \mathrm K \]

Step 3: Rearrange the ideal-gas density equation to find molar mass.

Starting with:

\[ \rho=\frac{PM}{RT} \]

Rearrange:

\[ \boxed{M=\frac{\rho RT}{P}} \]

Step 4: Substitute the values.

\[ \begin{aligned} M &=\frac{(1.774)(8.314)(298.15)} {100.0}\\ &=43.97\ \mathrm{g\,mol^{-1}}\\ &\approx44.0\ \mathrm{g\,mol^{-1}} \end{aligned} \]

Step 5: Evaluate the possible identities.

The molar masses of the two gases are approximately:

\[ M_{\mathrm{CO_2}}=44.01\ \mathrm{g\,mol^{-1}} \]

\[ M_{\mathrm{N_2O}}=44.01\ \mathrm{g\,mol^{-1}} \]

They have effectively identical molar masses at the precision used here.

Under the same pressure and temperature, the ideal-gas equation therefore predicts effectively identical densities.

This means density alone cannot distinguish between these gases.

You would need additional chemical evidence, such as a suitable reaction or another identifying property.

This is an important limitation of using physical measurements to identify unknown substances: two different substances can share the same measured property.

Question 5

Two identical rigid vessels, A and B, each have a volume of \(2.00\ \mathrm L\).

Initially, both contain identical, well-mixed ideal gas mixtures of helium and carbon dioxide.

The initial conditions in both vessels are:

  • Absolute pressure: \(100.0\ \mathrm{kPa}\).
  • Temperature: \(300\ \mathrm K\).
  • Total gas mass: \(1.60\ \mathrm g\).

Assume:

  • The gases do not react.
  • No gas condenses.
  • The mixture behaves ideally.
  • The molar masses of helium and carbon dioxide are \(4.00\ \mathrm{g\,mol^{-1}}\) and \(44.01\ \mathrm{g\,mol^{-1}}\), respectively.

The vessels are then heated to \(450\ \mathrm K\).

However, their conditions are different:

  • Vessel A is completely sealed. No gas can enter or leave.
  • Vessel B is connected to a pressure regulator that releases gas to maintain a constant pressure of \(100.0\ \mathrm{kPa}\). The gas is well mixed, so the escaping gas has the same composition as the gas remaining inside.

Calculate:

(a) The initial average molar mass of the gas mixture.

(b) The initial mole fraction of carbon dioxide.

(c) The final pressure and density in vessel A.

(d) The final mass and density in vessel B.

(e) Explain why the densities in the two vessels behave differently, even though both vessels started with identical gas mixtures and were heated to the same final temperature.

Solution 5

The initial average molar mass is approximately \(19.95\ \mathrm{g\,mol^{-1}}\), and the mixture contains approximately \(39.9\%\) carbon dioxide by mole.

After heating, vessel A has a density of \(0.800\ \mathrm{g\,L^{-1}}\), while vessel B has a density of \(0.533\ \mathrm{g\,L^{-1}}\).

The crucial difference is that vessel A retains all its gas, whereas vessel B loses some of its gas during heating.

Step 1: Calculate the initial number of moles.

Use the ideal gas equation:

\[ PV=nRT \]

Rearrange:

\[ n=\frac{PV}{RT} \]

Substitute the initial conditions:

\[ \begin{aligned} n_1 &=\frac{(100.0)(2.00)} {(8.314)(300)}\\ &=0.0802\ \mathrm{mol} \end{aligned} \]

Step 2: Calculate the average molar mass.

The average molar mass is the total mass divided by the total amount:

\[ \overline M=\frac{m}{n} \]

Substitute:

\[ \begin{aligned} \overline M &=\frac{1.60}{0.0802}\\ &=19.95\ \mathrm{g\,mol^{-1}} \end{aligned} \]

Step 3: Determine the mole fraction of carbon dioxide.

Let \(x\) represent the mole fraction of carbon dioxide.

The mole fraction of helium is therefore \(1-x\).

Use the weighted average molar mass:

\[ \overline M=xM_{\mathrm{CO_2}} +(1-x)M_{\mathrm{He}} \]

Substitute:

\[ 19.95=44.01x+4.00(1-x) \]

Expand and simplify:

\[ \begin{aligned} 19.95&=44.01x+4.00-4.00x\\ 15.95&=40.01x\\ x&=\frac{15.95}{40.01}\\ x&=0.399 \end{aligned} \]

Therefore, the initial mixture contains approximately:

  • \(39.9\%\) carbon dioxide by mole.
  • \(60.1\%\) helium by mole.

Step 4: Calculate the final pressure in vessel A.

Vessel A is sealed and rigid.

This means:

  • The volume remains constant.
  • The number of moles remains constant.
  • Only the temperature and pressure change.

For a fixed amount of ideal gas at constant volume:

\[ \frac{P_1}{T_1}=\frac{P_2}{T_2} \]

Rearrange:

\[ P_2=P_1\frac{T_2}{T_1} \]

Substitute:

\[ \begin{aligned} P_2 &=100.0\times\frac{450}{300}\\ &=150.0\ \mathrm{kPa} \end{aligned} \]

The final pressure in vessel A is \(150.0\ \mathrm{kPa}\).

Step 5: Calculate the final density in vessel A.

This is where an easy mistake can occur.

The temperature and pressure have increased, but the vessel is rigid and sealed. No gas has escaped.

Therefore, its mass and volume are unchanged.

Use:

\[ \rho=\frac{m}{V} \]

\[ \begin{aligned} \rho_A &=\frac{1.60}{2.00}\\ &=0.800\ \mathrm{g\,L^{-1}} \end{aligned} \]

The density has not changed.

This agrees with the ideal-gas density equation because the ratio \(P/T\) remains constant when the amount and volume of gas are fixed.

Step 6: Calculate the final number of moles in vessel B.

Vessel B maintains a constant pressure of \(100.0\ \mathrm{kPa}\), and its volume remains \(2.00\ \mathrm L\).

However, its temperature increases to \(450\ \mathrm K\).

Use:

\[ n_2=\frac{PV}{RT_2} \]

Substitute:

\[ \begin{aligned} n_2 &=\frac{(100.0)(2.00)} {(8.314)(450)}\\ &=0.0535\ \mathrm{mol} \end{aligned} \]

Compare this with the initial amount:

\[ \frac{n_2}{n_1} = \frac{0.0535}{0.0802} \approx0.667 \]

Only two-thirds of the original amount of gas remains.

The missing gas has escaped through the regulator.

Step 7: Calculate the final mass in vessel B.

Because the escaping gas has the same composition as the remaining mixture, the average molar mass stays constant.

Therefore:

\[ m_2=n_2\overline M \]

Substitute:

\[ \begin{aligned} m_2 &=(0.0535)(19.95)\\ &=1.067\ \mathrm g \end{aligned} \]

Step 8: Calculate the final density in vessel B.

Use:

\[ \rho_B=\frac{m_2}{V} \]

Therefore:

\[ \begin{aligned} \rho_B &=\frac{1.067}{2.00}\\ &=0.533\ \mathrm{g\,L^{-1}} \end{aligned} \]

The final density in vessel B is approximately \(0.533\ \mathrm{g\,L^{-1}}\).

Step 9: Explain the difference between the two vessels.

Both vessels started with the same gas mixture, and both reached the same final temperature.

However, they did not undergo the same process.

In vessel A, the gas was heated without allowing any particles to escape. Its mass and volume stayed constant, so its density remained unchanged. The pressure increased instead.

In vessel B, the pressure was held constant while the temperature increased. To achieve this in a rigid vessel, some gas had to escape. The amount of gas and its total mass decreased, so its density also decreased.

The tempting mistake is to assume that heating must always increase gas density because the pressure rises, or that a rigid container must always maintain constant density.

Neither statement is generally correct.

You must consider what is held constant and whether gas can enter or leave the system.


07Where to go next

Once you can calculate gas density, you can also rearrange the same equation to estimate the molar mass of an unknown gas:

\[ M=\frac{\rho RT}{P} \]

This is particularly useful in experimental chemistry, where a measured density can help narrow down the identity of an unknown substance.

The next step is to understand when that estimate is reliable: whether the sample is pure, whether its pressure has been corrected properly, and whether the ideal-gas approximation is appropriate for the conditions.