Thermodynamics of Mixing Ideal Gases

Open a valve between two flasks of different gases and something irreversible happens instantly. Nothing collides differently, no bonds break, yet the universe changes forever. This is mixing, the simplest spontaneous process in all of chemistry. Understanding why mixing is spontaneous, and by how much, requires nothing more exotic than the chemical potential of a perfect gas. It matters because every solution, every separation process, and every equilibrium calculation in chemistry rests on this foundation. Distillation columns, osmotic pressure, and even the entropy cost of unmixing air all trace back to this one idea. This article builds the chemical potential of a gas in a mixture from the partial pressure. You will see how Dalton's law feeds directly into Gibbs energy. Then you will derive the Gibbs energy, entropy, and enthalpy of mixing. Finally you will see why mixing perfect gases is always spontaneous, and never releases or absorbs heat.

Key takeaways
  • Each gas in an ideal mixture behaves thermodynamically as if it alone occupied the container at its own partial pressure.
  • The chemical potential of gas JJ is μJ=μJ⊖+RTln⁡(pJ/p⊖)\mu_J = \mu_J^{\ominus} + RT\ln(p_J/p^{\ominus}).
  • Mixing perfect gases at constant total pressure lowers the Gibbs energy: ΔmixG=nRT∑ixiln⁡xi\Delta_{mix}G = nRT\sum_i x_i\ln x_i, always negative.
  • Because there are no intermolecular forces, the enthalpy of mixing is exactly zero: ΔmixH=0\Delta_{mix}H = 0.
  • The entire driving force for mixing is entropy: ΔmixS=−nR∑ixiln⁡xi>0\Delta_{mix}S = -nR\sum_i x_i\ln x_i > 0.
  • Key idea: Mixing perfect gases is spontaneous solely because it increases entropy, with the Gibbs energy drop coming entirely from the −TΔS-T\Delta S term.
The core insight

In a mixture of perfect gases, each component's chemical potential depends only on its own partial pressure, exactly as if the other gases were not there. This one fact, combined with Dalton's law, is enough to derive the Gibbs energy, entropy, and enthalpy of mixing without any new physics.

The physical picture

Consider a rigid container of volume VV held at temperature TT, containing a mixture of perfect gases. Because perfect gas molecules do not interact, each gas's molecules move as though the others were absent. The pressure exerted by gas JJ alone, called its partial pressure pJp_J, is exactly the pressure it would exert if it occupied the whole volume VV by itself at temperature TT. Dalton's law states that the total pressure is the sum of these partial pressures.

p=∑JpJp = \sum_J p_J

This independence is the key simplification. The chemical potential of a pure perfect gas at pressure pp is known from earlier work on chemical potential in mixtures.

μ=μ⊖+RTln⁡(p/p⊖)\mu = \mu^{\ominus} + RT\ln(p/p^{\ominus})

The bold step, justified rigorously below, is that this same expression applies to each component of a mixture if we simply replace the total pressure pp with that component's partial pressure pJp_J. The chemical potential of JJ "sees" only its own partial pressure. It is blind to whatever other gases share the container, because in a perfect gas there is no energy of interaction to register their presence. This picture explains, at a glance, why mixing gases lowers the Gibbs energy of the system. Before mixing, each gas is at some pressure (often p⊖p^{\ominus} or the total pressure pp). After mixing, each gas is diluted, its partial pressure drops below the total pressure, and since chemical potential increases with pressure, each gas's chemical potential falls. Every component becomes thermodynamically "happier" simply by being dilute.

Figure
Two gases before and after mixing, showing partial pressures and Dalton's law
Gas A, p = 1 bar n_A, V Gas B, p = 1 bar n_B, V → A + B mixed p_A = x_A p p_B = x_B p p = p_A + p_B same 2V, same T

A second view helps: plotting the Gibbs energy of mixing against composition for a two-component system shows a single symmetric minimum at equal mole fractions, always below zero for any composition between pure A and pure B.

Figure
Gibbs energy of mixing versus mole fraction for a two-component perfect gas mixture
mole fraction of A, x_A ΔmixG / nRT 0 1 0.5 minimum ≈ -0.693 at x=0.5

The core relations

μJ=μJ⊖+RTln⁡ ⁣(pJp⊖)\mu_J = \mu_J^{\ominus} + RT\ln\!\left(\frac{p_J}{p^{\ominus}}\right)

