📘 CodingMarble Learn

Perfect Gas Equation PV = nRT and Work in Compressing a Gas

A gas is made of countless tiny molecules flying about. Their hits on the walls make pressure. For a low-density gas, three simple laws hold: at fixed temperature, P × V stays constant (Boyle); at fixed pressure, V grows in step with kelvin temperature (Charles); at the same P and T, equal volumes hold equal numbers of molecules (Avogadro). Put together they give the perfect gas equation PV = nRT = N k T. One mole holds Avogadro's number, 6.022 × 10²³, of particles. Pushing a piston in does work on the gas; the work equals the area under the P–V graph, and at fixed temperature W = nRT ln(V₁/V₂).

🎬 Step-by-step story

  1. Gas molecules fly in all directions inside a cylinder. Every hit on the piston is a tiny push. Together these pushes are the pressure P.
  2. Keep the temperature fixed and push the piston in to half the volume. Molecules hit twice as often, so the pressure doubles. P × V stays the same (Boyle's law).
  3. Keep the pressure fixed and heat the gas. Molecules move faster and push the piston out. Volume grows with kelvin temperature (Charles's law).
  4. Add more gas at the same P and T: the volume grows in step. One mole is 6.022 × 10²³ molecules. All three laws join into PV = nRT.
  5. To squeeze the gas you push with a force through a distance, so you do work. The work is the area under the P–V curve.
  6. Your turn: change the amount, temperature and volume. Watch the pressure and the number of hits.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Where does gas pressure come from if the molecules are so tiny?

There are about 10²⁵ molecules in each cubic metre of air. Each hit is a tiny push, but billions of hits every second on each square centimetre add up to a steady pressure.

Why must temperature be in kelvin?

Gas volume and pressure grow in step with the kelvin temperature, which starts from absolute zero. Using °C would give zero or negative volume at 0 °C, which is wrong.

Is R different for different gases?

No. R = 8.314 J/(mol K) is the same for every ideal gas, because Avogadro's law says a mole of any gas behaves the same way.

Why does the pump get warm when I compress air?

You do work on the gas. If you push fast, this energy has no time to escape, so it raises the gas's internal energy and temperature.

Why is the work equal to the area under the P–V graph?

Each tiny squeeze gives work P × ΔV, which is a thin strip of height P and width ΔV on the graph. Adding all strips gives the area.

Does 1 mole of hydrogen and 1 mole of oxygen fill the same volume?

Yes, at the same P and T. Both have 6.022 × 10²³ molecules, and for an ideal gas the volume depends on the number of molecules, not their mass.

What is a gas, in simple words?

A gas is a huge crowd of very small particles called molecules. They fly in straight lines, hit each other and hit the walls. They are far apart, so a gas is mostly empty space.

We describe a gas with four numbers:

The three gas laws

Boyle's law (T fixed)

P ∝ 1/V, so PV = constant. Halve the volume, the pressure doubles. Reason: the same molecules hit a smaller wall area more often.

Charles's law (P fixed)

V ∝ T, so V/T = constant. T must be in kelvin. Hot molecules move faster and need more room to keep the same pressure.

Gay-Lussac's (pressure) law (V fixed)

P ∝ T. Heat a closed can and its pressure rises.

Avogadro's law

At the same P and T, equal volumes of all gases have the same number of molecules. So V ∝ n.

The perfect gas equation PV = nRT

Join the laws: V ∝ nT/P. Put in a constant R and you get

PV = nRT

R = 8.314 J mol⁻¹ K⁻¹ is the universal gas constant. It is the same for every gas.

Another form uses the number of molecules N = n NA: PV = N kB T, where kB = R/NA = 1.38 × 10⁻²³ J/K is the Boltzmann constant.

Using density ρ and molar mass M: n = m/M, so P = ρRT/M.

A gas that follows PV = nRT exactly at all P and T is a perfect (ideal) gas. Real gases come close at low pressure and high temperature, when molecules are far apart and fast.

Avogadro's number and the mole

One mole of anything has NA = 6.022 × 10²³ particles. This is Avogadro's number.

Work done in compressing a gas

When a piston of area A moves in by a small distance Δx against gas pressure P, the force is F = PA and the work done on the gas is F Δx = P A Δx = P ΔV. Add up all the small pieces:

W = ∫ P dV = area under the P–V graph.

At constant pressure

W = P (V₁ − V₂).

At constant temperature (isothermal)

Here P = nRT/V changes as V changes. Adding up gives

W on gas = nRT ln(V₁/V₂) = 2.303 nRT log₁₀(V₁/V₂)

Sign rule used in NCERT style: work done by the gas is positive when it expands; when you compress it, the gas does negative work and you do positive work on it.

Try it: the 3D and at home

Board exam focus

Key formulas and definitions

Worked examples

1. A gas occupies 6 L at 2 atm. At the same temperature it is squeezed to 3 L. Find the new pressure.

Step 1: T is fixed, so use Boyle: P₁V₁ = P₂V₂. Step 2: 2 × 6 = P₂ × 3. Step 3: P₂ = 12/3. Answer: P₂ = 4 atm.

2. A balloon holds 2.0 L of air at 27 °C. At the same pressure it is warmed to 177 °C. Find its new volume.

Step 1: change to kelvin: T₁ = 300 K, T₂ = 450 K. Step 2: Charles: V₂ = V₁ × T₂/T₁ = 2.0 × 450/300. Answer: V₂ = 3.0 L.

3. How many molecules are in 8 g of oxygen gas (O₂, M = 32 g/mol)?

Step 1: n = 8/32 = 0.25 mol. Step 2: N = n N_A = 0.25 × 6.022 × 10²³. Answer: N ≈ 1.51 × 10²³ molecules.

4. Find the pressure of 2 mol of an ideal gas in a 0.05 m³ vessel at 300 K. (R = 8.31 J/mol K)

Step 1: P = nRT/V. Step 2: P = 2 × 8.31 × 300 / 0.05 = 4986 / 0.05. Answer: P ≈ 9.97 × 10⁴ Pa (about 1 atm).

5. A tyre has air at 27 °C and 2.0 × 10⁵ Pa. After a drive the air is at 57 °C, volume unchanged. Find the new pressure.

Step 1: V fixed, so P/T is constant. Step 2: T₁ = 300 K, T₂ = 330 K. Step 3: P₂ = 2.0 × 10⁵ × 330/300. Answer: P₂ = 2.2 × 10⁵ Pa.

6. Find the density of nitrogen (M = 28 g/mol) at 1.0 × 10⁵ Pa and 280 K.

Step 1: ρ = PM/(RT). Step 2: M = 0.028 kg/mol. Step 3: ρ = 1.0 × 10⁵ × 0.028 / (8.31 × 280) = 2800 / 2326.8. Answer: ρ ≈ 1.20 kg/m³.

7. 1 mol of an ideal gas at 300 K is compressed slowly at constant temperature from 20 L to 10 L. Find the work done on the gas. (ln 2 = 0.693)

Step 1: isothermal, so W on gas = nRT ln(V₁/V₂). Step 2: = 1 × 8.314 × 300 × ln(20/10). Step 3: = 2494.2 × 0.693. Answer: W ≈ 1.73 × 10³ J done on the gas (the gas does −1.73 kJ).

8. A gas at a constant pressure of 1.0 × 10⁵ Pa is compressed from 3.0 L to 1.0 L. Find the work done on it.

Step 1: W = P (V₁ − V₂). Step 2: ΔV = 2.0 L = 2.0 × 10⁻³ m³. Step 3: W = 1.0 × 10⁵ × 2.0 × 10⁻³. Answer: W = 200 J on the gas.

Common mistakes

Practice quiz

1. In PV = nRT, the value of R is about:
2. At constant temperature, if the volume of a gas is halved, its pressure:
3. Avogadro's number is:
4. Work done in compressing a gas equals:
5. Real gases behave most like ideal gases at:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the ideal gas equation?

PV = nRT, where P is pressure, V volume, n moles, R = 8.314 J/(mol K) and T temperature in kelvin.

What is the value of Avogadro's number?

N_A = 6.022 × 10²³ particles per mole.

What is the formula for work done in isothermal compression?

W = nRT ln(V₁/V₂) = 2.303 nRT log₁₀(V₁/V₂), done on the gas when V₂ < V₁.

Where this is taught

Canada (Ontario)Grade 11F. Gases and Atmospheric Chemistry
PolandLiceum ogólnokształcące, klasa IIThermodynamics
RomaniaClasa a IX-aThe gaseous state
RomaniaClasa a IX-aThe gaseous state
RomaniaClasa a IX-aThe gaseous state
RomaniaClasa a IX-aThe gaseous state
Ukraine10 класMolecular physics and thermodynamics
CBSE (India)Class 11Behaviour of Perfect Gases and Kinetic Theory of Gases
USA (Common Core, NGSS, AP)Grade 11Properties of Substances and Mixtures
USA (Common Core, NGSS, AP)Grade 11Common course additions (beyond NGSS PEs)
USA (Common Core, NGSS, AP)Grade 12Thermodynamics
South Korea고등학교 2학년Three states of matter
South Korea고등학교 3학년States of matter and solutions
FranceTerminaleEnergy
Russia10 классMolecular physics
China高三Selective 3 Ch.2 Gases, solids, liquids

Learn first

Learn next

Related lessons

All Physics lessons