If the system is in equilibrium at a fixed pressure and temperature, the Gibbs free energy must be a minimum. That means that will be unchanged under a further small shift of mass from one phase to the other.
Now the total Gibbs free energy is the sum of the gibbs free energy of each phase. If we introduce
the ``specific Gibbs free energy'', the Gibbs free energy per unit mass, and if the mass of each
phase is and , we can write
At equilibrium a small transfer of mass from one phase to the other won't change the total :
So the condition for phase coexistence is that the Gibbs free energy per unit mass in each phase is the same.