# Derivation of "activity coefficient form of the Gibbs-Duhem equation"

I'm trying to differentiate the excess Gibbs energy ($$G^{ex}$$) to get the activity coefficient ($$\gamma_k$$), which writes:

$$\frac{\partial (G^{ex}/RT)}{\partial n_k} = \ln\gamma_k \quad (1)$$

in the process of deriving the above equation, I saw some conditions are used, like:

$$RT\sum_i n_i \left( \frac{\partial (\ln \gamma_i)}{\partial n_k} \right)_{T,P,n_{i\neq k}} = 0 \quad (2)$$

• $$n_i$$: mole numbers

or

$$x_1 \text{d} \ln \gamma_1 + x_2 \text{d} \ln \gamma_2 = 0 \quad (3)$$

• $$x_i$$ mole fractions

I'm wondering how (2) and (3) are derived? I saw they were mentiond as "activity coefficient form of the Gibbs-Duhem equation"

but how Gibbs-Duhem equation

$$\sum_i n_i \text{d} \mu_i = 0$$

becomes (2) or (3) are unclear to me.

References:

• (1) and (2) from Thermodynamics and Its Applications by Tester and Modell, P357-358
• （3）from Wikipedia here

Remarks:

• Equation (1) is by definition the natural logarithm of the activity coefficient, so you cannot derive it $$\left[\frac{\partial (nG^\text{E})}{\partial n_j}\right]_{p,T,n_{k \neq j}} \equiv RT\ln(\gamma_j)$$
• Equation (2) is false, we will check it out later.
• Equation (3) can be derived.

I will show you how to derive the Gibbs-Duhem equation and attack at the end the second point.

We postulate that the thermodynamic property $$nM$$ can be expressed as a total differential in terms of the pressure $$p$$, temperature $$T$$, and all amounts $$n_1, n_2, ...$$ $$\begin{equation} \mathrm{d}(nM) = \left[\frac{\partial (nM)}{\partial p}\right]_{T,n} \mathrm{d}p + \left[\frac{\partial (nM)}{\partial T}\right]_{p,n} \mathrm{d}T + \sum_i \left[\frac{\partial (nM)}{\partial n_i}\right]_{p,T,n_{j \neq i}} \mathrm{d}n_i \tag{2} \end{equation}$$ here $$n$$ loosely means all the amounts, and the thermodynamic property $$M$$ is written per total amount, e.g., $$\pu{J mol^-1}$$. Even though we can choose any thermodynamic variables, these ones are only convenient for the Gibbs energy, but you can select any of them.

The last partial derivative, by definition, is the partial molar property $$\overline{M}_i$$ of species $$i$$ in a solution $$\begin{equation} \mathrm{d}(nM) = n\left(\frac{\partial M}{\partial p}\right)_{T,n} \mathrm{d}p + n\left(\frac{\partial M}{\partial T}\right)_{p,n} \mathrm{d}T + \sum_i \overline{M}_i \mathrm{d}n_i \tag{3} \end{equation}$$ where we also took out $$n$$ from the first two partial derivatives. Now we do two things: (1) open up the differential $$\mathrm{d}(nM)$$, and (2) use that $$n_i = x_i n$$ or $$\mathrm{d}n_i = n\mathrm{d}x_i + x_i\mathrm{d}n$$ (with these transformations, now our variables are in terms of molar fractions rather than amounts, so we change the indexes of the partial derivatives) \begin{align} n\mathrm{d}M + M\mathrm{d}n &= n\left(\frac{\partial M}{\partial p}\right)_{T,x} \mathrm{d}p + n\left(\frac{\partial M}{\partial T}\right)_{p,x} \mathrm{d}T + \sum_i \overline{M}_i (n\mathrm{d}x_i + x_i\mathrm{d}n) \\ \color{blue}{n\mathrm{d}M} + \color{red}{M\mathrm{d}n} &= \color{blue}{n\left(\frac{\partial M}{\partial p}\right)_{T,x} \mathrm{d}p} + \color{blue}{n\left(\frac{\partial M}{\partial T}\right)_{p,x} \mathrm{d}T} + \color{blue}{n\sum_i \overline{M}_i \mathrm{d}x_i} + \color{red}{\sum_i x_i\overline{M}_i \mathrm{d}n} \\ \left(M - \sum_i x_i\overline{M}_i \right)\mathrm{d}n &+ \left[\mathrm{d}M - \left(\frac{\partial M}{\partial p}\right)_{T,x} \mathrm{d}p - \left(\frac{\partial M}{\partial T}\right)_{p,x} \mathrm{d}T - \sum_i \overline{M}_i \mathrm{d}x_i\right] n =0 \tag{4} \\ \end{align} Eq. (4) gives us two conditions for it to hold.

