(a) The expansion of a gas into a vacuum (pex=0) is called free expansion. Since w=−pexΔV and pex=0,
w=0
No work is done in the free expansion of an ideal gas, whether the process is reversible or irreversible.
(b) T=25+273=298 K.
Initial volume:
Vi=pnRT=2.04.0×0.08206×298 L=48.9 L,Vf=2Vi=97.8 L
Irreversible expansion against 1.0 atm:
w=−pex(Vf−Vi)=−(1.0 atm)(97.8−48.9) L=−48.9 L atm
w=−48.9×101.3 J=−4954 J≈−4.95 kJ
Reversible isothermal expansion:
wrev=−2.303nRTlogViVf=−2.303×4.0×8.314×298×log2 J
wrev=−2.303×4.0×8.314×298×0.3010 J=−6870 J≈−6.87 kJ
In both cases ΔU=0 (isothermal, ideal gas), so the heat absorbed is q=−w: +4.95 kJ for the irreversible path and +6.87 kJ for the reversible path.

The magnitude of the work is the area under the path on the p–V diagram. The reversible path follows the isotherm, so its area is larger: the gas does the maximum work when it expands reversibly.