The non-equilibrium thermodynamics of a gas inside a piston is a conceptually simple problem where analytic
results are rare. For example, it is hard to find in the literature analytic formulas that describe the heat
exchanged with the reservoir when the system either relaxes to equilibrium or is compressed over a finite time.
In this talk we derive such kind of analytic formulas. To achieve this result, we take the equations derived by
Cerino et al. [Phys. Rev. E 91, 032128] describing the dynamic evolution of a gas-piston system, we cast them in a
dimensionless form and we solve the dimensionless equations with the aid multiple scales expansion method and
regular expansion techniques. With the approximated solutions we obtained, we express in a closed form the heat
exchanged by the gas-piston system with the reservoir for a large class of relevant non-equilibrium situations.