4. (15 points) Identical gases are in two thermally insulated vessels with volumes $V_{1}=2$ L and $V_{2}=3$ L. The pressures of the gases are $p_{1}=3$ atm and $p_{2}=4$ atm, and their temperatures are $T_{1}=400$ K and $T_{2}=500$ K, respectively. The gases are mixed. Determine the temperature that will be established in the vessels.
Answer: $\approx 462$ K.

Solution. The total internal energy of the gases before mixing is equal to the total internal energy after mixing $U_{1}+U_{2}=U$.

$$
\frac{i}{2} \vartheta_{1} R T_{1}+\frac{i}{2} \vartheta_{2} R T_{2}=\frac{i}{2}\left(\vartheta_{1}+\vartheta_{2}\right) R T, \text { where } \vartheta_{1}=\frac{p_{1} V_{1}}{R T_{1}}, \vartheta_{2}=\frac{p_{2} V_{2}}{R T_{2}}
$$

Then $T=\frac{p_{1} V_{1}+p_{2} V_{2}}{\frac{p_{1} V_{1}}{T_{1}}+\frac{p_{2} V_{2}}{T_{2}}} \approx 462 \mathrm{~K}$.