Let T1 be the initial temperature of the gas under the piston, and T2 the gas temperature after the amount of heat ΔQ has been supplied to the system. Since there is no friction and the vessel is thermally insulated, the entire amount of heat ΔQ is spent on the change ΔW in the internal energy of the system:
ΔQ = ΔW.
The change in the internal energy of the system is the sum of the changes in the internal energy of the gas and in the potential energy of the compressed spring (since we neglect the heat capacity of the vessel, piston, and spring).
The internal energy of a mole of an ideal monatomic gas increases as a result of heating from T1 to T2 by

The potential energy of the compressed spring changes by

where k is the rigidity of the spring, and x1 and x2 are the values of the absolute displacement (deformation) of the left end of the spring at temperatures T1 and T2 respectively. Let us find the relation between the parameters of the gas under the piston and the deformation of the spring.
The equilibrium condition for the piston implies that

where p is the gas pressure, and S is the area of the piston. According to the equation of state for an ideal gas, for one mole we have pV = RT. For the deformation x of the spring, the volume of the gas under the piston is V = xS and the pressure p = RT/(xS). Substituting this expression for p into Eq. (3), we obtain

Thus, the change in the potential energy of the compressed spring as a result of heating of the system is

The total change in the internal energy of the system as a result of heating from T1 to T2 is

and the heat capacity of the system is
