Important: Positive work means work done by an external force on a system.
For a mechanical system, the work done by an external force on the system is:
W = ∫ Fext dx
For a gas, Fext = - Fgas = - P A. Here P is the pressure exerted by the gas.
For the work done on a gas, we have:
W = - ∫vivf P A dx = - ∫vivf P d(Ax) = - ∫vivf P dV.
Meaning of the minus sign:
Positive work is done on the gas when the gas is compressed;
negative work is done on the gas when the gas expands.
zero work is done on the gas when the gas volume is fixed.
Geometrically, the work done on a gas is the negative of the area under the curve traced out by
the process in the P-V plane (see transparency).