# Mathematical basis of why enthalpy of mixing is 0 for ideal gas

For this case, let's say there are two identical chambers connected by a small tube, constant pressure and temperature. There's a closed valve that separates the two chambers. Within the chambers there are two ideal gases (doesn't matter which, I think; they're ideal gases). I release the valve and the contents of the two chambers mix.

I understand that heat of mixing for ideal gases is 0 conceptually, because the molecules don't have interaction forces between them so introducing the gases to each other doesn't do much with respect to this. But what is the mathematical basis for heat of mixing being 0 for an ideal gas?

quick edit: above might not be clear. I mean that dH=TdS+VdP. In isothermal, isobaric conditions, dP could be zero, but dS isn't necessarily, that'd imply adiabatic conditions. So how is dH=0 for mixing an ideal gas?

Does the above line of thought apply for mixing? If so, do we take the terms before or after the volume increases? (in this case, final volume = 2*initial volume) I feel this is a frame of reference issue, one that comes up a lot for me in thermo.

• $H = U + PV$, and $U = n c_V R T$… from which you can calculate $\Delta H$ and check that it is zero – F'x Nov 15 '13 at 23:02

A strategy that often works is to look at the initial and the final states and then compare them. A good place to start is usually the Gibbs free energy of the system (with the intention to use $\Delta_{\mathrm{mix}}H = \Delta_{\mathrm{mix}}G + T \Delta_{\mathrm{mix}}S$ later): for isothermal and isobaric conditions it is

\begin{equation} G = \sum_{i} n_{i} \mu_{i} + \mathrm{constant} = n_{\mathrm{tot}} \sum_{i} \underbrace{x_{i}}_{= \, \frac{n_{i}}{n_{\mathrm{tot}}}} \mu_{i} + \mathrm{constant} \hspace{4em} (1) \end{equation}

with $n_{i}$, $\mu_{i}$, and $x_{i} = \frac{n_{i}}{n_{\mathrm{tot}}}$ being the amount, the chemical potential, and the mole fraction of the $i$th component in the system, respectively, and $n_{\mathrm{tot}} = \sum_{i} n_{i}$ being the total amount of gas in the system. So, now we need an expression for the chemical potential of an ideal gas. It can be shown that this is given by

\begin{equation} \mu_{i} = \mu_{i}^{0} + R T \ln\Bigl(\frac{p_{i}}{p^{0}}\Bigr) \hspace{18em} (2) \end{equation}

where $\mu_{i}^{0}$ is the chemical potential of the $i$th component in a given standard state, $R$ is the universal gas constant, $T$ is the temperatur, $p_{i}$ is the partial pressure of the $i$th component, and $p^{0}$ is the standard pressure (i.e. the pressure connected to the standard state). For ideal gases we can apply Raoult's law stating that

\begin{equation} p_{i} = x_{i} p_{\mathrm{tot}} \end{equation}

where $p_{\mathrm{tot}}$ is the total pressure of the system. Using this with equation (2) we get

\begin{equation} \mu_{i} = \mu_{i}^{0} + R T \ln\Bigl(\frac{x_{i} p_{\mathrm{tot}}}{p^{0}}\Bigr) = \mu_{i}^{0} + R T \ln x_{i} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \hspace{6em} (3) \end{equation}

Furthermore, it is known that the partial pressures in a system must add up to the total pressure, i.e.

\begin{equation} p_{\mathrm{tot}} = \sum_{i} p_{i} \end{equation}

Ok, now that the stage is set we simply have to apply equations (1) and (3) to the initial and the final state of the mixing process. At the initial state the chambers are seperated (whereby chamber $i$ contains only one sort of gas labeled by $i$) and so these subsystems are completely independent from each other. Thus, the Gibbs free energy of the total system of chambers is simply the sum of the Gibbs free energies of each chamber, whereby the gas in each of the chambers feels the ambient/total pressure $p_{\mathrm{tot}}$ in the system, since $x_{i} = 1$ (each chamber/independent subsystem holds just one kind of gas). According to equation (1) the Gibbs free energy of the $i$th chamber is then given by

\begin{align} G_{i} &= n_{i} \mu_{i} = n_{i} \biggl( \mu_{i}^{0} + R T \underbrace{\ln 1}_{= \, 0} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) \\ &= n_{i} \biggl( \mu_{i}^{0} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) \end{align}