1. Summability relation The first one is the famous summability relation. It connect the property of the whole solution $$M$$ to the partial molar properties of all the species. We wil manipulate this one a little bit \begin{align} M &= \sum_i x_i\overline{M}_i \tag{differentiate} \\ dM &= \sum_i \overline{M}_i \mathrm{d}x_i + \sum_i x_i \mathrm{d}\overline{M}_i \tag{5} \end{align}

2. G-D Equation The second one is the famous Gibbs-Duhem, once we combine it with Eq. (5) \begin{align} \require{cancel} \mathrm{d}M - \left(\frac{\partial M}{\partial p}\right)_{T,x} \mathrm{d}p - \left(\frac{\partial M}{\partial T}\right)_{p,x} \mathrm{d}T - \sum_i \overline{M}_i\mathrm{d}x_i &= 0 \\ \cancel{\sum_i \overline{M}_i \mathrm{d}x_i} + \sum_i x_i \mathrm{d}\overline{M}_i + \left(\frac{\partial M}{\partial p}\right)_{T,x} \mathrm{d}p - \left(\frac{\partial M}{\partial T}\right)_{p,x} \mathrm{d}T - \cancel{\sum_i \overline{M}_i\mathrm{d}x_i} &= 0 \\ \sum_i x_i \mathrm{d}\overline{M}_i = \left(\frac{\partial M}{\partial p}\right)_{T,x} \mathrm{d}p - \left(\frac{\partial M}{\partial T}\right)_{p,x} \mathrm{d}T& \tag{7} \end{align} Eq. (7) is general for any change in pressure, temperature, and amounts. For the case where the pressure $$p$$ and temperature $$T$$ are held constant, we have your Eq. (3) (if we divide by $$n$$), because the property $$M$$ is the Gibbs energy and its partial molar property is named the chemical potential $$\overline{G}_i = \mu_i$$ $$\boxed{\sum_i x_i \mathrm{d}\mu_i = 0} \tag{8}$$

An easy way to prove that eq. (2) is wrong, is to test it in an activity model. For example, do the summation $$\sum_i n_i \left(\frac{\partial \ln \gamma_i}{\partial n_i}\right)_ {p,T,n_{k \neq i}} \color{blue}{\neq} \tag{9} 0$$ under the Margules $$1$$ parameter activity model, where $$\ln(\gamma_1) = \frac{A}{RT} x_2^2 \quad \ln(\gamma_2) = \frac{A}{RT} x_1^2 \tag{10,11}$$ and prove, in a beautiful manner, that you get instead $$-(2A/RT)x_1x_2$$.

I let you prove that if you manipulate your Eq. (2) a bit, you can obtain the summability relation. Try it over Eqs. (10) and (11), so you can recover the excess Gibbs energy for the Margules $$1$$ parameter model, which is $$G^\text{E} = Ax_1x_2$$.

I think I figured it out, I was trying to derive equation (2)(or3) from the Gibbs-Duhem equation. But if we change the direction, to replace activity coefficient with chemical potential, things will be easier.

## Details

According to the Gibbs-Duhem equation, that the chemical potential of one component of a mixture cannot change independently of the chemical potentials of the other components. Thus:

\begin{align*} \sum_i n_i \text{d} {\mu_i} = 0 \end{align*} Also, the defination of activity coefficient is: \begin{align*} \ln \gamma_i = \frac{\mu_i -\mu_i^{id}}{RT} \end{align*} Therefore, \begin{align*} \sum_i n_i \left[ \frac{\partial \ln \gamma_i}{\partial n_k} \right]_{T,P,n_{i \neq k}} &= \sum_i n_i \left[ \frac{\partial (\mu_i - \mu_i^{id})}{\partial n_k} \right]_{T,P,n_{i \neq k}} \\ &= \sum_i n_i \left[ \frac{\partial \mu_i}{\partial n_k} - \frac{\partial \mu_i^{id}}{\partial n_k}\right]_{T,P,n_{i \neq k}} \\ &= \sum_i n_i \left[ \frac{\partial \mu_i}{\partial n_k} \right]_{T,P,n_{i \neq k}}- \sum_i n_i \left[ \frac{\partial \mu_i^{id}}{\partial n_k}\right]_{T,P,n_{i \neq k}} \\ \end{align*} recall the Gibbs-Duhem equation $$\sum_i n_i \text{d} \mu_i = 0$$, therefore: \begin{align*} \sum_i n_i \left[ \frac{\partial \mu_i}{\partial n_k} \right]_{T,P,n_{i \neq k}} &=0 \\ \sum_i n_i \left[ \frac{\partial \mu_i^{id}}{\partial n_k}\right]_{T,P,n_{i \neq k}} &=0 \end{align*} so we have \begin{align*} \sum_i n_i \left[ \frac{\partial \ln \gamma_i}{\partial n_k} \right]_{T,P,n_{i \neq k}} =0 \end{align*}