Heating of a gas at constant volume (left) and constant pressure (right)