Gibbs free energy of an ideal-gas mixture (source code)

= Gibbs free energy of an ideal-gas mixture
{c}

For a single-phase <ideal gas> mixture with molar amounts $N_i$, common <temperature> $T$, and <pressure> $P$, extensivity and ideal mixing give
$$
G=\sum_iN_i\mu_i=N\sum_i x_i\left[\mu_i^\circ(T)+\mathcal RT\log\left(\frac{x_iP}{P^\circ}\right)\right].
$$
Here $N=\sum_iN_i$, $x_i$ is the <mole fraction>, $\mathcal R$ is the molar gas constant, and $P^\circ$ is the standard <pressure>. Integrating $\partial\mu_i/\partial P=\mathcal RT/P$ and including the ideal mixing <entropy> proves $\mu_i=\mu_i^\circ+\mathcal RT\log(x_iP/P^\circ)$. Reactions can change $N$, so fractions alone do not set the extensive <Gibbs free energy>. Its composition Hessian is $\mathcal RT(\delta_{ij}/N_i-1/N)$; it is positive semidefinite by the weighted <Cauchy-Schwarz inequality>.