Thermodynamics: Gases, the First Law and Heat Engines
Learn the ideal gas law, the first law of thermodynamics, PV graphs and heat engines for AP Physics 2, with worked examples and practice questions.
Reviewed by Independent AI model review on 2026-11-16
Watch the worked example
Thermodynamics is the study of heat, work and energy in systems made of very many particles, such as a gas in a cylinder. It explains why a gas heats up when it is squashed, how an engine turns heat into motion and why no engine can be perfectly efficient.
Key ideas
- An ideal gas is a model in which the particles are tiny, move randomly and only interact when they collide. Real gases behave this way at low pressure and at temperatures well above their boiling point.
- The pressure, volume and temperature of an ideal gas are linked by the ideal gas law. Temperature must be in kelvin: T(K) = T(°C) + 273.
- The average kinetic energy of the gas particles is proportional to the kelvin temperature. A higher temperature means faster particles on average.
- The internal energy of an ideal gas is the total kinetic energy of its particles, so, for a given amount of gas, it depends only on the temperature. If ΔU is positive the temperature rises, and if the temperature is unchanged then ΔU = 0.
- The first law of thermodynamics is conservation of energy: the internal energy changes when heat flows in or out, or when work is done on or by the gas.
- On a PV graph, the work done by a gas as it expands is the area under the curve.
- A heat engine takes heat from a hot reservoir, converts some of it to work and rejects the rest to a cold reservoir. Its efficiency is the work out divided by the heat in.
- The second law of thermodynamics: heat flows spontaneously from hot to cold, not the other way, and no heat engine can be 100% efficient. The entropy (disorder) of an isolated system never decreases.
- Heat can also move by conduction through a material. The rate depends on the material (its thermal conductivity k), the area, the temperature difference and the thickness.
Key equations
| Quantity | Equation |
|---|---|
| Ideal gas law | PV = nRT = N k_B T |
| Average kinetic energy | K_avg = (3/2) k_B T |
| Work done on a gas | W = −P ΔV |
| First law | ΔU = Q + W |
| Heat engine efficiency | e = |W| ÷ Q_H |
| Rate of conduction | Q ÷ Δt = k A ΔT ÷ L |
Here n is the number of moles, N is the number of particles, R = 8.31 J/(mol·K) and k_B = 1.38 × 10⁻²³ J/K. Q is the heat added to the gas and W is the work done on the gas, so W is negative when the gas expands. Use the equation sheet provided with the exam and check the current College Board course description for what is provided.
PV graphs and work
When a gas expands against a constant pressure, it pushes on its surroundings and does work on them. The work done by the gas is PΔV, which is the area under the line on a PV graph. If the gas is compressed, work is done on the gas, and the area under the curve is the (positive) work done on it. For a curve that is not a straight line, the work is still the area under the curve.
Special processes
- Isothermal (constant temperature): ΔU = 0, so Q = −W. Any work done by the gas is replaced by heat flowing in.
- Adiabatic (no heat flow): Q = 0, so ΔU = W. A gas that expands adiabatically does work at the expense of its internal energy, so it cools.
- Constant volume: ΔV = 0, so W = 0 and ΔU = Q.
Heat engines
A heat engine runs in a repeating cycle. In each cycle it takes in heat Q_H from a hot reservoir, does work W and rejects heat Q_C to a cold reservoir. Over a whole cycle the gas returns to its starting state, so ΔU = 0 and the energy is conserved: Q_H = W + Q_C. Here W is the work done by the engine in one cycle, written as a positive number. In the first-law convention this is the size of the work done on the gas, which is negative. The second law means Q_C can never be zero.
Worked example 1: the ideal gas law
A container of volume 0.0125 m³ holds 0.50 mol of an ideal gas at 300 K. What is the pressure of the gas?
PV = nRT, so P = nRT ÷ V = (0.50 × 8.31 × 300) ÷ 0.0125 = 1246.5 ÷ 0.0125 ≈ 99 700 Pa.
To two significant figures, P = 1.0 × 10⁵ Pa, about one atmosphere.
Worked example 2: heating at constant volume
A sealed rigid container of gas is at 20 °C and a pressure of 1.0 × 10⁵ Pa. It is heated to 80 °C. What is the new pressure?
Convert to kelvin: T₁ = 20 + 273 = 293 K and T₂ = 80 + 273 = 353 K. The volume and amount of gas are fixed, so P₁ ÷ T₁ = P₂ ÷ T₂. P₂ = P₁ × T₂ ÷ T₁ = 1.0 × 10⁵ × 353 ÷ 293 = 1.205 × 10⁵ Pa, which is 1.2 × 10⁵ Pa.
Using the Celsius temperatures directly would give 4 × 10⁵ Pa, which is wrong.
Worked example 3: kinetic energy of molecules
Find the average kinetic energy of the molecules of an ideal gas at 300 K. What is it at 600 K?
K_avg = (3/2) k_B T = 1.5 × 1.38 × 10⁻²³ × 300 = 6.2 × 10⁻²¹ J. At 600 K the kelvin temperature is doubled, so the average kinetic energy is doubled: 1.5 × 1.38 × 10⁻²³ × 600 = 1.2 × 10⁻²⁰ J.
Worked example 4: the first law
A gas in a cylinder is heated at a constant pressure of 2.0 × 10⁵ Pa. It absorbs 500 J of heat and expands from 2.0 × 10⁻³ m³ to 3.0 × 10⁻³ m³. Find the change in its internal energy.
The expansion is ΔV = 3.0 × 10⁻³ − 2.0 × 10⁻³ = 1.0 × 10⁻³ m³. The work done on the gas is W = −PΔV = −(2.0 × 10⁵)(1.0 × 10⁻³) = −200 J. It is negative because the gas does work on its surroundings. ΔU = Q + W = 500 + (−200) = +300 J.
The gas gains 300 J of internal energy, so its temperature rises.
Worked example 5: a heat engine
In one cycle a heat engine absorbs 800 J from a hot reservoir and rejects 500 J to a cold reservoir. Find the work done and the efficiency.
Over a cycle ΔU = 0, so W = Q_H − Q_C = 800 − 500 = 300 J. e = W ÷ Q_H = 300 ÷ 800 = 0.375, so the efficiency is 37.5%.
The other 62.5% of the heat input is rejected to the cold reservoir.
More worked problems
These three exam-style problems are worked out step by step in the video "Thermodynamics: Practice Problems Solved" at the top of this page. Each solution is written out below, after the three problems. Use R = 8.31 J/(mol·K), k_B = 1.38 × 10⁻²³ J/K and T(K) = T(°C) + 273. You can try new problems in "Try it yourself" afterward.
Problem 1: compressing and heating a gas. A cylinder with a movable piston holds 0.20 mol of an ideal gas at 27 °C, with a volume of 5.0 L. Find (a) the pressure of the gas. The gas is then compressed slowly to 1.0 L, with the temperature kept constant. Find (b) the new pressure. Then the gas is heated at constant volume to 87 °C. Find (c) the final pressure and (d) the average kinetic energy of the molecules at that temperature.
Problem 2: a rectangular cycle. A gas follows the cycle A → B → C → D → A on the PV diagram. A → B is at a constant pressure of 4.0 × 10⁵ Pa and B → C is at constant volume. C → D is at a constant pressure of 1.0 × 10⁵ Pa and D → A is at constant volume. The volume is 1.0 × 10⁻³ m³ at A and D and 3.0 × 10⁻³ m³ at B and C. In step A → B the gas absorbs 2000 J of heat, and in step D → A it absorbs 450 J. Heat flows out of the gas in the other two steps. Find (a) the work done by the gas in each step and the net work done in one cycle, (b) the change in internal energy in step A → B, (c) the heat rejected in one cycle, and (d) the efficiency of the engine.
Problem 3: heat through a window. A glass window pane has an area of 1.2 m² and a thickness of 4.0 mm. The thermal conductivity of the glass is k = 0.80 W/(m·K). The inside surface is at 20 °C and the outside surface is at −5 °C. Find (a) the rate of heat flow through the pane and the energy lost in 2.0 hours. Then find (b) the rate if the pane is twice as thick, and (c) the thickness needed to cut the rate to 1500 W.
Solutions to the worked problems
Problem 1.
(a) T = 27 + 273 = 300 K and V = 5.0 L = 5.0 × 10⁻³ m³. From PV = nRT, P = nRT ÷ V = (0.20)(8.31)(300) ÷ (5.0 × 10⁻³) = 9.97 × 10⁴ Pa, which is 1.0 × 10⁵ Pa.
(b) The temperature is constant, so PV is constant: P₁V₁ = P₂V₂. The volume falls to one fifth, so the pressure rises to five times as much: P₂ = (5.0)(9.97 × 10⁴) = 4.99 × 10⁵ Pa, which is 5.0 × 10⁵ Pa.
(c) The volume is now constant, so P ÷ T is constant. T₃ = 87 + 273 = 360 K. P₃ = P₂ × T₃ ÷ T₂ = (4.99 × 10⁵)(360 ÷ 300) = 5.98 × 10⁵ Pa, which is 6.0 × 10⁵ Pa.
(d) K_avg = (3/2)k_BT = 1.5 × (1.38 × 10⁻²³) × 360 = 7.5 × 10⁻²¹ J.
Problem 2.
(a) The work done by the gas is the area under each step. A → B: W = PΔV = (4.0 × 10⁵)(3.0 × 10⁻³ − 1.0 × 10⁻³) = +800 J. B → C and D → A: the volume is constant, so the work is 0. C → D: the gas is compressed, ΔV = −2.0 × 10⁻³ m³, so the work done by the gas is (1.0 × 10⁵)(−2.0 × 10⁻³) = −200 J. The net work is 800 − 200 = 600 J, which is the area inside the loop: (3.0 × 10⁵)(2.0 × 10⁻³) = 600 J.
(b) In step A → B the first law gives ΔU = Q + W, where W is the work done on the gas, −800 J. So ΔU = 2000 + (−800) = +1200 J.
(c) The heat absorbed in a cycle is Q_H = 2000 + 450 = 2450 J. Over a cycle ΔU = 0, so Q_H = W + Q_C and Q_C = 2450 − 600 = 1850 J.
(d) e = W ÷ Q_H = 600 ÷ 2450 = 0.245, so the efficiency is 24.5%.
Problem 3.
(a) The rate is Q ÷ Δt = kAΔT ÷ L, with ΔT = 20 − (−5) = 25 K and L = 4.0 mm = 4.0 × 10⁻³ m. Q ÷ Δt = (0.80)(1.2)(25) ÷ (4.0 × 10⁻³) = 6000 W. In 2.0 h = 7200 s the energy lost is E = (6000)(7200) = 4.32 × 10⁷ J, which is 4.3 × 10⁷ J.
(b) The rate is inversely proportional to the thickness, so doubling L halves the rate: 3000 W.
(c) 1500 W is a quarter of 6000 W, so L must be four times larger: 4 × 4.0 mm = 16 mm.
Try it yourself
These problems are not worked out in the videos. Use R = 8.31 J/(mol·K), Avogadro's number 6.02 × 10²³ per mole and T(K) = T(°C) + 273.
Problem A. A gas is compressed at a constant pressure of 1.5 × 10⁵ Pa from 5.0 × 10⁻³ m³ to 2.0 × 10⁻³ m³. During the compression, 1100 J of heat flows out of the gas. Find (a) the work done on the gas, (b) the change in its internal energy, and (c) whether its temperature rises or falls.
Problem B. A car tire holds a gas at a pressure of 2.4 × 10⁵ Pa (absolute) at 15 °C, with a volume of 3.0 × 10⁻² m³. Find (a) the number of moles of gas, (b) the pressure after the tire warms to 40 °C, if the volume does not change, and (c) the number of molecules in the tire.
Problem C. A gas expands from state A, at a volume of 1.0 × 10⁻³ m³ and a pressure of 5.0 × 10⁵ Pa, to state B, at 4.0 × 10⁻³ m³ and 2.0 × 10⁵ Pa, along a straight line on the PV diagram. During the expansion it absorbs 1500 J of heat. Find (a) the work done by the gas, (b) the change in its internal energy, and (c) the ratio of the kelvin temperature at B to the kelvin temperature at A.
Check your answers. A: (a) +450 J; (b) −650 J; (c) falls. B: (a) 3.0 mol; (b) 2.6 × 10⁵ Pa; (c) 1.8 × 10²⁴ molecules. C: (a) 1.05 × 10³ J; (b) +450 J; (c) 1.6.
Common mistakes
- Using Celsius in the gas law. Always convert to kelvin: add 273.
- Getting the sign of W wrong. In ΔU = Q + W, W is the work done on the gas. An expanding gas has a negative W.
- Mixing up the heat sign. Q is positive when heat flows into the gas and negative when it flows out.
- Forgetting that ΔU = 0 over a full cycle. An engine returns to its starting state, so Q_H − Q_C = W.
- Expecting 100% efficiency. The second law means some heat is always rejected to the cold reservoir.
Quick summary
- PV = nRT, with T in kelvin. Average kinetic energy is (3/2)k_B T.
- Work done by an expanding gas is the area under the PV graph, and W = −PΔV is the work done on the gas.
- First law: ΔU = Q + W.
- A heat engine has efficiency e = W ÷ Q_H, and Q_H = W + Q_C over a cycle.
- Heat flows from hot to cold, and no engine is 100% efficient.
Practice questions
Choose an answer to see whether you are right and why.
1. A sealed rigid container of gas is heated from 300 K to 600 K. What happens to the pressure of the gas?
2. A gas expands at a constant pressure of 1.0 × 10⁵ Pa from 1.0 × 10⁻³ m³ to 4.0 × 10⁻³ m³. How much work does the gas do?
3. An ideal gas is heated from 200 K to 800 K. By what factor does the average kinetic energy of its molecules increase?
4. A gas loses 100 J of heat to its surroundings while 250 J of work is done on it. What is the change in its internal energy?
5. A heat engine absorbs 600 J of heat from a hot reservoir and does 150 J of useful work in one cycle. What is its efficiency?
Make your own study set
Upload your class notes, a PDF or a revision video and CampusBadge builds notes, flashcards and quizzes for you to practise with.
This lesson is a study guide, not the syllabus. Check what is examined in the official AP Physics 2 syllabus for your exam year.