The work done is the shaded area

This situation provides an example of the conservation of energy with the inclusion of heat.

If the temperature of the air remains constant, the internal energy is unchanged and the work done equals the heat expelled to the surroundings.