Assume both gases behave ideally. For an ideal gas the relation is PV=nRT, where n is the number of moles and R is the universal gas constant.
For gas 1 before mixing,
P1V1=n1RT1⇒n1=RT1P1V1−(1)
For gas 2 before mixing,
P2V2=n2RT2⇒n2=RT2P2V2−(2)
After mixing the two samples, the total number of moles is the sum of n1 and n2:
n=n1+n2=RT1P1V1+RT2P2V2−(3)
The mixture finally occupies volume V at pressure P and temperature T, so once again using the ideal-gas equation,
PV=nRT−(4)
Insert n from (3) into (4):
PV=(RT1P1V1+RT2P2V2)RT
The gas constant R cancels from numerator and denominator, giving
PV=T(T1P1V1+T2P2V2)−(5)
Solve (5) for the final temperature T:
T=T1P1V1+T2P2V2PV
Multiply numerator and denominator by T1T2 to simplify:
T=T2P1V1+T1P2V2T1T2PV
Thus, the temperature of the mixture is
T=T2P1V1+T1P2V2T1T2PV
Option B is correct.