and the Gibbs free energy of the total system at the initial state is

\begin{align} G_{\mathrm{ini}} &= \sum_{i} G_{i} \\ &= \sum_{i} \underbrace{n_{i}}_{= \, x_{i} n_{\mathrm{tot}}} \biggl( \mu_{i}^{0} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) \\ &= n_{\mathrm{tot}} \biggl( \sum_{i} x_{i} \mu_{i}^{0} + \sum_{i} x_{i} \underbrace{R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr)}_{= \, \mathrm{constant}} \biggr) \\ &= n_{\mathrm{tot}} \biggl( \underbrace{\sum_{i} x_{i} \mu_{i}^{0}}_{= \, G_{\mathrm{ini}}^{0}} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \underbrace{\sum_{i} x_{i}}_{= \, 1} \biggr) \\ &= n_{\mathrm{tot}} \biggl( G_{\mathrm{ini}}^{0} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) \end{align}

At the final state the chambers are connected and the gases mix, so the chambers are not independent subsystems anymore and the Gibbs free energy cannot be broken down into independent parts like before. So now, the complete system of connected chambers must be treated via equation (1)

\begin{align} G_{\mathrm{final}} &= \sum_{i} \underbrace{n_{i}}_{= \, x_{i} n_{\mathrm{tot}}} \biggl( \mu_{i}^{0} + R T \ln x_{i} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) \\ &= n_{\mathrm{tot}} \biggl( \sum_{i} x_{i} \mu_{i}^{0} + \sum_{i} R T x_{i} \ln x_{i} + \sum_{i} x_{i} \underbrace{R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr)}_{= \, \mathrm{constant}} \biggr) \\ &= n_{\mathrm{tot}} \biggl( \underbrace{\sum_{i} x_{i} \mu_{i}^{0}}_{= \, G_{\mathrm{ini}}^{0}} + R T \sum_{i} x_{i} \ln x_{i} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \underbrace{\sum_{i} x_{i}}_{= \, 1} \biggr) \\ &= n_{\mathrm{tot}} \biggl( G_{\mathrm{ini}}^{0} + R T \sum_{i} x_{i} \ln x_{i} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) \end{align}

Now, that we have the Gibbs free energies of the initial and final state we simply need to subtract the former from the latter one in order to obtain the change in Gibbs free energy during the mixing process:

\begin{align} \Delta_{\mathrm{mix}}G &= G_{\mathrm{final}} - G_{\mathrm{ini}} \\ &= n_{\mathrm{tot}} \biggl( G_{\mathrm{ini}}^{0} + R T \sum_{i} x_{i} \ln x_{i} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) - n_{\mathrm{tot}} \biggl( G_{\mathrm{ini}}^{0} + R T \ln\Bigl(\frac{p_{\mathrm{tot}}}{p^{0}}\Bigr) \biggr) \\ &= n_{\mathrm{tot}} R T \sum_{i} x_{i} \ln x_{i} \hspace{22em} (4) \end{align}

Differentiating equation (4) with respect to the temperature we get the entropy of mixing since $\frac{\partial G}{\partial T} \big|_{p, \{ n_{i} \}} = - S$

\begin{equation} \Delta_{\mathrm{mix}} S = - \frac{\partial \Delta_{\mathrm{mix}}G}{\partial T} \bigg|_{p, \{ n_{i} \}} = - n_{\mathrm{tot}} R \sum_{i} x_{i} \ln x_{i} \end{equation}

Finally, you get the desired result by using the famous equation $G = H - TS$

\begin{align} \Delta_{\mathrm{mix}}H &= \Delta_{\mathrm{mix}}G + T \Delta_{\mathrm{mix}}S \\ &= n_{\mathrm{tot}} R T \sum_{i} x_{i} \ln x_{i} - T n_{\mathrm{tot}} R \sum_{i} x_{i} \ln x_{i} \\ &= 0 \end{align}

• @rch I'm glad that it helped. But I now realize that I forgot to address your "quick edit" and why using $dH = TdS + Vdp$ doesn't work. I think the problem might simply be that you've left out the chemical potential term. You'd rather have to use $dH = TdS + Vdp + \sum_{i} \mu_{i} dn_{i}$ where, as you said, $dp = 0$ for isobaric conditions. I haven't tried out that road but that should also get you to the right result eventually. – Philipp Nov 16 '13 at 12:44