banner

Blog

Oct 19, 2023

What Is the Ideal Gas Law?

Rhett Allain

You should care about gases because you live in one—the air around you is a gas. Understanding how gases behave is also useful when dealing with things like air bags, rubber balloons, bicycle pumps, and even underwater sports like scuba diving. But let's be honest. You aren't here for party balloons or bicycle pumps. You are probably here because you are in an introductory chemistry course, and the ideal gas law is very confusing, and so you Googled it.

(Or, maybe you’re just here for science kicks. In which case, awesome.)

So what is the ideal gas law? The super short answer is that it's a relationship between the pressure, volume, temperature, and number of particles for a given gas. The equation looks like this:

These five terms are: the pressure (P), volume (V), number of moles (n), a constant (R)—with a value of 8.3145 joules per kelvin-mole—and temperature (T). You can't understand the ideal gas law without knowing what each of these terms describe.

There's another version of this equation that physicists sort of like:

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

There are two differences in this version. Instead of n for the number of moles, we have N for the total number of gas particles. Also, the constant R is replaced with k, the Boltzmann constant, with a value of 1.380649×10−23 joules per kelvin.

Let's explain each of these terms.

Imagine that the air around you is made of a bunch of tiny balls. These balls are so tiny that you can't see them, but they are moving in all directions. This is exactly what a gas is: It's made of many molecules that are traveling at different speeds and in different directions. In the case of the air you breathe, these molecules are mostly molecular nitrogen (two nitrogen atoms bound together), but there's also some molecular oxygen (two oxygen atoms). These molecules aren't actually tiny balls, but for this model, imagining a ball shape will be fine.

If you put this gas inside of a box, some of these balls would collide with its walls. Here is a diagram of one of these collisions:

Now we need a little bit of physics. Suppose you have a moving object, like a bowling ball. If there isn't a force that acts on the ball, it will just keep moving along at a constant speed and direction. So, if it does change direction—like when it collides with a wall—then there must be a force pushing on it. But since forces are always an interaction between two things, if the wall pushes on the ball, then the ball also has to push on the wall.

The same thing happens with very tiny objects, like the molecules of a gas. Each time one of these little gas-balls collides with the wall of the container, it exerts a tiny force on the wall.

We define pressure as the force per area. As an equation, it looks like this:

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

F is the force, and A is the area. The force from a single collision depends on both the speed of the molecule and its mass. Just think of it this way: You could throw a low-mass golf ball at a very high speed or you could roll a very massive bowling ball at a slow speed. It's possible that the fast golf ball could have the same impact as the slow bowling ball if its velocity makes up for its lower mass.

The total force on a wall of a container holding a gas will depend on the speed and mass of the molecules, but also on how many of them collide with the wall. For a given time interval, the number of collisions with the wall depends on two things: the speed of the molecules and the area of the wall. Faster-moving molecules will produce more collisions. So will a larger wall area. To determine the pressure on the wall, you divide this collision force by the area. So, in the end, the pressure of a gas just depends on the mass and speed of the molecules.

It's easy to understand the idea of pressure when the molecules of a gas are colliding with the wall of a container. However, it's important to remember that these molecules still move—and still have pressure—even when they aren't contained by anything. In physics, we let the pressure be an attribute of the gas, not of its collisions with the wall.

Everyone knows that 100-degree Fahrenheit air is hot and 0-degree Fahrenheit air is cold. But what does that actually mean for the tiny molecules of a gas? In short, the molecules in cold air move slower than the ones in hot air.

The temperature of an ideal gas is directly related to the average kinetic energy of these molecules. Remember that kinetic energy depends on both the mass and the speed of an object squared (K = 0.5mv2). So, as you increase the temperature of a gas, the molecules move around faster and the average kinetic energy increases.

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

How fast are these molecules of air moving? Air is a mixture of nitrogen and oxygen, and these two have different masses. So, at the same temperature, an average nitrogen molecule will have the same kinetic energy as an oxygen molecule, but they will move at different speeds. We can calculate this average speed with the following equation:

Since air has more nitrogen, I will just calculate the speed of that molecule with a mass of 4.65 x 10-26 kilograms. (Yes, molecules are super tiny.)

