Initially both the compartments has same pressure as they are in equilibrium.

Suppose spring is compressed by x on heating the gas.
Let A be the area of cross-section of piston. As gas is ideal monoatomic, so
T1P1V1=T2P2V2 ...... (i)
Force on spring by gas = kx
∴ P2=P1+Akx ...... (ii)
Case I : When V2=2V1 , T2=3T1
From Eqn. (i)
T1P1V1=3T1P2(2V1)⇒P2=23P1
Putting this value in eqn. (ii) we get
23P1=P1+Akx⇒kx=2P1A
x=AV2−V1=A2V1−V1=AV1
Energy stored in the spring
=21kx2=21(kx)(x)=4P1V1
So, option (a) is correct.
Change in internal energy,
ΔU=2f(P2V2−P1V1)=23(23P1×2V1−P1V1)=3P1V1
So, option (b) is correct.
Case II : When V2=3V1 and T2=4T1
From Eqn. (i),
T1P1V1=4T1P2(3V1)⇒P2=34P1
x=AV2−V1=A2V1
From eqn. (ii),
34P1=P1+Akx⇒kx=3P1A
Gas is heated very slowly so pressure on the other compartment remains same.
Work done by gas = Work done by gas on atmosphere + Energy stored in spring.
Wg=P1Ax+21kx2=P1(2V1)+21(3P1A)(A2V1)
=2P1V1+31P1V1=37P1V1
So, option (c) is correct.
Heat supplied to the gas,
ΔQ=Wg+ΔU
=37P1V1+23(P2V2−P1V1)
=37P1V1+23(34P1×3V1−P1V1)
=37P1V1+29P1V1=641P1V1
So, option (d) is incorrect.