where: μJ⊖\mu_J^{\ominus} is the standard chemical potential of pure JJ at p⊖p^{\ominus}, and pJp_J is its partial pressure in the mixture.

pJ=xJpp_J = x_J p

where: xJx_J is the mole fraction of JJ and pp is the total pressure.

ΔmixG=nRT∑JxJln⁡xJ\Delta_{mix}G = nRT\sum_J x_J \ln x_J

where: nn is total moles, TT is temperature, and the sum runs over all components.

ΔmixS=−nR∑JxJln⁡xJ\Delta_{mix}S = -nR\sum_J x_J \ln x_J

where: this is minus the temperature derivative of ΔmixG\Delta_{mix}G at constant pp.

ΔmixH=0\Delta_{mix}H = 0

where: follows because ΔmixG=ΔmixH−TΔmixS\Delta_{mix}G = \Delta_{mix}H - T\Delta_{mix}S and the two temperature-dependent terms cancel exactly.

Derivation AFrom partial pressure to the Gibbs energy of mixing

Goal. Starting from the chemical potential of a perfect gas at its partial pressure, derive ΔmixG\Delta_{mix}G, ΔmixS\Delta_{mix}S, and ΔmixH\Delta_{mix}H for mixing several perfect gases at constant total pressure and temperature.

Step 1: Justify μJ(pJ)\mu_J(p_J) from a mechanical mixture. Imagine gases A and B, each perfect, separated by a partition, each initially at the same pressure pp as the final mixture. Because perfect gas molecules exert no forces on each other, inserting gas B into the volume already containing gas A changes nothing mechanically for A: A's molecules still collide with the walls exactly as before, now simply diluted among B's molecules. The partial pressure of A in the mixture is defined operationally as the pressure A alone would exert in that volume, and by the perfect gas law this equals xApx_A p when the mixture occupies the combined volume at total pressure pp. Since A's molecules do not "feel" B, A's chemical potential in the mixture is identical in form to that of pure A at pressure pAp_A.

μA(in mixture)=μA⊖+RTln⁡ ⁣(pAp⊖)\mu_A(\text{in mixture}) = \mu_A^{\ominus} + RT\ln\!\left(\frac{p_A}{p^{\ominus}}\right)

The same argument applies to every component. This is the essential content of Dalton's law extended to chemical potential.

Step 2: Gibbs energy of the unmixed gases. Take nJn_J moles of each pure gas JJ, each confined separately at the same total pressure pp that will prevail after mixing (this is the standard "mixing at constant pp and TT" setup). The total Gibbs energy of the separated gases is the sum of nJμJ∗n_J \mu_J^{*} over components, where μJ∗\mu_J^{*} is the chemical potential of pure JJ at pressure pp.

Gi=∑JnJ[μJ⊖+RTln⁡ ⁣(pp⊖)]G_i = \sum_J n_J\left[\mu_J^{\ominus} + RT\ln\!\left(\frac{p}{p^{\ominus}}\right)\right]

Step 3: Gibbs energy of the mixture. After the partition is removed, gas JJ has partial pressure pJ=xJpp_J = x_J p, and its chemical potential is given by Step 1. Summing nJμJn_J \mu_J over all components:

Gf=∑JnJ[μJ⊖+RTln⁡ ⁣(xJpp⊖)]G_f = \sum_J n_J\left[\mu_J^{\ominus} + RT\ln\!\left(\frac{x_J p}{p^{\ominus}}\right)\right]

Step 4: Subtract to isolate the mixing term. Form ΔmixG=Gf−Gi\Delta_{mix}G = G_f - G_i. The μJ⊖\mu_J^{\ominus} terms cancel exactly (same moles of each substance before and after), and the ln⁡(p/p⊖)\ln(p/p^{\ominus}) terms cancel too, since ln⁡(xJp/p⊖)−ln⁡(p/p⊖)=ln⁡xJ\ln(x_J p/p^{\ominus}) - \ln(p/p^{\ominus}) = \ln x_J.

ΔmixG=∑JnJRTln⁡xJ=nRT∑JxJln⁡xJ\Delta_{mix}G = \sum_J n_J RT \ln x_J = nRT\sum_J x_J \ln x_J

