Solving P₁V₁ = P₂V₂ tells you the new pressure or volume, but it doesn't say anything
about the energy involved in getting there. That's what the "Advanced: work done"
section of the calculator above is for. Once you supply the constant temperature T and the amount of gas n, the work
done by the gas as it moves from V₁ to V₂ is:
W = nRT ln(V₂ / V₁)
R = 8.314462618 J/(mol·K), the molar gas constant; T must be an absolute temperature,
in kelvin.
The sign of the result carries real meaning, not just bookkeeping. When the gas expands
(V₂ > V₁), the ratio V₂/V₁ is greater than 1, its natural log is positive, and W comes out positive — the gas is doing work on whatever is
pushing back against it, like a piston. When the gas is compressed (V₂ < V₁), the
ratio is less than 1, the log is negative, and W comes out
negative — work is being done on the gas by an outside force, rather than by
the gas itself.
There's a neat consequence hiding in the fact that temperature never changes. For an
ideal gas, internal energy is a function of temperature alone — nothing else about the
gas's state affects it. Since ΔT = 0 for an isothermal process, ΔU = 0 as well. Plug
that into the first law of thermodynamics, ΔU = Q − W, and it
collapses to Q = W: whatever work the gas does while expanding
must be supplied entirely as heat flowing in, and whatever work is done compressing the
gas must be released entirely as heat flowing out. None of the energy goes toward
warming or cooling the gas itself, because by definition, it can't.
That's a genuinely different situation from a process where temperature is allowed to
drift. If your scenario changes pressure, volume, and temperature together,
this page's assumptions no longer apply — reach for the combined gas law calculator instead, which handles all three
variables changing at once rather than assuming one of them is pinned.