On this page
Two vessels, a closed valve, and one question: what is the pressure after the valve opens? This is a common JEE-style and school thermodynamics problem, and it tests two conservation laws at once. The maths is short. The hard part is one phrase in the question, which tells you whether the set-up is isothermal, insulated, or has each vessel held at its own temperature.
What stays the same when two gas containers are connected?
If the vessels are rigid and sealed from the outside, two things are conserved.
Moles. No gas escapes, so n₁ + n₂ is the same before and after. The ideal gas law, pV = nRT, gives each amount as n = pV/RT (OpenStax University Physics, Vol. 2, section 2.1).
Energy, if the vessels are insulated. Rigid walls mean no work and insulation means no heat. OpenStax uses the same reasoning for free expansion: "With Q=0 and W=0 in the first law, ΔEint=0" (OpenStax, section 3.6).
The internal energy of an ideal gas depends only on its temperature, and ΔEint = nCvΔT holds for any process (OpenStax, section 3.5). On the same page, Cv is given as 3/2 R, or 12.47 J/(mol·K), for a monatomic gas and 5/2 R, or 20.79 J/(mol·K), for a diatomic gas.
What is the final pressure when two vessels at the same temperature are joined?
If both vessels start and finish at temperature T, conserve moles: p(V₁ + V₂)/RT = p₁V₁/RT + p₂V₂/RT. R and T cancel, which leaves:
p = (p₁V₁ + p₂V₂)/(V₁ + V₂)
This is a volume-weighted average of the two pressures. If one vessel is empty, it becomes p₁V₁/(V₁ + V₂). For an ideal gas the temperature does not change even in an insulated vessel, which our post on free expansion of an ideal gas explains.
What if the gases start at different temperatures?
Read the wording carefully, because it points to one of three set-ups.
Insulated vessels, same gas. Energy conservation gives n₁CvT₁ + n₂CvT₂ = (n₁ + n₂)CvT, so T = (n₁T₁ + n₂T₂)/(n₁ + n₂). Since nT = pV/R, the final pressure is again p = (p₁V₁ + p₂V₂)/(V₁ + V₂).
Each vessel kept at its own temperature, for example in two separate baths. The pressures become equal but the temperatures stay different. Conserve moles: p(V₁/T₁ + V₂/T₂) = p₁V₁/T₁ + p₂V₂/T₂.
Both brought to a stated temperature T. Use p = (n₁ + n₂)RT/(V₁ + V₂).
If the two gases have different Cv values (helium and nitrogen, say), weight each one by nCv: T = (n₁Cv₁T₁ + n₂Cv₂T₂)/(n₁Cv₁ + n₂Cv₂). The neat pressure shortcut then no longer holds, so work out T first and use pV = nRT. Our post on γ of a gas mixture uses the same weighting.
A worked example: one start, three answers
Vessel A holds 4.0 L at 3.0 atm and 300 K. Vessel B holds 2.0 L of the same diatomic gas at 1.5 atm and 600 K. Keep nR = pV/T in L·atm/K so you never need R:
A: 12/300 = 0.040
B: 3/600 = 0.005
Total: 0.045
With R = 0.0821 L·atm/(mol·K) (OpenStax, section 2.1), that is about 0.487 mol in A and 0.061 mol in B.
Insulated: p = (12 + 3)/6 = 2.5 atm. T = 15/0.045 ≈ 333 K. It is not 450 K, the simple average, because A holds eight times as many moles as B.
Each vessel kept at its own temperature: p(4/300 + 2/600) = 0.045, so p = 2.7 atm. A now holds 2.7 × 4/300 = 0.036, which means one-tenth of A's gas has moved into the hot vessel.
Both cooled to 300 K: p = 0.045 × 300/6 = 2.25 atm.
So one starting state gives three different answers, which is why the wording of the question matters.
How do you avoid the usual mistakes?
Before you write the final answer, check these:
Temperatures are in kelvin.
You have not taken the simple average of T₁ and T₂.
You have not added p₁ and p₂. Dalton's law adds partial pressures of gases that share one volume. Here the volumes change.
The final pressure lies between p₁ and p₂ in the isothermal and insulated cases.
The pressures are equal at the end, once the gas has stopped flowing.
If you keep choosing the wrong set-up, try a few more problems in the Fermi Problem Library. Its step-by-step solver explains the reasoning rather than printing an answer, so you can see where moles or energy came in. If the idea that internal energy depends only on temperature still feels shaky, the Fermi Concept Library has a lesson for each concept and shows where it sits on the concept map.
For more practice with pV = nRT and its unit traps, work through our ideal gas problems guide.