using nJ=xJnn_J = x_J n. Since each xJ<1x_J < 1, every ln⁡xJ<0\ln x_J < 0, so this sum is always negative: mixing perfect gases always lowers GG at fixed TT and pp.

Step 5: Entropy of mixing from the temperature derivative. Recall (∂G/∂T)p=−S(\partial G/\partial T)_p = -S. Since μJ⊖\mu_J^{\ominus} carries all the temperature dependence associated with the reference state, and xJx_J is composition, not temperature, differentiating ΔmixG=nRT∑xJln⁡xJ\Delta_{mix}G = nRT\sum x_J \ln x_J with respect to TT at constant composition and pressure gives directly:

ΔmixS=−(∂ΔmixG∂T)p=−nR∑JxJln⁡xJ\Delta_{mix}S = -\left(\frac{\partial \Delta_{mix}G}{\partial T}\right)_{p} = -nR\sum_J x_J \ln x_J

Because xJln⁡xJx_J \ln x_J is negative for 0<xJ<10 < x_J < 1, ΔmixS\Delta_{mix}S is always positive — entropy increases on mixing, as expected for a more disordered arrangement of distinguishable gases.

Step 6: Enthalpy of mixing by subtraction. Using ΔmixG=ΔmixH−TΔmixS\Delta_{mix}G = \Delta_{mix}H - T\Delta_{mix}S, rearrange for ΔmixH\Delta_{mix}H:

ΔmixH=ΔmixG+TΔmixS=nRT∑JxJln⁡xJ−T(nR∑JxJln⁡xJ)\Delta_{mix}H = \Delta_{mix}G + T\Delta_{mix}S = nRT\sum_J x_J\ln x_J - T\left(nR\sum_J x_J \ln x_J\right)

The two terms are equal in magnitude and opposite in sign, so they cancel exactly, term by term, for every component.

ΔmixH=0\boxed{\Delta_{mix}H = 0}

This is the physical fingerprint of a perfect gas mixture: mixing is driven entirely by entropy, with zero enthalpy change, because there is no intermolecular energy to alter upon mixing.

Worked examples

Example 1 — Mixing two gases in equal amounts (foundational). One mole of N₂ and one mole of O₂, each initially at 1 bar and 298 K, are mixed at constant total pressure of 1 bar and constant temperature. Find ΔmixG\Delta_{mix}G, ΔmixS\Delta_{mix}S, and ΔmixH\Delta_{mix}H. Total moles n=2n = 2 mol. Mole fractions: xN2=xO2=0.500x_{N_2} = x_{O_2} = 0.500. Compute the composition sum first, since it appears in both GG and SS formulas:

∑JxJln⁡xJ=0.500ln⁡(0.500)+0.500ln⁡(0.500)=ln⁡(0.500)=−0.6931\sum_J x_J \ln x_J = 0.500\ln(0.500) + 0.500\ln(0.500) = \ln(0.500) = -0.6931

Gibbs energy of mixing:

ΔmixG=nRT∑JxJln⁡xJ=(2 mol)(8.314 J K−1mol−1)(298 K)(−0.6931)\Delta_{mix}G = nRT\sum_J x_J \ln x_J = (2\ \text{mol})(8.314\ \text{J K}^{-1}\text{mol}^{-1})(298\ \text{K})(-0.6931)
ΔmixG=(2)(8.314)(298)(−0.6931) J=−3436 J=−3.44 kJ\Delta_{mix}G = (2)(8.314)(298)(-0.6931)\ \text{J} = -3436\ \text{J} = -3.44\ \text{kJ}

Entropy of mixing:

ΔmixS=−nR∑JxJln⁡xJ=−(2 mol)(8.314 J K−1mol−1)(−0.6931)\Delta_{mix}S = -nR\sum_J x_J \ln x_J = -(2\ \text{mol})(8.314\ \text{J K}^{-1}\text{mol}^{-1})(-0.6931)
ΔmixS=11.53 J K−1\Delta_{mix}S = 11.53\ \text{J K}^{-1}

Check consistency: −TΔmixS=−(298 K)(11.53 J K−1)=−3436 J-T\Delta_{mix}S = -(298\ \text{K})(11.53\ \text{J K}^{-1}) = -3436\ \text{J}, matching ΔmixG\Delta_{mix}G exactly, confirming ΔmixH=0\Delta_{mix}H = 0.

