How to use the ideal gas law

academics chemistry ideal gas law

While you might not think about it very often, gases are everywhere around us, from the air you breathe to the natural gas you might use to heat your home. To use gases safely and effectively, chemists use the ideal gas law to understand how much gas is in containers and pipes.

The ideal gas law is an equation that relates the pressure (P), volume (V), temperature (T), and amount of gas present (n) in a container. In its complete form, it looks like:

Screen Shot 2023-04-10 at 4.20.32 PMThe R in the ideal gas law is an important constant called the ideal gas constant, which can be given in a variety of units depending on the problem. Usually, you’ll see R given as:

Screen Shot 2023-04-10 at 4.20.36 PM

The trickiest thing about using the ideal gas law is units—you always want to make sure that the units of your pressure, volume, and temperature match the units of the gas constant you are given, otherwise your calculation will be incorrect.

At first, the ideal gas law might seem overwhelming because it contains many variables, but it can usually be simplified by eliminating variables that aren’t changing in the problem you’re trying to solve. This often happens when two variables are changing but the others are not. Let’s look at two examples of the ideal gas law in action.

Example 1: Amount of oxygen in a cylinder

A gas cylinder containing O2 is used to help a hospital patient breathe. The cylinder contains 5.0 L of O2 at 7.0 atm. The cylinder is kept in a room at 28 °C. How many moles of gas are in the cylinder?

This problem is an example of how units are key to calculations with the ideal gas law. The temperature unit given in the problem statement (28 °C) does not match the unit in the value given for R (K). So, our first step should be to convert 28 °C to temperature in Kelvin:

Screen Shot 2023-04-10 at 4.22.44 PM

Now that we have the temperature in the correct units, we can use the ideal gas law. We want to know how many moles of gas (n) are present in the cylinder, so first we rearrange the equation for the ideal gas law to solve for n:

Screen Shot 2023-04-10 at 4.22.47 PM

With this rearranged equation and our converted temperature, we can plug in the values from the problem statement:

Screen Shot 2023-04-10 at 4.22.51 PM

Example 2: Compressing a gas with a piston

A container containing 5.00 L of N2 gas at an initial pressure of 0.500 atm is compressed using a piston to a final pressure of 2.00 atm. The temperature of the container is held constant. What is the final volume of the gas?

This problem is a good opportunity to eliminate variables that aren’t changing to simplify our calculation. Notice that the problem statement tells us that the temperature is held constant throughout the compression process. This means that we can ignore the T variable in the ideal gas law. The problem statement also implies that the amount of gas (n) does not change, since the gas is contained in a cylinder and does not escape, so we can eliminate n. Finally, since we have eliminated these variables, we can also eliminate R. Overall, this gives us the following equation:

Screen Shot 2023-04-10 at 4.25.01 PM

First, we want to rearrange this equation to solve for the final volume (V2):

Screen Shot 2023-04-10 at 4.25.03 PM

Then plug in the values from the problem statement:

Screen Shot 2023-04-10 at 4.25.07 PM

If you’re thinking—"whoa, where did the P1V1 and P2V2 come from?”—don’t worry, we’re still using the ideal gas law. In this problem, we are given an initial and final pressure and we are asked to find the final volume. We know that the number of moles and the temperature don’t change, so we know that the nRT on the right side of the ideal gas law remains constant. Knowing this, we could perform the following calculation using the initial pressure and volume:

Screen Shot 2023-04-10 at 4.25.14 PM

At this point, we know that because nRT stays constant, we could also write the following expression for the final pressure and volume:

Screen Shot 2023-04-10 at 4.25.18 PM

We can then set the two sides of the expressions equal to obtain:

Screen Shot 2023-04-10 at 4.25.24 PM

This expression is equivalent to the calculation we used above to obtain the result V2 = 1.25 L.

Malia holds a PhD in Chemistry from Harvard University. Previously, she earned her BS in Chemistry at Haverford College (Phi Beta Kappa, summa cum laude, High Honors in Chemistry). She is a postdoctoral fellow at the National Institute of Standards and Technology.


academics study skills MCAT medical school admissions SAT college admissions expository writing English strategy MD/PhD admissions writing LSAT GMAT physics GRE chemistry biology math graduate admissions academic advice law school admissions ACT interview prep test anxiety language learning career advice premed MBA admissions personal statements homework help AP exams creative writing MD test prep study schedules computer science Common Application mathematics summer activities history philosophy secondary applications organic chemistry economics supplements research grammar 1L PSAT admissions coaching law psychology statistics & probability dental admissions legal studies ESL CARS PhD admissions SSAT covid-19 logic games reading comprehension calculus engineering USMLE mentorship Spanish parents Latin biochemistry case coaching verbal reasoning AMCAS DAT English literature STEM admissions advice excel medical school political science skills French Linguistics MBA coursework Tutoring Approaches academic integrity astrophysics chinese gap year genetics letters of recommendation mechanical engineering Anki DO Social Advocacy algebra art history artificial intelligence business careers cell biology classics data science dental school diversity statement geometry kinematics linear algebra mental health presentations quantitative reasoning study abroad tech industry technical interviews time management work and activities 2L DMD IB exams ISEE MD/PhD programs Sentence Correction adjusting to college algorithms amino acids analysis essay athletics business skills cold emails finance first generation student functions graphing information sessions international students internships logic networking poetry proofs resume revising science social sciences software engineering trigonometry units writer's block 3L AAMC Academic Interest EMT FlexMed Fourier Series Greek Health Professional Shortage Area Italian JD/MBA admissions Lagrange multipliers London MD vs PhD MMI Montessori National Health Service Corps Pythagorean Theorem Python Shakespeare Step 2 TMDSAS Taylor Series Truss Analysis Zoom acids and bases active learning architecture argumentative writing art art and design schools art portfolios bacteriology bibliographies biomedicine brain teaser campus visits cantonese capacitors capital markets central limit theorem centrifugal force chemical engineering chess chromatography class participation climate change clinical experience community service constitutional law consulting cover letters curriculum dementia demonstrated interest dimensional analysis distance learning econometrics electric engineering electricity and magnetism escape velocity evolution executive function fellowships freewriting genomics harmonics health policy history of medicine history of science hybrid vehicles hydrophobic effect ideal gas law immunology induction infinite institutional actions integrated reasoning intermolecular forces intern investing investment banking lab reports letter of continued interest linear maps mandarin chinese matrices mba medical physics meiosis microeconomics mitosis mnemonics music music theory nervous system