 So, this requirement that we've seen that when the system is at equilibrium, the chemical potential of each component is equal in each of the phases that is in equilibrium. That turns out to be useful not just for helping us eventually describe where those coexistence lines will be on a phase diagram, but also they place some constraints on the number of properties of a system that we can specify at the same time, the number of thermodynamic degrees of freedom we can specify at the same time. So, remember for a single component system, we've already discussed the fact that we can only specify a number of degrees of freedom that are equal to 3 minus the number of phases. So for a single phase system, we can specify temperature and pressure. 3 minus 1 is 2 degrees of freedom. If we have a phase coexistence between two different phases, then we can only specify the temperature or the pressure, but not both at the same time. So that's what we know is true for a single component system. Things as usual get slightly more complicated for a multi-component system. So that's what we'll try to figure out next is if we have multiple phases and multiple components at the same time, how many degrees of freedom are we allowed to specify? So, let's start with a few examples to make sure it makes sense. So let's take an example like air. I'll assume that air is a mixture of nitrogen gas and oxygen gas. I'll ignore the other components of air, but essentially that's a system with two components, N2 and O2, and just one phase. There's not any coexistence with its liquid. It's just the gaseous phase. So how many degrees of freedom can I specify if I were to specify the composition and thermodynamic properties of the air in this room? Let's start by thinking about what variables I could specify. I can specify the temperature of the air. I can specify the pressure of the air. Now that we're talking about a multi-component system with more than one component in it, I could also specify the concentration or the composition of that mixture. I could specify the mole fraction of N2 molecules in the air. I could specify the mole fraction of O2 molecules in the air, but now that I've written those two down, I can't specify both those two independently. I can't say the the mixture is 60% nitrogen and 70% oxygen. Those two numbers have to add up to 100%. So the fact that I have those two mole fractions have to add up to one, that's a constraint on the system. So that prohibits me from specifying all four of those variables independently. I can only specify three of them independently. So I certainly can make a mixture with whatever fraction nitrogen I want and bring it to some arbitrary temperature and some arbitrary pressure. So there are three degrees of freedom. I expect to be able to find that the number of degrees of freedom in that system is three. Let's consider a slightly more complicated system that's going to involve, in this case, still two components, but let's take a system that has two phases. So instead of just a single phase like a gas, let's take a system that has a liquid and a gas at the same time. So I'm going to have a liquid in coexistence with a gas. And in this case, the system I'll talk about is carbonated water. So system of carbonated water, soda water. I've got water in the liquid phase in equilibrium with its vapor. I've got CO2 dissolved in the liquid phase, but I've also got a pressure of CO2 in the gas phase up above the surface. So it's a two component, two phase system. If we think about how many variables we can specify, let's start by just listing all the variables we could imagine that we might want to specify. We might want to specify the temperature and the pressure. I mean, we might want to specify the concentration of CO2 in the liquid phase. We might want to specify the amount of, in fact, let's, we can think about concentration or mole fraction, different ways of talking about the concentration. Clearly, I can't specify both of those at the same time. If I know the mole fraction, I can convert it to a molarity and vice versa. I can specify the mole fraction of water. I can specify the partial pressure of CO2 in the gas phase. I can specify the partial pressure of H2O vapor in the gas phase. So clearly that's too many variables. I can't specify all those at the same time. I can't independently choose the partial pressure of CO2 and the partial pressure of H2O and the total pressure. These two numbers have to add up to that number. These two numbers have to add up to one. So there's various constraints on the thermodynamic variables. Likewise, there's not just composition constraints. Pressures have to add up to total pressure. Mole fractions have to add up to one. There's also constraints given by the phase coexistence. So the fact that the gas and the liquid phases are in coexistence means, in fact, that I can't simultaneously specify the fraction of CO2 in the solution and the amount of CO2 in the vapor phase. Remember, the Gibbs free energy in the vapor phase depends on the pressure. So if the Gibbs free energy, the partial molar Gibbs free energy or the chemical potential is lower in the vapor phase than the liquid phase, then some water will leave the vapor phase and evaporate. Likewise for CO2. So there's equilibrium between these two and that provides an additional constraint just like these composition constraints. So if I only think about mole fractions, let's make a list of how many total variables I could list. I've got two thermodynamic variables, temperature and pressure, four composition variables, amount of CO2 in the liquid, amount of H2O in the liquid, amount of CO2 in the vapor, amount of H2O in the vapor. So that's a total of six possible potential degrees of freedom. If I think about how many constraints I've got that limit how many of those six degrees of freedom I'm allowed to use, I've got constraints for composition. Mole fraction of water and CO2 have to add up to one. Partial pressure of water and partial pressure of CO2 have to add up to the total pressure. So that's two constraints on the composition variables. I've also got a constraint due to the phase equilibrium, the liquid phase water chemical potential and the gas phase water chemical potential must be equal. Similarly for CO2, liquid phase CO2 has to be equal to gas phase CO2. Those constraints don't directly involve the variables that I'm talking about here, but the pressures will depend on the chemical potentials and vice versa. So these two constraints will again eliminate two of the variables. So if I've got a total of four different constraints, I expect that I'm only going to be able to independently specify two of these different thermodynamic variables. I could name six of them, but the constraints removing these four of them due to these four constraints means that I've only got two of them that I could specify. For example, I could specify the concentration of CO2. I can dissolve a certain amount of CO2 in water. I could imagine setting the temperature to whatever I want, but once I've done that I can't independently control the concentration of water in the solution. Once I've decided how much CO2 is in there, the relative amount of water is fixed. The partial pressure of CO2 above a solution with a certain concentration will depend on the temperature. So the partial pressure of CO2 is fixed. The vapor pressure of water at that temperature is also fixed. So partial pressures of water in CO2 are determined. They'll add up to the total pressure. Once I've determined the concentration and the temperature, everything else is determined. So I can never specify independently more than two degrees of freedom in this two component two phase system. That's a fairly complicated procedure to go through, especially if you find yourself with a solution with six or seven components in equilibrium with vapor phase for the volatile components and equilibrium with the solid that's precipitated out of the solution for the saturated components. So writing down individual constraints can get a little tedious. So one thing we can do is solve this problem once and for all for any amount of phases and any amount of components. So let's try to do that. So let's first try to write down all the thermodynamic variables we can. We have two thermodynamic variables, temperature and pressure. Composition variables, if we have C components and phi phases, how many different composition variables are there? In this case, we had mole fractions for component one and component two. In the liquid phase, mole fractions or partial pressures for component one, component two in the vapor phase. If we have more than two phases, more than two components, if I have three different components, they each have a mole fraction. If I have 10 of them, they each have a mole fraction. I can do that in the liquid phase and the gas phase and however many phases there are. So there's C components times phi phases. So a total of C times phi composition variables. So a total of C times phi plus the two thermodynamic variables is like this list of all the variables I can at least name or think about trying to specify. So I have C phi plus two total, but we're going to lose some because of constraints. So the first question is how many of these type of compositional constraints are there? Constraints like the mole fractions in the liquid phase have to sum to one. The mole fractions in the vapor phase have to sum to one or the partial pressures in the vapor phase have to sum to the total pressure. The number of those composition constraints, there's going to be one such composition constraint for every phase. In this case, there was one for the liquid phase, one for the vapor phase. The other type of constraint we have is these phase equilibrium constraints. That one takes a little bit more thought. How many of these type of constraints are there? If I have in this system I had one for water between the two phases, one for CO2 between the two phases. So there's clearly going to be one for each component. But if I don't just have two phases, if I had three phases, then I'd have a constraint for solid with liquid and a different constraint for liquid being equal to gas. So if I have two phases, then there's one constraint between those two phases. If I add a third phase, I add another equal sign. If I had a fourth phase, I had another equal sign. So the number of phases, if there's five different phases, there's five minus one equal signs between the chemical potentials in those various phases. So the total number of constraints due to this phase equilibrium is components times phases minus one. So if I take this total number of variables, subtract these phases, let's see what we get. We'll get a total number of degrees of freedom that's equal to C phi plus 2 minus phi minus C phi plus C minus minus C. So D is equal to, after this cancellation, C minus phi plus 2. So that's combining all the terms that are left. That result has simplified quite a bit. That's what we call the Gibbs phase rule. And it allows us to predict if we have a multi component system with this many components, equilibrium between this many phases, whether it's just a single phase or multiple phases, this allows us to calculate how many degrees of freedom we can specify independently. So that's worth doing a few examples of to make sure that we trust this equation and see what it's telling us. And that's what we'll do next.