2 boxes linked with a tube, one gets heated, what is the ratio of the volumes I met this problem and I do not know how to approach it. 2 boxes with volumes $V_1$ and $V_2$ contain an ideal gas at the pressure $p$ and are linked through a tube of negligible volume. Initially, the 2 boxes are of the same temperature $T$. Then, box $V_1$ is getting heated at $T_1 = 2T$. As consequence, the ratio between the final pressure of the gas and the initial one is $\frac{8}{7}$. We need to calculate the ratio of the volumes $\frac{V_2}{V_1}$.
The system is operated such that heat is added very gradually to tank 1, so the system is always nearly at mechanical equilibrium, and the pressures in the two tanks are essentially equal at all times.  However, the temperatures in the tanks are unequal after time zero, and the only way for thermal energy to flow from tank 1 to tank 2 is by mass movement through the connecting tube.
Any ideas on how to solve this.
 A: The solution to this problem can be obtained by proper application of the open system (control volume) version of the 1st law of thermodynamics.  The heating is done very slowly, so the pressures in the two tanks will always be equal, but the temperature in tank 1 will be higher than that in tank 2 throughout, assuming no heat conduction through the connecting tube takes place.
I'm going to change the notation from the substandard notation used in the problem statement to make the solution method more understandable.  Let $T_1$ and $T_2$ be the temperatures in tanks 1 and 2 respectively at any time during the heating process, and let $T_i$ be the initial temperature in the two tanks.  So the final temperature in tank 1 will be $T_{1f}=2T_i$.  Similarly let P be the pressure in the two tanks at any time during the heating process, $P_i$ be the initial pressure in the two tanks, and $P_f=\frac{8}{7}P_i$ be the final pressure in the two tanks.
Applying the open system version of the first law to the connecting tube between the tanks, we have that $$h_{out,1}=h_{in,2}=C_pT_1\tag{1}$$where $h_{out,1}$ is the molar enthalpy of the gas exiting tank 1 at any time during the heating process, and $h_{in,2}$ is the molar enthalpy of the gas entering tank 2 at any time during the process.
Next, applying the open system version of the 1st law of thermodynamics to tank 2, we have:
$$d(u_2n_2)=h_{in,2}dn_2\tag{2}$$where $n_2$ is the number of moles of gas in tank 2 and $u_2=C_vT_2$ is the molar internal energy of the gas in tank 2.  It follows from the ideal gas law that $$n_2u_2=\frac{C_v}{R}PV_2\tag{3}$$ and $$dn_2=-dn_1=-d\left(\frac{PV_1}{RT_1}\right)=-\frac{V_1}{R}d\left(\frac{P}{T_1}\right)\tag{4}$$So, combining Eqns. 1-4, we obtain:
$$-C_pV_1T_1d\left(\frac{P}{T_1}\right)=C_vV_2dP\tag{5}$$
Rearranging Eqn. 5 gives:
$$\frac{d\ln{P}}{d\ln{T_1}}=\frac{C_pV_1}{(C_pV_1+C_vV_2)}\tag{6}$$Integrating this equation between the initial and final temperatures and pressures gives the desired result for the ratio of the volumes.
