First law of thermodynamics piston problem