If initial pressure of gas is P and let `S_(1)` and `S_(2)` be the cross-sectional area of the larger and the smaller piston, respectivley, then for equilibrium of the two piston, we have
For larger piston
`P_(0) S_(1) m_(1) g + T = PS_(1)` (if T is the tension in string) (i)
For smaller piston
`PS_(2) + m_(2) g - (T) + P_(0) S_(2)` (ii)
Adding Eqs. (i) adn (ii), we get
`P_(0) (S_(1) - S_(2)) + m_(1) g + m_(2) g = P (S_(1) - S_(2)) + m_(1) g+ m_(2) g = P (S_(1) - S_(2))`
or `P_(0) ((m_(1) + m_(2))/(Delta S)) g = P` (iii)
In gas temperature is increased fromm `T_(1)` to `T_(2)`, the volume of gas increase from V to `V + l Delta S` as l is the displacement of pistons, them gas law we must have
`PV = RT_(1)` (for initial state) (iv)
`P (V + l Delta S) = RT_(2)` (for final state) (v)
According to Eq. (iii), we find the pressure of the gas does not change, as does not depend on temperature.
From Eqs. (iv) and (v), if we subtract the these equation, we get
`P l Delta S = R (T_(2) - T_(1))`
or `T_(2) - T_(1) = (P l Delta S)/(R )`
`= (P_(0) + ((m_(1) + m_(2)))/(Delta S) g) (l Delta S)/(R)`
`[P_(0) Delta S + (m_(1) + m_(2))g] (1)/(R)`