This page is a drill through every case the formulas
w rev = − n R T ln ( V 1 V 2 ) , w irrev = − P ext Δ V
can throw at you. We build from the parent note Work in Expansion and lean on Ideal Gas Law , Isothermal Process , PV Diagram and First Law of Thermodynamics .
Before any numbers, let us agree on the language of signs , because half of all mistakes here are sign mistakes.
Definition The IUPAC sign convention (read this first)
w is the work done on the system.
Gas expands (V 2 > V 1 ): the gas pushes outward, energy leaves it ⇒ w < 0 (negative).
Gas is compressed (V 2 < V 1 ): we push inward, energy enters it ⇒ w > 0 (positive).
No volume change (V 2 = V 1 ): w = 0 .
Every answer below must have a sign that agrees with this. That is our first sanity check, always.
P ext means (needed for every irreversible case)
P ext is the external pressure — the pressure the surroundings press inward on the moving boundary (piston) of the gas. It is what the expanding gas actually pushes against . In every irreversible example below it is constant (a fixed weight, a fixed atmosphere), which is exactly why it can be pulled outside the integral to give w = − P ext Δ V . It is generally not equal to the gas's own pressure P gas = n R T / V ; they coincide only in the reversible limit.
Definition Our unit policy (used in every answer)
To keep answers comparable, we compute in SI joules and then report in kJ when ∣ w ∣ ≥ 1000 J , otherwise in J. So Example 1's − 12102 J is quoted as − 12.1 kJ , while Example 3's − 608 J stays in J. The rule is purely presentational — nothing physical changes.
Every cell below is a class of problem. The worked examples that follow each name the cell(s) they cover, and together they hit all of them.
Cell
Case class
What is being tested
Covered by
A
Reversible isothermal expansion (V 2 > V 1 )
sign w < 0 , log formula
Ex 1
B
Reversible isothermal compression (V 2 < V 1 )
sign flips to w > 0
Ex 2
C
Irreversible constant P ext expansion
w = − P ext Δ V , rectangle area
Ex 3
D
Irreversible compression against high P ext
w > 0 , why it costs more
Ex 4
E
Multi-step irreversible (path-dependent)
piecewise integration
Ex 5
F
Degenerate : V 2 = V 1 (no change) and free expansion (P ext = 0 )
w = 0 two different ways
Ex 6
G
Limiting : many small steps → reversible
why $
w_{\text{irrev}}
H
Word / real-world problem (piston, atmosphere)
modelling + unit hygiene
Ex 8
I
Exam twist : mixed reversible-then-irreversible, or "find missing quantity"
back-solving a formula
Ex 9, Ex 10
(Reminder: P ext in the matrix is the constant external pressure just defined above.)
Every single example is an area on a PV diagram . Keep this picture in your head.
The lavender curve is the isotherm P gas = n R T / V . Area under it (from V 1 to V 2 ) is the reversible work magnitude.
The coral rectangle is area under a constant P ext — the irreversible work.
The rectangle always sits inside the curve for expansion ⇒ ∣ w irrev ∣ < ∣ w rev ∣ .
Statement: 3 mol of an ideal gas at T = 350 K expands reversibly and isothermally from V 1 = 2 L to V 2 = 8 L . Find w . Use R = 8.314 J mol − 1 K − 1 .
Forecast: Expansion ⇒ guess the sign of w before reading on . (Answer: it must be negative .)
Step 1 — Pick the formula.
w rev = − n R T ln ( V 1 V 2 )
Why this step? "Reversible + isothermal + ideal gas" is exactly the trio this formula requires.
Step 2 — Form the ratio (not the difference!).
V 1 V 2 = 2 8 = 4
Why this step? The log eats a ratio ; units of volume cancel, so we never convert L to m³ here.
Step 3 — Substitute.
w = − ( 3 ) ( 8.314 ) ( 350 ) ln ( 4 ) = − 8729.7 × 1.3863
Why this step? n R T carries the joules; ln ( 4 ) is a pure number.
Step 4 — Evaluate.
w ≈ − 12102 J ≈ − 12.1 kJ
Verify: Sign is negative ✓ (expansion, matches forecast). Units: mol ⋅ J mol − 1 K − 1 ⋅ K = J ✓ . Magnitude larger than a rough P Δ V estimate, as expected for the "area under the curve" ✓ .
Statement: The same gas (3 mol , 350 K ) is now compressed reversibly from 8 L back to 2 L . Find w .
Forecast: We are pushing in — guess the sign. (It flips to positive .)
Step 1 — Same formula, swapped limits.
w = − n R T ln ( V 1 V 2 ) = − n R T ln ( 8 2 )
Why this step? Reversible work only cares about start and end states; now V 1 = 8 , V 2 = 2 .
Step 2 — The ratio is now less than 1.
8 2 = 0.25 , ln ( 0.25 ) = − 1.3863
Why this step? ln of a number below 1 is negative — this is what flips the sign.
Step 3 — Substitute.
w = − ( 3 ) ( 8.314 ) ( 350 ) × ( − 1.3863 ) = + 12102 J ≈ + 12.1 kJ
Why this step? Two negatives (the leading − and the negative ln ) multiply to a positive — the arithmetic that realises the "work done on the gas" sign.
Verify: Positive ✓ (work done on gas, matches forecast). It is exactly + the value of Example 1 — because reversible paths are perfectly retraceable, expansion then compression cancels: w exp + w comp = 0 ✓ .
Statement: The same gas expands from 2 L to 8 L , but this time suddenly against a constant external pressure P ext = 1 atm = 101.325 kPa . Find w .
Forecast: Same start and end volumes as Example 1 — will the magnitude be bigger, smaller, or equal ? (Guess "smaller".)
Step 1 — Constant-pressure formula.
w irrev = − P ext Δ V
Why this step? P ext is constant, so it slides out of the integral − ∫ P ext d V .
Step 2 — Compute Δ V and convert to SI.
Δ V = 8 − 2 = 6 L = 6 × 1 0 − 3 m 3
Why this step? Here volume does not cancel (it is a difference, not a ratio), so we must match kPa ⋅ m 3 = kJ .
Step 3 — Substitute.
w = − ( 101.325 kPa ) ( 6 × 1 0 − 3 m 3 ) = − 0.6080 kJ = − 608 J
Why this step? Multiplying the pressure (in kPa) by the volume change (in m³) yields energy in kJ directly; by our unit policy we report it in J since ∣ w ∣ < 1000 J .
Verify: Negative ✓ (expansion). Magnitude 608 J ≪ 12100 J of Example 1 ✓ — the coral rectangle sits inside the lavender curve of the master figure. Units: kPa ⋅ m 3 = kJ ✓ .
Statement: The gas is compressed from 8 L to 2 L by suddenly applying a large constant P ext = 5 atm = 506.625 kPa . Find w and compare with the reversible compression (Example 2).
Forecast: Compression ⇒ w > 0 . Will this fixed low-pressure crush cost more or less than the reversible path? (Make a guess before Step 3.)
Step 1 — Constant-pressure formula.
w = − P ext Δ V
Why this step? P ext is a single fixed value (5 atm applied all at once), so again it leaves the integral and we use the rectangle formula.
Step 2 — Here Δ V is negative.
Δ V = 2 − 8 = − 6 L = − 6 × 1 0 − 3 m 3
Why this step? The negative Δ V is exactly what makes w come out positive — no separate rule needed.
Step 3 — Substitute.
w = − ( 506.625 kPa ) ( − 6 × 1 0 − 3 m 3 ) = + 3.040 kJ
Why this step? ( − ) × ( − ) gives + ; multiplying kPa by m³ again lands us in kJ, and ∣ w ∣ > 1000 J so we keep kJ.
Verify: Positive ✓ (work done on gas). Compare with reversible compression + 12.1 kJ (Example 2): the fixed 5 atm we crushed with is below the average pressure the reversible path presses against (which rises all the way to the high final pressure), so this irreversible step actually costs less here. The truth to file away: for a fixed pair of states, reversible work is the extremum of magnitude. Both answers are > 0 ✓ , consistent with compression.
Statement: The gas expands from 2 L → 5 L against 3 atm , then 5 L → 8 L against 1 atm . Total work? (1 L⋅atm = 101.325 J .)
Forecast: Same 2 → 8 L endpoints as Example 3. Will two steps give more work magnitude than one? (Guess "yes — closer to the curve".)
Step 1 — Work of each step separately.
w 1 = − P ext , 1 Δ V 1 = − ( 3 atm ) ( 5 − 2 ) L = − 9 L⋅atm
w 2 = − P ext , 2 Δ V 2 = − ( 1 atm ) ( 8 − 5 ) L = − 3 L⋅atm
Why this step? P ext changes between steps, so − ∫ P ext d V splits into a sum of rectangles. Keeping the units L⋅atm explicit avoids ambiguity before converting.
Step 2 — Add.
w = w 1 + w 2 = − 9 − 3 = − 12 L⋅atm
Why this step? Total boundary work is the sum of the work of each contiguous stage — the integral over the whole path equals the sum of the integrals over its pieces.
Step 3 — Convert to joules.
w = − 12 L⋅atm × 101.325 L⋅atm J = − 1215.9 J ≈ − 1.22 kJ
Why this step? L⋅atm is not an SI energy unit; the conversion factor 101.325 J per L⋅atm turns it into joules, and ∣ w ∣ > 1000 J so we report kJ.
Verify: Negative ✓ . Bigger magnitude than Example 3's single step (608 J ) ✓ and still smaller than reversible (12.1 kJ ).
See the figure below: the two coral rectangles form a staircase that hugs the lavender isotherm more closely than the single rectangle of Example 3. The first rectangle (against 3 atm , tall and narrow) and the second (against 1 atm , short and wide) together fill more of the area under the curve than one rectangle could — which is why ∣ w ∣ grew from 608 J to 1216 J . Every extra step you insert adds another coral riser that reclaims a sliver of the gap toward the reversible ceiling.
Worked example Cell F (part i) — no volume change
Statement: A rigid sealed flask of gas is heated. V 1 = V 2 = 4 L . Find w .
Forecast: The walls don't move — guess the work.
Step 1 — Apply either formula. Δ V = 0 ⇒ w irrev = − P ext ⋅ 0 = 0 . Or V 2 / V 1 = 1 ⇒ ln ( 1 ) = 0 ⇒ w rev = 0 .
Why this step? Both formulas must agree at a shared state — a good consistency check.
Verify: w = 0 ✓ . No moving boundary means no expansion work, whatever the heat added.
Worked example Cell F (part ii) — free expansion (vacuum)
Statement: The gas expands from 2 L to 8 L into a vacuum (P ext = 0 ). Find w . (See Free Expansion .)
Forecast: There is nothing pushing back — guess the work.
Step 1 — Constant-pressure formula with P ext = 0 .
w = − P ext Δ V = − ( 0 ) ( 6 L ) = 0
Why this step? Work is done against an external pressure; with no opposition, no work is transferred — even though the gas surely expanded.
Verify: w = 0 ✓ . Note this is the most irreversible expansion possible, and it extracts the least work (zero) — the extreme opposite of the reversible 12.1 kJ . This is the whole moral of the topic.
Statement: Show numerically that a staircase of N equal-volume irreversible steps, each against P ext equal to the gas pressure at the end of that step, approaches the reversible work as N → ∞ . Use n = 1 , T = 300 K , V 1 = 1 L → V 2 = 2 L .
Forecast: As steps multiply, does ∣ w ∣ climb toward or away from the reversible value? (Guess "toward, from below".)
Step 1 — Reversible target.
w rev = − ( 1 ) ( 8.314 ) ( 300 ) ln ( 2 ) = − 1729 J
Why this step? It is the ceiling every staircase creeps up to.
Step 2 — Staircase with N = 4 steps. Each step i pushes against P ext = n R T / V i end over Δ V = 0.25 L . Summing the four rectangles gives ≈ − 1614 J (computed in the Verify block).
Why this step? Each rectangle undercuts the curve; more rectangles fill more of the gap.
Step 3 — N = 100 steps gives ≈ − 1725 J , and N → ∞ gives exactly − 1729 J .
Why this step? Increasing N makes each rectangle hug the isotherm more tightly, so the sum of rectangle areas converges to the exact area under the curve — the very definition of the reversible integral.
Verify: The sequence − 1614 , … , − 1725 , ⋯ → − 1729 J rises monotonically toward w rev ✓ — this is the definition of reversibility as an infinite-step limit. Links directly to Entropy and Irreversibility and the ideal steps of the Carnot Cycle .
Statement: A gas cylinder sealed by a frictionless piston of area A = 0.02 m 2 pushes the piston out by d = 0.15 m against the atmosphere (P atm = 101.325 kPa ). Find the work done on the gas.
Forecast: The piston moves out (gas expands) — sign of w ? (Negative.)
Step 1 — Turn geometry into Δ V .
Δ V = A ⋅ d = 0.02 × 0.15 = 0.003 m 3
Why this step? Volume swept by a flat piston is area × distance — a pure geometry step.
Step 2 — Constant external pressure.
w = − P atm Δ V = − ( 101.325 ) ( 0.003 ) = − 0.3040 kJ = − 304 J
Why this step? The atmosphere is a constant-P ext reservoir — textbook Cell C in disguise; ∣ w ∣ < 1000 J so we report J.
Verify: Negative ✓ (expansion). Units kPa ⋅ m 3 = kJ ✓ . Cross-check: P ⋅ A = 101325 × 0.02 = 2026.5 N force, times 0.15 m = 304 J — same number via force×distance ✓ .
Worked example Cell I (find missing quantity)
Statement: A gas at T = 400 K is expanded reversibly and isothermally, doing − 4000 J of work while its volume triples (V 2 / V 1 = 3 ). How many moles are present?
Forecast: We are running the log formula backwards . Expect a clean small number of moles.
Step 1 — Write the formula and isolate n .
w = − n R T ln ( V 1 V 2 ) ⇒ n = R T l n ( V 2 / V 1 ) − w
Why this step? Everything except n is known; algebra rearranges the boxed formula.
Step 2 — Plug in.
n = ( 8.314 ) ( 400 ) l n 3 − ( − 4000 ) = 3325.6 × 1.0986 4000 = 3653.6 4000
Why this step? ln 3 = 1.0986 ; keep the sign of w as given (− 4000 ), and the double negative in the numerator makes n positive.
Step 3 — Evaluate.
n ≈ 1.095 mol
Why this step? Dividing the joules by the R T ln ( ratio ) (also in joules) leaves a pure number of moles — the unit check happens automatically.
Verify: Positive and physically sensible (~1 mol) ✓ . Units: ( J mol − 1 K − 1 ) ( K ) ( dimensionless ) J = mol ✓ . Substitute back: − ( 1.095 ) ( 8.314 ) ( 400 ) ( 1.0986 ) = − 4000 J ✓ .
Worked example Cell I (mixed path)
Statement: 1 mol of ideal gas at T = 300 K is (i) expanded reversibly and isothermally from 2 L to 6 L , then (ii) compressed irreversibly back from 6 L to 2 L against a constant P ext = 3 atm = 303.975 kPa . Find the work of each leg and the net work of the round trip.
Forecast: The gas returns to its starting volume. For a reversible round trip net work would be zero — but one leg here is irreversible. Guess the sign of the net work. (It should be positive : irreversibility costs us.)
Step 1 — Leg (i): reversible expansion.
w i = − n R T ln ( 2 6 ) = − ( 1 ) ( 8.314 ) ( 300 ) ln 3 = − 2740 J
Why this step? Reversible + isothermal + ideal gas ⇒ the log formula; ratio 6/2 = 3 so no L→m³ conversion.
Step 2 — Leg (ii): irreversible compression.
Δ V = 2 − 6 = − 4 L = − 4 × 1 0 − 3 m 3
w ii = − P ext Δ V = − ( 303.975 kPa ) ( − 4 × 1 0 − 3 m 3 ) = + 1215.9 J
Why this step? Constant P ext ⇒ rectangle formula; negative Δ V makes the compression work positive.
Step 3 — Net work of the round trip.
w net = w i + w ii = − 2740 + 1216 = − 1524 J
Why this step? Work adds along the path; the two legs simply sum.
Verify: The gas is back at 2 L (same state) yet w net = 0 ✓ — proof that work is path-dependent , not a state function. Here w net = − 1524 J < 0 : the round trip actually delivered net work because the reversible expansion out-extracted the cheap 3-atm shove back in. Had leg (ii) also been reversible, w ii = + 2740 J and w net = 0 ✓ . This mixed cycle is the seed idea behind the Carnot Cycle and Entropy and Irreversibility .
Recall Which formula, and why, for each cell?
Reversible isothermal expansion/compression uses ? ::: w = − n R T ln ( V 2 / V 1 ) — because P ext = P gas = n R T / V tracks the gas.
Constant-P ext irreversible uses ? ::: w = − P ext Δ V — P ext is constant so it leaves the integral.
Free expansion into vacuum gives w = ? ::: exactly 0 , because P ext = 0 .
Multi-step irreversible work is found by ? ::: summing − P ext , i Δ V i over each rectangle.
A mixed reversible-then-irreversible round trip has net work ? ::: not zero — work is path-dependent.
Mnemonic Sign in one breath
"Out is negative, in is positive." Gas pushes out ⇒ energy leaves ⇒ w < 0 ; we push in ⇒ energy enters ⇒ w > 0 .