Work done by gases
Push a bicycle pump slowly and the piston fights back — the compressed air inside is doing negative work on your hand, while your hand does positive work on the gas. Let go of a stretched balloon's neck and the escaping gas expands, shoving air out of the way and doing positive work on its surroundings. In both cases the amount of work done is not just "force times distance" in the usual sense; it depends on how the pressure of the gas changes as its volume changes, and it feeds straight into the first law of thermodynamics as the term that links heat, internal energy, and mechanical output. This idea — work done by (or on) a gas as it expands or is compressed — is one of the most numerically testable ideas in Class 11 thermodynamics, because it can be read directly off a pressure-volume graph as the area under the curve. Get comfortable with three cases: constant pressure, constant temperature, and constant volume, and you can handle almost every numerical this unit throws at you, including multi-step and cyclic processes.
Work done by a gas equals , the area under its path on a – diagram, so the same expansion can do different amounts of work depending on the path taken, not just the start and end states.
The core idea
Work as area under the curve. When a gas pushes a piston outward by a tiny volume while at pressure , it does a small amount of work . Adding up (integrating) these tiny contributions as the gas goes from volume to gives the total work done by the gas:
where: is work done by the gas (joule, J), is pressure (pascal, Pa), and , are the initial and final volumes (m³). Geometrically, this integral is exactly the area trapped between the – curve and the volume axis, between and — so before calculating anything, sketching the process on a – diagram tells you roughly what answer to expect.
Isobaric (constant pressure). If does not change during the process, it can be pulled out of the integral:
where: is the change in volume. On the diagram this is just the area of a rectangle of height and width .
Isothermal (constant temperature, ideal gas). Using the ideal gas law at fixed , so , the integral becomes a standard logarithmic result:
where: is the number of moles, is the universal gas constant, and is the (constant) absolute temperature in kelvin. This curve on a – diagram is a hyperbola (), so the "rectangle" shortcut does not apply here — only the log formula does.
Isochoric (constant volume). If throughout, the gas does zero work, no matter how much its pressure or temperature changes: . There is simply no area under the curve because the curve is a vertical line.
Sign convention and the first law. Work done by the gas is positive when it expands () and negative when it is compressed () — work is then done on the gas. This is exactly the work term in the first law of thermodynamics, , so a sign slip here silently flips the sign of the heat or internal-energy change you calculate next.
Start from the general definition and combine it with the ideal gas law to obtain the closed-form logarithmic expression that lets you compute the work done in an isothermal expansion or compression directly from moles, temperature, and the volume ratio, without ever integrating a pressure that is changing point by point.
Step 1. For moles of an ideal gas, the equation of state is . At constant temperature , this can be rearranged to express pressure purely as a function of volume: , with , , and all fixed numbers during the process.
Step 2. Substitute this expression for into the work integral: . Since is constant, it can be pulled outside the integral sign, leaving .
Step 3. The remaining integral is a standard one: . Evaluating between the limits and gives , which by the laws of logarithms combines into a single term.
Step 4. Using , the work done by the gas during an isothermal process becomes . If (expansion), the logarithm is positive and ; if (compression), the logarithm is negative and , consistent with the sign convention.
Worked example
Two moles of an ideal gas at expand isothermally and reversibly from a volume of to . Take . Find the work done by the gas, and then find how much work the gas would do if it were instead compressed back from to at the same temperature.
Step 1. Identify the process as isothermal, so applies directly, with , , , . Litres cancel in the ratio , so no unit conversion is needed for the logarithm.
Step 2. Compute the volume ratio and its logarithm: , and .
Step 3. Substitute into the formula: .
Step 4. So the gas does approximately 5479 J (about 5.48 kJ) of work on its surroundings during this expansion. Because the process is isothermal for an ideal gas, , so by the first law all of this work is supplied as heat absorbed from the surroundings, .
Competitive stretch
For the reverse compression from back to at the same , the volume ratio inverts to , and . So : the gas now does negative work, meaning the surroundings do about 5479 J of work on the gas, and (again since ) the gas releases this same amount as heat to the surroundings. The magnitude matches the expansion exactly, confirming that isothermal work over the same volume ratio is symmetric in size but opposite in sign when the process is reversed.
Common traps
- Using when pressure is not constant — this shortcut only applies to isobaric processes; an isothermal (or any other varying-pressure) process needs the correct integral or the logarithmic formula instead.
- Forgetting that work depends on the path taken on a – diagram between two states, not just on the initial and final states — unlike internal energy, work is not a state property, so different paths between the same two points give different .
- Sign errors: work done by the gas is positive during expansion and negative during compression; getting this backwards flips the sign of or obtained from the first law, .
- Mixing up litres and cubic metres, or forgetting that , when a problem gives volumes in litres but expects an answer in joules using SI-unit pressure.
Ask the tutor: Want to try a multi-step cyclic process where you have to add up work over several isobaric and isothermal legs on one p-V diagram? Ask the AI tutor for a guided walkthrough.
Why is work not a state property like internal energy?
Internal energy depends only on the current state of the gas (its temperature, for an ideal gas), so is fixed once you know the start and end states. Work, however, equals the area under the specific path traced on the – diagram, and different paths between the same two states enclose different areas. That is exactly why the first law needs both and as path-dependent terms to balance the path-independent .
Why does an isothermal process need integration while an isobaric one does not?
In an isobaric process, pressure is a constant, so it can be pulled straight out of the integral , leaving just — no calculus needed beyond multiplication. In an isothermal process, pressure keeps changing as volume changes (following ), so you must actually integrate over the range, which produces the natural logarithm term .
If a gas is compressed, does that mean negative work always means heat is absorbed?
Not necessarily — it depends on the process. During isothermal compression, , so the first law with negative gives negative , meaning heat is released, not absorbed. Whether heat is absorbed or released during compression depends on how and combine for that specific process; only for isothermal ideal-gas processes can you assume automatically.