Use gaseous equation, PV=nRT
In case 1st sphere ,
Volume = V,
Pressure = P,
Temperature = T1
So, mole of gas in 1st sphere =PVnRT1
Now stop is opened , then pressure of 1st sphere becomes P!
So, mole in 1st sphere =P1VRT
Similarly, in case of 2nd sphere,
Volume =V2
pressure =P1
Temperature =T1
So, mole in 2nd sphere = P2×V2RT2=P2V2RT2
Now, total mole of gas = mole of gas in 1st sphere + mole of gas in 2nd sphere.
PVRT1=P1VRT1+P1V2RT2
⟹P1=2PT22T2+T1
Hence, pressure within the apparatus is P1=2PT22T2+T1