Despite its historical importance, a perfect gas enclosed by a pistons and in contact with a thermal reservoirs is a system still largely under study. Its thermodynamic properties are not yet well understood when driven under non-equilibrium conditions. In particular, analytic formulas that describe the heat exchanged with the reservoir are rare. In this paper we prove a power series expansions for the heat when both the external force and the reservoir temperature are slowly varying over time but the overall process is not quasi-static. To do so, we use the dynamical equations from [Cerino et al., Phys. Rev. E, 91 032128] and an uncommon application of the regular perturbation technique. * gubbiotti@mat.uniroma3.it † davide.chiuchiu@nipslab.org 2