We spoke at the beginning of the course about the fact that equilibrium requires:

$T_v = T_L \rightarrow$ thermal equilibrium

$P_v = P_L \rightarrow$ mechanical equilibrium

What else?!

Our discussion of entropy suggests that our other condition(s)
for equilibrium should be related to minimizing entropy; however,
that is difficult to quantify because we need to examine the entire
**universe** in order to do so.

$\Delta S_{universe} \rightarrow maximized$

Instead, let's start with the first law for the closed system above (where a pure-species vapor and liquid are in equilibrium):

$dU = \delta Q + \delta W$

$dU = \delta Q - PdV$

Since we must have mechanical equilibrium, we know that $P=P_v=P_L$ so that $dP = 0$. Because of this we can subtract $VdP$ from this equation without changing anything, so

$dU = \delta Q - PdV - VdP = \delta Q - d(PV)$

Rearranging and using the definition of enthalpy:

$dU + d(PV) = dH = \delta Q$

Now invoking the second law, we know that a real process satisfies:

$dS \ge \frac{\delta Q}{T}$

Rearranging and using our result from above:

$T dS \ge \delta Q = dH$ so that $T dS \ge dH$

Rearranging:

$dH - T dS \le 0$

Recalling the definition of the Gibbs free energy ($G$), we write

$G \equiv H - TS$

so that

$dG = dH - d(TS) = dH - TdS - SdT$

Once again, equilibrium requires that $T=T_v=T_L$ so that $dT=0$, and

$dG = dH - TdS$

Combining with earlier result, we find that a useful condition for equilibrium is that

$dG \le 0 $

While one might be tempted to presume that equilibrium between
vapor and liquid would not be possible, due to the fact that the
entropy of a vapor is higher than that of a liquid (so why
wouldn't it all become vapor?!), this is not true. The fact that
it requires **energy from outside the system** to
change the liquid into a vapor means that the increase in entropy
of our system would be offset by a *decrease* in entropy of
the surroundings.

The Gibbs free energy simplifies equilibrium considerations
because it allows us to **only consider the system**
rather than the universe. It does this by explicitly accounting for
entropy changes in the system and energy interactions with the
surroundings.

Explain how energetic and entropic effects balance at equilibrium.