ΔmixH=ΔmixG+TΔmixS=−3436 J+3436 J=0\Delta_{mix}H = \Delta_{mix}G + T\Delta_{mix}S = -3436\ \text{J} + 3436\ \text{J} = 0

Sanity check: ΔmixG\Delta_{mix}G is negative (spontaneous), ΔmixS\Delta_{mix}S is positive (disorder increases), and ΔmixH\Delta_{mix}H is exactly zero, all consistent with perfect gas mixing.

Example 2 — Mixing three gases in unequal amounts (applied). A gas cylinder is filled at 1.00 bar and 350 K with 3.00 mol N₂, 1.00 mol O₂, and 1.00 mol Ar, previously stored in three separate compartments at the same pressure and temperature. Calculate ΔmixG\Delta_{mix}G and ΔmixS\Delta_{mix}S for opening the partitions, and find the partial pressure of each gas afterward. Total moles: n=3.00+1.00+1.00=5.00n = 3.00 + 1.00 + 1.00 = 5.00 mol. Mole fractions:

xN2=3.005.00=0.600,xO2=1.005.00=0.200,xAr=1.005.00=0.200x_{N_2} = \frac{3.00}{5.00} = 0.600, \quad x_{O_2} = \frac{1.00}{5.00} = 0.200, \quad x_{Ar} = \frac{1.00}{5.00} = 0.200

Partial pressures at total p=1.00p = 1.00 bar:

pN2=0.600 bar,pO2=0.200 bar,pAr=0.200 barp_{N_2} = 0.600\ \text{bar}, \quad p_{O_2} = 0.200\ \text{bar}, \quad p_{Ar} = 0.200\ \text{bar}

Check: 0.600+0.200+0.200=1.0000.600 + 0.200 + 0.200 = 1.000 bar, matching Dalton's law. Composition sum:

∑JxJln⁡xJ=0.600ln⁡(0.600)+0.200ln⁡(0.200)+0.200ln⁡(0.200)\sum_J x_J\ln x_J = 0.600\ln(0.600) + 0.200\ln(0.200) + 0.200\ln(0.200)
=0.600(−0.5108)+0.200(−1.6094)+0.200(−1.6094)= 0.600(-0.5108) + 0.200(-1.6094) + 0.200(-1.6094)
=−0.3065−0.3219−0.3219=−0.9503= -0.3065 - 0.3219 - 0.3219 = -0.9503

Gibbs energy of mixing:

ΔmixG=nRT∑JxJln⁡xJ=(5.00)(8.314)(350)(−0.9503) J\Delta_{mix}G = nRT\sum_J x_J\ln x_J = (5.00)(8.314)(350)(-0.9503)\ \text{J}
ΔmixG=(5.00)(8.314)(350)×(−0.9503)=−13,812 J=−13.8 kJ\Delta_{mix}G = (5.00)(8.314)(350) \times (-0.9503) = -13{,}812\ \text{J} = -13.8\ \text{kJ}

Entropy of mixing:

ΔmixS=−nR∑JxJln⁡xJ=−(5.00)(8.314)(−0.9503)=39.5 J K−1\Delta_{mix}S = -nR\sum_J x_J\ln x_J = -(5.00)(8.314)(-0.9503) = 39.5\ \text{J K}^{-1}

Check: −TΔmixS=−(350)(39.5 J K−1)=−13,825 J-T\Delta_{mix}S = -(350)(39.5\ \text{J K}^{-1}) = -13{,}825\ \text{J}, agreeing with ΔmixG\Delta_{mix}G to rounding. ΔmixH=0\Delta_{mix}H = 0 as always for perfect gases. Sanity check: three components mixed unevenly give a larger ∣ΔmixS∣|\Delta_{mix}S| per mole of gas than the equal 50:50 case in Example 1, since more mole fractions are far from 1, but note the effect is diluted somewhat by N₂ dominating the mixture. The sign and structure are exactly as expected.

Limiting cases & common traps

