Pull the partition, and it never goes back
Put two different ideal gases in a box, separated by a thin partition, at the same temperature and pressure. Remove the partition. The gases mix — spontaneously, irreversibly, and completely — until every corner of the box has the same uniform composition. No energy was released to drive this; no chemical bond formed or broke. The only thing that changed is how many ways there are to arrange the molecules, and that alone is enough to make mixing not just possible but effectively certain.
Counting microstates
Boltzmann's entropy, S = k·ln(Ω), counts the number of microscopic arrangements Ω consistent with a given macroscopic state. Before mixing, each gas is confined to its own half of the box — a smaller available volume, and therefore fewer possible positions for each molecule. After mixing, every molecule of every species can be found anywhere in the full box — a larger available volume, and therefore vastly more possible arrangements. Since Ω only ever grows when constraints are relaxed, and never shrinks spontaneously, S increases and there is no thermodynamic path back to the separated state without doing external work (running a Maxwell's-demon-style separation, or a real separation process like distillation).
The formula
For ideal gases (or, as an approximation, ideal solutions) mixed at constant temperature and total pressure, the entropy of mixing per mole of mixture is:
ΔS_mix = -n·R · Σᵢ xᵢ · ln(xᵢ) n = total moles of mixture R = ideal gas constant xᵢ = mole fraction of component i (0 < xᵢ < 1, Σxᵢ = 1)
Because every xᵢ is strictly between 0 and 1, ln(xᵢ) is always negative, so -xᵢ·ln(xᵢ) is always positive — every term in the sum adds to the total, and ΔS_mix is always greater than zero for any genuine mixture of distinguishable species. It is maximised for an equimolar two-component mixture (x₁ = x₂ = 0.5), giving ΔS_mix = n·R·ln(2) per mole, and shrinks toward zero as the mixture becomes overwhelmingly dominated by one component (xᵢ → 1 for one species, xⱼ → 0 for the rest).
Free energy: why mixing is spontaneous even with zero energy change
For truly ideal gases (which by definition don't interact), mixing releases or absorbs no heat: ΔH_mix = 0. The full driving force is entropic, and it shows up cleanly in the Gibbs free energy of mixing:
ΔG_mix = ΔH_mix - T·ΔS_mix = 0 - T·ΔS_mix = n·R·T · Σᵢ xᵢ·ln(xᵢ)
Because ΔS_mix > 0, ΔG_mix is negative at every temperature above absolute zero, which is precisely the thermodynamic condition for a spontaneous process at constant temperature and pressure. This is the cleanest possible illustration that spontaneity is governed by free energy, not by energy alone — a process can be entirely energy-neutral and still be thermodynamically inevitable, purely because it makes more microstates accessible.
Real mixtures: when ΔH_mix isn't zero
Real molecules do interact, so real mixing usually has a nonzero enthalpy term alongside the entropy term. If mixing releases heat (ΔH_mix < 0, favourable interactions between unlike molecules, as in many exothermic solvation processes) it only reinforces spontaneous mixing. If mixing costs energy (ΔH_mix > 0, as when unlike molecules repel each other more than they attract, common in polymer blends and some metal alloys) the two terms compete: at high enough temperature the T·ΔS_mix term dominates and the mixture stays homogeneous, but below a critical temperature the enthalpy penalty can win and the mixture spontaneously separates into two coexisting phases — the thermodynamic basis of phase diagrams showing miscibility gaps, spinodal decomposition, and upper/lower critical solution temperatures.
Frequently asked questions
Why is ΔS_mix always positive?
Because every mole fraction xᵢ in a mixture is between 0 and 1, ln(xᵢ) is always negative, so -R·xᵢ·ln(xᵢ) is always positive for every component. Summing positive terms gives a positive total: mixing two or more distinguishable ideal gases always increases entropy, which is exactly why it happens spontaneously and why un-mixing them never happens on its own.
Is there an energy change when ideal gases mix?
For genuinely ideal gases, no — by definition ideal-gas molecules don't interact with each other, so there is no enthalpy of mixing (ΔH_mix = 0). The entire driving force for spontaneous mixing is the entropy term; the free energy of mixing is ΔG_mix = -T·ΔS_mix, which is negative (favourable) at any temperature above absolute zero purely because of the entropy increase, not because of any energetic preference for mixing.
What is the Gibbs paradox?
If you apply the mixing formula to two containers of the SAME gas at the same temperature and pressure and let them combine, the naive classical calculation predicts a positive entropy of mixing — even though nothing physically distinguishable has happened. The paradox is resolved by recognising that identical particles are truly indistinguishable in quantum statistics; correctly accounting for that (dividing the counting of microstates by N!) makes the entropy of mixing identical gases exactly zero, as it should be.
Try it live
Everything above runs in your browser — open Entropy of Mixing and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Entropy of Mixing simulation