Conservation of gas molecules (isothermal process):
$$n_1 + n_2 = n_{total}$$$$\frac{p_1 V_1}{RT} + \frac{p_2 V_2}{RT} = \frac{P(V_1+V_2)}{RT}$$$$PV = nRT$$ where $P$ = pressure, $V$ = volume, $n$ = moles, $R = 8.314$ J mol$^{-1}$K$^{-1}$, $T$ = temperature in Kelvin. For fixed $T$: $PV = nRT = $ constant. When two chambers are combined isothermally: $n_{total} = n_1 + n_2 = rac{p_1V_1 + p_2V_2}{RT}$. Final equilibrium pressure: $P = rac{(p_1V_1 + p_2V_2)}{V_1+V_2}$.
For a mixture of ideal gases, total pressure equals sum of partial pressures: $$P_{total} = P_1 + P_2 + P_3 + ...$$ Partial pressure of gas $i$: $P_i = x_i P_{total}$ where $x_i = n_i/n_{total}$ is the mole fraction. Each gas behaves as if it alone occupies the container. No intermolecular forces between different gas molecules (ideal assumption).
Ideal gas assumptions: (1) Gas molecules are point masses (negligible volume). (2) No intermolecular forces except during collisions. (3) Collisions are perfectly elastic. (4) Molecules move randomly in all directions. (5) Average kinetic energy $\propto T$: $\langle KE angle = rac{3}{2}k_BT$ per molecule. Pressure arises from molecular collisions with walls: $P = rac{1}{3} ho ar{v^2} = rac{1}{3}rac{mN}{V}v_{rms}^2$.
Three important speeds from Maxwell distribution: RMS speed: $v_{rms} = \sqrt{rac{3RT}{M}}$. Mean speed: $ar{v} = \sqrt{rac{8RT}{\pi M}}$. Most probable speed: $v_p = \sqrt{rac{2RT}{M}}$. Ratio: $v_p : ar{v} : v_{rms} = 1 : 1.128 : 1.225$. All increase with $\sqrt{T}$ and decrease with $\sqrt{M}$. Lighter gases (H$_2$, He) move faster than heavier ones (O$_2$, CO$_2$).
Average distance between collisions: $\lambda = rac{1}{\sqrt{2}\pi d^2 n}$ where $d$ = molecular diameter, $n$ = number density. Increases with decreasing pressure. At atmospheric pressure and room temperature: $\lambda pprox 70$ nm for air. Mean free path determines: thermal conductivity, viscosity, diffusion. At high altitudes (low pressure): $\lambda$ increases, atmosphere thins, convection changes.
Each degree of freedom contributes $rac{1}{2}k_BT$ to average energy (equipartition theorem). Monatomic gas (He, Ar): 3 translational DOF, $U = rac{3}{2}nRT$, $C_v = rac{3}{2}R$. Diatomic gas (N$_2$, O$_2$): 3 translational + 2 rotational DOF, $U = rac{5}{2}nRT$, $C_v = rac{5}{2}R$. At very high $T$: vibrational modes activated, $C_v$ increases. $\gamma = C_p/C_v$: monatomic $= 5/3$, diatomic $= 7/5$.
$$\left(P + rac{an^2}{V^2} ight)(V - nb) = nRT$$ $a$ = intermolecular attraction correction (reduces pressure). $b$ = finite molecular volume correction. At high $P$ or low $T$: real gas deviates significantly from ideal. Compression factor $Z = PV/nRT$. Ideal gas: $Z = 1$ always. Real gas: $Z < 1$ at moderate $P$ (attraction dominates), $Z > 1$ at high $P$ (repulsion dominates). Boyle temperature: $T_B = a/Rb$, where $Z pprox 1$ for a range of pressures.
$C_v$ = molar specific heat at constant volume: $Q = nC_v\Delta T$, all heat goes to internal energy. $C_p$ = molar specific heat at constant pressure: $Q = nC_p\Delta T$, heat goes to internal energy plus work. Mayer relation: $C_p - C_v = R$. The extra $R$ accounts for work done by gas expanding at constant pressure. $\gamma = C_p/C_v$. For monatomic: $\gamma = 5/3 pprox 1.67$. For diatomic: $\gamma = 7/5 = 1.4$. Higher $\gamma$ = more adiabatic compression heating (diesel engines use this).