The phase rule attempts to answer the general question of how many independent variables are needed to define the equilibrium state of a multi-component phase system.

We define the number of degrees of freedom (f) of a system at equilibrium, as the number of independent intensive variables needed to specify its thermodynamic state.

Initially we will make two assumptions, which will later be removed:

- No chemical reaction occurs
- All chemical species are present in each of the phases.

Let be a system formed by c different chemical species and p phases.

To give the composition of the system we need to specify the mole fractions of each component in each phase.

Phase composition $\alpha$: $x_{1}^{\alpha},x_{2}^{\alpha},x_{3}^{\alpha}, ........, x_ {c}^{\alpha}$

Composition of phase $\beta$: $x_{1}^{\beta},x_{2}^{\beta},x_{3}^{\beta}, ........, x_ {c}^{\beta}$

................................................................ ............................

Composition of phase $p$: $x_{1}^{p},x_{2}^{p},x_{3}^{p}, ........, x_{c}^ {p}$

So we need $c\times p$ mole fractions.

In addition, it is necessary to specify the temperature and pressure, which must be the same in all phases of the system, since the system is in thermodynamic equilibrium. That is, we have $c\times p +2$ variables.

Not all variables are independent, since there are equations that relate them. Thus, the sum of the mole fractions of all the components in a phase must equal 1.

\begin{eqnarray} x_{1}^{\alpha}+x_{2}^{\alpha}+...........+x_{c}^{\alpha} & = & 1 \\ x_{1}^{\beta}+x_{2}^{\beta}+...........+x_{c}^{\beta} & = & 1\\ . ...................\\ x_{1}^{p}+x_{2}^{p}+........... +x_{c}^{p} & = & 1 \end{eqnarray}

We have set up an equation for each phase, we have p equations. Since the system is in thermodynamic equilibrium, the chemical potentials of each component in each phase must be equal:

\begin{eqnarray} \mu_{1}^{\alpha}=\mu_{1}^{\beta}=\mu_{1}^{\gamma}=.......... & = & \mu_{1}^{p}\\ \mu_{2}^{\alpha}=\mu_{2}^{\beta}=\mu_{2}^{\gamma}=..... ..... & = & \mu_{2}^{p}\\ .........................\\ \mu_{c }^{\alpha}=\mu_{c}^{\beta}=\mu_{c}^{\gamma}=.......... & = & \mu_{c}^{p } \end{eqnarray}

In each row we have $p-1$ equalities, since there are $c$ rows, the number of equations is: $c(p-1)$

The degrees of freedom are obtained by subtracting variables minus equations:

\begin{equation} f=cp+2-pc(p-1)=\cancel{cp}+2-p-\cancel{cp}+c=c-p+2 \end{equation}

Therefore, the phase rule is given by the equation:

\begin{equation} f=c-p+2 \end{equation}

Now we neglect the second assumption, what will happen if some component is not present in one of the phases? We have one less variable $x_{i}^{k}$, but a relation is also missing since the equilibrium condition has one less equality. Therefore, the phase rule still holds.

We now reject the first assumption, $r$ chemical reactions take place in the system. Each chemical reaction allows us to write an equilibrium condition $\sum_{i}\nu_{i}\mu_{i}=0$. This gives us $r$ additional equations, leaving the phase rule as follows:

\begin{equation} f=c-p+2-r \end{equation}

In some systems additional equations can be raised. If we dissolve NaCl in water it must be fulfilled that $n(Na^+)=n(Cl^-)$ or $x(Na^+)=x(Cl^-)$, we have an additional condition called electroneutrality condition.

In a reactor initially containing $NH_3$, the reaction $2NH_3\rightleftharpoons N_2+3H_2$ takes place at any instant, even at equilibrium, it holds that $n(H_2)=3n(N_2)$. These new equations are entered into the phase rule as a parameter a.

\begin{equation} f=c-p+2-ra \end{equation}

If we call $c_{ind}=cra$, the equation remains as at the beginning of the deduction, $f=c_{ind}-p+2$