one adiabatically and the other isothermally