Ideal Gas Law: PV = nRT
Problem
A gas is held in a rigid piston at 300 K with volume 25 L and 1 mole of gas. Show how the pressure changes when you vary temperature, volume, or amount of gas.
Explanation
Gas pressure seems mysterious until you see it for what it actually is: tiny particles crashing into the walls of their container, millions of times per second. Every collision gives the wall a little push. Add up all those pushes over the entire wall area, and you get a measurable force per unit area — which is exactly what "pressure" means.
Once you see gas pressure as billions of microscopic collisions, everything about the ideal gas law becomes intuitive. Want more pressure? Heat up the gas so the particles crash harder. Shrink the container so they crash more often. Add more particles so there are more crashes. That's literally what is saying, compressed into symbols.
The big picture: what's in that equation?
- is the pressure (force per unit area) the gas pushes on the container walls, measured in pascals (Pa) or atmospheres (atm).
- is the volume the gas occupies, measured in cubic meters (m³) or liters (L).
- is the amount of gas in moles — essentially "how many particles are there, counted in units of Avogadro's number ()."
- is the absolute temperature in kelvin (never Celsius!), which is proportional to the average kinetic energy of the particles.
- is the universal gas constant: . It's a conversion factor that makes the units work — pure bookkeeping.
The equation is a relationship between four properties that any gas at ordinary conditions obeys pretty accurately. If you know three of them, the equation tells you the fourth.
Why this one equation is so powerful
The ideal gas law actually contains three earlier historical laws as special cases, which you might have seen named individually. Let me show you:
Boyle's Law (1662): If you keep temperature and amount of gas fixed, then . Squeeze the gas into half the volume and the pressure doubles.
Charles's Law (1780s): If you keep pressure and amount of gas fixed, then . Heat the gas to twice the absolute temperature and it expands to twice the volume.
Gay-Lussac's Law (1809): If you keep volume and amount of gas fixed, then . Heat the gas to twice the temperature (in a sealed container) and the pressure doubles.
All three of these are just special slices of . Fix the right variables and the general law collapses into one of the named laws. That's why they're all equivalent once you have the full ideal gas law.
Solving the default problem: , ,
Let's find the pressure directly using the formula, then we'll check it three ways.
Method 1: Direct substitution into
Solve for :
Convert volume to SI units: .
Plug in:
That's about , or almost exactly 1 atmosphere (1 atm Pa). Which is comforting — a normal amount of air in a normal-sized container at room temperature should indeed be at roughly atmospheric pressure.
Method 2: Doubling the temperature (Gay-Lussac, isochoric)
Now suppose we hold volume constant at 25 L and heat the gas from 300 K to 600 K. What happens to pressure?
By Gay-Lussac's Law at constant and :
Pressure doubles — makes sense, because the particles' average kinetic energy doubles when the absolute temperature doubles, so they hit the walls harder (and faster) by a factor of two.
Switch the process mode widget to "Isochoric" and drag the temperature. You'll see the pressure track linearly with .
Method 3: Halving the volume (Boyle, isothermal)
Now hold temperature at 300 K and compress the gas from 25 L to 12.5 L. What happens to pressure?
By Boyle's Law at constant and :
Pressure also doubles — but for a different reason. The particles have the same speed (temperature is unchanged), but now they're packed into half the space, so they hit the walls twice as often. More collisions per second → double the pressure.
Switch the mode to "Isothermal" and drag the volume slider. Pressure scales inversely.
Method 4: Doubling the particle count (isobaric, variable )
Finally, what if we hold and fixed and double ? By rearranging:
At fixed and , volume scales linearly with . Doubling the amount of gas doubles the volume. (Imagine a balloon — blow in twice as many particles and the balloon inflates to twice the volume at the same atmospheric pressure.)
What does the particle animation show?
Turn on Show particles in the controls. Those colored dots bouncing around the container are each representing a molecule. Their speed is scaled to be proportional to — that's because the average kinetic energy of a gas molecule is:
where is Boltzmann's constant — basically divided by Avogadro's number to give you a "per-particle" gas constant.
Solving for speed:
For nitrogen (N₂, ) at room temperature, . That's faster than the speed of sound! (Sound speed in air is about 343 m/s, and it depends on how fast molecular collisions can propagate information, which is tied to .)
Increase the temperature slider and the particles visibly speed up. Decrease it and they slow down. The pressure gauge responds accordingly.
Turn on Color by speed to see each particle colored according to its speed — fast ones in yellow/orange, slow ones in cyan. Even at the same temperature there's a distribution of speeds, which is a preview of the Maxwell-Boltzmann distribution (problem 182 in this category).
Why is it called an "ideal" gas?
The ideal gas law assumes two things about the molecules:
- Molecules don't interact with each other except when they physically collide (no electrical attraction or repulsion between them).
- The molecules themselves take up no volume — they're treated as point particles.
Neither assumption is exactly true for a real gas. At ordinary temperatures and pressures, these approximations are good enough that the ideal gas law predicts behavior to within about 1%. But the ideal gas model breaks down in two limits:
- Very high pressures — the molecules are packed tight enough that the volume they themselves occupy becomes significant, and the "available" volume isn't really but where is a per-molecule excluded volume.
- Very low temperatures (near condensation) — the molecules are moving slowly enough that their intermolecular attractions start to matter, pulling them toward each other and reducing the effective pressure.
Real gases are described more accurately by the van der Waals equation:
where (attraction) and (excluded volume) are gas-specific constants. For most practical purposes — tires, weather balloons, scuba tanks, car engines at typical operating ranges — the simple ideal gas law is good enough.
Real-world connections
The ideal gas law is everywhere once you know to look for it:
- Car tires. When you check tire pressure on a cold winter morning, you'll find it's a few psi lower than in summer. That's Gay-Lussac: volume is fixed (rigid tire), so lower temperature means lower pressure. Tire pressure typically drops about 1 psi for every 10°F (5.6°C) drop in temperature.
- Hot air balloons. Heat the air inside a balloon and it expands to fill more volume at the same (atmospheric) pressure — Charles's Law. The heated air is less dense than surrounding cool air, so the balloon floats.
- Scuba diving. As a diver descends, the water pressure squeezes the air in their lungs to a smaller volume (Boyle's Law). That's why divers have to exhale continuously when ascending — if they hold their breath, the expanding air can rupture their lungs.
- Weather. A warm, moist air mass rises, cools adiabatically (see problem 178), and eventually the cooler air can't hold as much water vapor, so clouds form. The whole process obeys gas laws.
- Cooking. A pressure cooker raises the boiling point of water by increasing pressure — which makes steam, which has a larger volume than liquid water (vapor is roughly mol/ L at STP, while liquid water is mol/ L — a factor of ~1250).
Common mistakes to watch for
- Using Celsius for . The equation absolutely requires kelvin. Converting from 25°C to 298 K is essential. Plugging in 25 instead of 298 gives the wrong answer by more than a factor of ten.
- Mixing unit systems. If you use , then must be in pascals, in m³, and in kelvin. If you use instead, then should be in liters and in atmospheres. Don't mix.
- Forgetting to convert volume units. 25 L m³, not or . The factor of 1000 is very easy to lose.
- Confusing (moles) with (number of molecules). The equation as written uses moles. If you have molecules, convert: where .
- Applying the law outside its regime. Very high pressure (>10 atm), very low temperature (near the boiling point), or very dense gases — the ideal gas law starts to fail. Use van der Waals or a real-gas equation of state in those regimes.
Try it
- Set the mode to "Isothermal" and sweep the volume slider. Watch the pressure rise as you compress — this is Boyle's Law in action. The particle density visibly increases, and you can see more wall collisions per unit time.
- Set the mode to "Isobaric" (pressure fixed) and sweep temperature. Volume grows linearly with — that's Charles's Law. In this mode, the right wall of the container physically moves outward to maintain constant pressure.
- Set the mode to "Isochoric" (volume fixed) and sweep temperature. Pressure grows linearly with — Gay-Lussac. The particles visibly speed up and hit the walls harder.
- Turn on "Show derivation" to see the formula substituted with your current slider values, step-by-step.
- Turn on "Show STP reference" to overlay the standard-temperature-and-pressure benchmark (, ). For 1 mole, STP gives .
- Crank the temperature way up (toward 800 K). Notice how the particles become nearly invisible due to their high speed — that's why gas in a rocket engine combustor moves so fast.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.