Although it's not that convenient for everyday discussions, the ideal gas law works best in temperature units of kelvins. The Kelvin scale is adjusted so that the absolute coldest thing possible will be 0 kelvins, meaning it has zero kinetic energy. This is also called absolute zero, and it is really super cold: -459.67 Fahrenheit or -273 Celsius. (That's even colder than the planet Hoth at -40 Celsius, which happens to be -40 Fahrenheit.)

Remember that temperature depends on the kinetic energy of molecules. You can't have negative kinetic energy, because mass isn't negative and the velocity is squared. So you shouldn't be able to have negative temperatures. The Kelvin scale fixes this problem by not using them. The lowest you can go is 0. A gas at absolute zero would have no kinetic energy, meaning its molecules aren't moving at all.

Now with the Boltzmann constant, the mass, and the temperature in Kelvin of nitrogen gas, I get an average molecule speed of 511 meters per second. If you like imperial units, that's 1,143 miles per hour. Yeah, those molecules are zooming around for sure. But remember, this isn't a 1,000-mph wind. First, that's just the average speed; some of the molecules are going slower and some are going faster. Second, they are all going in different directions. For wind, the molecules would mostly be moving in the same direction.

I think this one is pretty easy, but I'm going to explain it anyway. Let's say that I have a big cardboard box that is 1 meter on each side. I fill it with air and then close it up. That's a gas volume of 1 cubic meter (1 m x 1 m x 1 m = 1 m3).

How about a balloon filled with air? Honestly, that's a little more complicated, since balloons aren't regular shapes. But suppose it's a completely spherical balloon with a radius of 5 centimeters. Then the volume of the balloon will be:

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

That might seem like a large volume, but it's not. It's almost half of a liter, so that's half a bottle of soda.

These moles aren't the furry creatures that make holes in the ground. The name comes from molecules (which is apparently too long to write).

Here's an example to help you understand the idea of a mole. Suppose you run an electric current through water. A water molecule is made of one oxygen atom and two hydrogen atoms. (That's H2O.) This electric current breaks up the water molecule, and you get hydrogen gas (H2) and oxygen gas (O2).

This is actually a pretty simple experiment. Check it out here:

https://youtu.be/9j8gE4oZ9FQ

Since water has twice as many hydrogen atoms as oxygen, you get twice the number of hydrogen molecules. We can see this if we collect the gases from that water: We know the ratio of the molecules, but we don't know the number. That's why we use moles. It's basically just a way to count the uncountable.

Don't worry, there is indeed a way to find the number of particles in a mole—but you need Avogadro's number for that. If you have a liter of air at room temperature and normal pressure (we call that atmospheric pressure), then there will be about 0.04 moles. (That would be n in the ideal gas law.) Using Avogadro's number, we get 2.4 x 1022 particles. You can't count that high. No one can. But that's N, the number of particles, in the other version of the ideal gas law.

Just a quick note: You almost always need some kind of constant for an equation with variables representing different things. Just look at the left side of the ideal gas law, where we have pressure multiplied by volume. The units for this left side would be newton-meters, which is the same as a joule, the unit for energy.

On the right side, there is the number of moles and the temperature in Kelvin—those two clearly do not multiply to give units of joules. But you must have the same units on both sides of the equation, otherwise it would be like comparing apples and oranges. That's where the constant R comes to the rescue. It has units of joules/(mol × Kelvin) so that the mol × Kelvin cancels and you just get joules. Boom: Now both sides have the same units.

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

Now let's look at some examples of the ideal gas law using an ordinary rubber balloon.

What happens when you blow up a balloon? You are clearly adding air into the system. As you do this, the balloon gets bigger, so its volume increases.

What about the temperature and the pressure inside? Let's just assume they are constant.

I'm going to include arrows next to the variables that change. An up arrow means an increase and a down arrow means a decrease.

On the left side of the equation, we have an increase in volume, and on the right an increase in n (number of moles). That can work. Both sides of the equation are increasing, so they can still be equal to each other. If you like, you could say that adding air (increasing n) makes the volume increase and blows up the balloon.

