Let $G$ be the total Gibbs energy of a system. Let $G^{\alpha}$ be the Gibbs free energy of phase $\alpha$. The Gibbs free energy change for phase $\alpha$ will be given by: \begin{equation} dG^{\alpha}=-S^{\alpha}dT+V^{\alpha}dP+\sum_{ i}\mu_{i}^{\alpha}dn_{i}^{\alpha} \end{equation} The total Gibbs free energy change will be given by: \begin{equation} dG=-\sum_{ \alpha}S^{\alpha}dT+\sum_{\alpha}V^{\alpha}dP+\sum_{\alpha}\sum_{i}\mu_{i}^{\alpha}dn_{i}^{ \alpha} \end{equation} \begin{equation} dG=-SdT+VdP+\sum_{\alpha}\sum_{i}\mu_{i}^{\alpha}dn_{i}^{\alpha} \end{equation}