SituationResultWhy
Mixing identical gases (same substance)ΔmixG=0\Delta_{mix}G = 0No real mixing occurs; there is no distinguishability, so the formula must not be applied — this is the origin of the Gibbs paradox
One component with xJ→1x_J \to 1Its contribution xJln⁡xJ→0x_J\ln x_J \to 0A nearly pure gas contributes negligibly to mixing quantities
xJ→0x_J \to 0 (trace component)xJln⁡xJ→0x_J \ln x_J \to 0Even though ln⁡xJ→−∞\ln x_J \to -\infty, the product vanishes; trace gases barely affect ΔmixG\Delta_{mix}G per mole of solvent
Mixing at constant volume instead of constant total pressureSame ΔmixG\Delta_{mix}G, ΔmixS\Delta_{mix}S formulasBecause perfect gas partial pressure equals xJpx_Jp regardless of how the mixing is staged, provided each gas ends up occupying the full final volume
Non-ideal (real) gases or liquidsFormulas are only approximateIntermolecular forces make ΔmixH≠0\Delta_{mix}H \neq 0 in general; ideal formulas are the reference, not the rule

The chemist behind it

John Dalton first framed the additivity of partial pressures in 1801, studying humid air and the "mechanical mixture" of gases. He had no access to entropy or Gibbs energy, both nineteenth-century constructs developed decades later by Clausius and Gibbs. Yet Dalton's simple experimental law, that each gas in a mixture behaves as though the others are absent, turned out to be exactly the microscopic justification Josiah Willard Gibbs needed for the chemical potential expression used throughout this article. The bridge from Dalton's partial pressures to Gibbs's chemical potentials is one of the cleanest examples in physical chemistry of an empirical gas law becoming a rigorous thermodynamic statement.

Origins · 1 minJohn Dalton and how this was discovered
JD
John Dalton
1766–1844 · English chemist who formulated the law of partial pressures underlying this entire derivation

Ask the tutor: How does the Gibbs energy of mixing change when the gases are not perfect and intermolecular forces make the enthalpy of mixing nonzero?

Why does mixing perfect gases lower the Gibbs energy if no bonds change and no heat is released

Gibbs energy depends on both enthalpy and entropy through G=H−TSG = H - TS. For perfect gases ΔmixH=0\Delta_{mix}H = 0 exactly, so the entire drop in GG comes from the −TΔmixS-T\Delta_{mix}S term. Mixing increases the number of accessible microstates because molecules of each type can now be found throughout the whole volume rather than confined to their original half. That configurational entropy gain, multiplied by temperature, is large enough to make ΔmixG\Delta_{mix}G negative for any composition between the pure states.

Does the formula for Δmix G apply to mixing liquids or solutions as well

Only approximately, and only if the components behave as an ideal solution, meaning intermolecular forces between unlike molecules resemble those between like molecules closely enough that mixing releases no heat. Real liquid mixtures usually have nonzero ΔmixH\Delta_{mix}H, and their entropy of mixing can deviate from the ideal formula too. The perfect gas result is the reference against which real solution behavior, described later using activities and activity coefficients, is measured.

What happens to Δmix G if the two gases are mixed at different initial pressures rather than the same pressure

The clean formula ΔmixG=nRT∑xJln⁡xJ\Delta_{mix}G = nRT\sum x_J\ln x_J assumes both gases start at the same pressure as the final total pressure of the mixture. If the initial pressures differ, an additional Gibbs energy change accompanies compressing or expanding each gas to the common final pressure before the "mixing" step proper. The problem then splits into two contributions: a pressure-equalization term and the mixing term derived here.

Is the entropy of mixing really about disorder, or is that description misleading

The entropy of mixing is best understood through the number of ways indistinguishable arrangements can be realized, formalized by Boltzmann's S=kln⁡WS = k\ln W. Mixing multiplies the number of accessible spatial configurations for each type of molecule, increasing WW and hence SS. Describing this as "disorder" is a common shorthand, useful but imprecise. The rigorous statement is that mixing increases the number of microstates consistent with the macroscopic description of the system.

Why is Δmix H exactly zero rather than just small for perfect gases

Enthalpy changes on mixing arise from changing intermolecular interaction energies as unlike molecules come into contact. Perfect gas molecules are defined as having no intermolecular forces at all, and no volume of their own, meaning there is no interaction energy to change upon mixing, whatever the identity or proportion of gases involved. This makes ΔmixH=0\Delta_{mix}H = 0 an exact consequence of the perfect gas model, not merely a good approximation, though real gases at high pressure will show small deviations.

Before this

Where this leads