But if the rubber part of the balloon stretches, does the pressure really remain constant? What about the temperature—is that also constant?

Let's check real quick. Here I'm using both a pressure and temperature sensor. (The temperature probe is inside the balloon.) Now I can record both of these values as the balloon is inflated. Here's what that looks like:

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

And here is the data:

If you look at the start of the graph, the pressure is at 102 kilopascals (kPa). The Pa is a pascal, which is the same as a newton per square meter, but it sounds cooler. So this is 102,000 N/m2, which is right around the normal atmospheric pressure.

When I start to blow up the balloon, there's a spike in the pressure up to 108 kPa, but then it drops down to 105 kPa. So yes, that's an increase in pressure—but it's not very significant.

The same is true for the temperature, which starts at 23.5°C and then rises to 24.2°C. Again, that's really not a big change. After the balloon is inflated, it decreases in temperature. Whenever you have two objects with different temperatures, the hotter thing will get cooler once it's in contact with a colder thing. (Just like putting hot muffins on the kitchen counter cools them because they contact the colder air). So it seems like assuming a constant pressure and temperature is fairly legit.

When you inflate a balloon, you push molecules of air from inside your lungs into the balloon. That means you increase the number of air molecules in the balloon—but these air particles are mostly at the same temperature as the ones that were already there. However, with more molecules in the balloon, you get more collisions between the air and the rubber material of the balloon. If the balloon was rigid, this would increase the pressure. But it's not rigid. The rubber in the balloon stretches and increases the volume so there is a greater area for these molecules to hit. So, you get an increased volume and a greater number of particles.

For the next demonstration, we can start with an inflated balloon that's sealed off. Since it's closed, air can't enter or leave—that makes n constant.

What happens if I decrease the temperature of the air? If you want, stick a balloon in the freezer for a few minutes. I'm not going to do that. Instead, I'm going to pour some liquid nitrogen on it, with a temperature of -196°C or 77 Kelvin. This is what it looks like:

Again, the pressure in the balloon stays mostly constant, but the temperature decreases. The only way for the ideal gas law equation to be valid is for the volume to also decrease.

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

The liquid nitrogen decreases the temperature of the gas. This means that the molecules are moving around at a slower speed, on average. Since they are moving slower, these molecules have fewer collisions with the rubber material of the balloon and these collisions have a smaller impact force. Both of these factors mean that the rubber won't be pushed out as much, so the rubber shrinks and the balloon gets smaller.

Of course when the balloon warms back up, the volume also increases. It returns to its starting size.

Let's again start with an inflated balloon that is sealed, so that the amount of air inside is constant (n stays the same). Now I'm going to squeeze the balloon and make it smaller.

Overall, the volume of the balloon does indeed decrease. So, what happens to the pressure and the temperature? Let's take a look at the data from the sensors.

WIRED Staff

Brenda Stolyar

Will Knight

Medea Giordano

The pressure goes from about 104 to 111 kilopascals, and the temperature increases from 296 K to 300 K. (I converted it to Kelvins for you.) Notice that the temperature doesn't actually change that much. In fact, I think it's OK to approximate this as a constant temperature during the "big squeeze." That means that there is an increase in pressure along with a decrease in volume. Using my equation with arrows, it looks like this:

The stuff on the right side of the equation is constant (temperature, number of moles, and the R constant).

That means the left side of the equation must also be constant. The only way for this to happen is for the pressure to increase by the same factor that the volume decreases. That's obviously what happens, even though I didn't measure the volume because it's a weirdly shaped balloon.

The size of the balloon decreases with the squeeze. This makes a smaller surface area for the molecules to collide into. The result is that there are more collisions. With more collisions, the pressure in the gas increases.

Ultimately, it doesn't matter if the example is about putting air into a balloon or a bike tire or even your lungs. (We often call this "breathing.") All of these situations can have a change in pressure, temperature, volume, and the amount of gas, and we can understand them by using the ideal gas law.

Maybe it wasn't so confusing after all.

Update 6-21-2022 at 3 pm: This story was updated to correct a reference to the equation for the Ideal Gas Law formula.

SHARE