We're building up our menagerie of state functions. We've now done the internal energy, the enthalpy, the entropy, and the Helmholtz free energy. Let's wrap up with one last state function, and that's the Gibbs free energy. So let's remember that one of our goals is to understand what makes a process spontaneous, and the one we've looked at most recently. Is the condition for spontaneity, given constant temperature and volume. And that is, that the Helmholtz free energy change decreases or is equal to 0 at equilibrium. But constant volume is a somewhat inconvenient thing to maintain. You need a very stiff and very well sealed container, sometimes called a bomb actually, in a laboratory because it's held so tightly and might have big pressures inside. What's much more convenient of course in the laboratory is simply to work in, say, an open flask, in which case you are subject to constant temperature. As long as your lab isn't fluctuating a lot in temperature, and pressure. That is, the system can expand or contract in volume subject to the constant external pressure, which is typically, say, atmospheric pressure, whatever that might be for the altitude that you're working at. And so in that case, given that we can still exchange heat with the surroundings, that's constant temperature, and we have this constant pressure situation, we have to ask. What is the criterion for a spontaneous process that takes place at constant T and P? Isothermal, Isobaric, is another way to say that. Constant T, constant P. Well, as always, the first and second laws of thermodynamics provide a very useful starting point. And so Josiah Willard Gibbs suggested this analysis. So, dU is equal to dell q plus dell w. That's our first law. Here's the second law. And here is the expression for work with external pressure. So if I now plug in for these two quantities, heat and work, I get dU less than or equal to TdS minus PdV. I can rearrange that to dU minus TdS plus PdV is less than or equal to 0. And at constant pressure and temperature, that is equivalent then to the differential of this entire quantity. So if I take that differential I'll get a DU. I get a DTS, but I'm at constant temperature, so DT is zero. I get TDS, there it is. I get DPV, but I'm at constant pressure, so DP is 0, and PDV. And so you see the relationship between this equation and this differential. And that suggests then, that we should define yet another state function. This, the Gibbs free energy. G which is equal to U minus TS plus PV and we have the condition for spontaneity, at constant temperature and pressure, that DG is less than or equal to 0. Again I'd like to digress momentarily and talk a little bit of the history of thermodynamics. And give you a little more introduction to Josiah Willard Gibbs. So in 1863, Gibbs received the first Ph.D. In the United States that was awarded in the field of engineering and indeed he was the fifth person to receive a Ph.D. In any field in the United States and he received that degree from Yale College. He spent all of his professional life at Yale college actually. And he had inherited some money from his family. So, he worked as a faculty member for free for many years for Yale until after he had achieved a certain measure of scientific fame. Johns Hopkins university offered him $3000 a year as salary. Yale retained him with a $2000 dollar a year offer because, I guess he just really like New Haven, Connecticut. So, he spent all of his career there, and he did fundamental work in an amazing number of areas. Gears, brakes, steam engines, vector calculus, optics, statistical mechanics. And. What was sort of remarkable, or a little sad maybe in some ways is that he was virtually unknown in the United States, even though he had an enormous reputation in Europe. Where much of the work in science and engineering was going on during that time period. So Max Planck in fact said of him at one point, Gibbs is among the most renowned theoretical physicists of all times and if Planck says that. That's a measure of some respect. And then there was Albert Einstein, who said Gibbs is the greatest mind in American history. And again, given the person saying that, you have to imagine that Gibbs sort of had it going on. Well, so I mentioned for Helmholtz, that, Germans honor their scientists with stamps, for instance. You know stamps in the United States, you got to get over a pretty high bar to be on a stamp. But first, Gibbs did have a ship named after him, so a U.S. Naval research vessel and oceanographic research vessel was named after him and was active in the 1960's. And then finally he achieved that level of notoriety needed for philatelic memorialization, and so here is that stamp that was issued in 2005, showing Gibbs later in life, so, I sort of love this early picture with the particularly florid bow tie. It's hard to get away with wearing one of those today. But honoring his work as a thermodynamisict. And this is actually a figure that appeared in a work of Maxwell's, we'll see him in an upcoming lecture, that took some of Gibb's ideas and attempted to portray them graphically. Alright, well, again, enough history digression. Let's come back to the Gibb's free energy. So here's the definition. G is equal to U minus TS plus PV. And I want to emphasize the relationships between the state functions we've seen so far. So given that another state function, enthalpy is U plus PV. We can also write that g is equal to h minus ts. And that's actually a form that people are probably more familiar with from early chemistry studies. We can also relate it to the Helmholtz free energy. So a is equal to u minus ts. And as a result, G is equal to A plus PV, so the Helmholtz free energy plus a pressure volume term. And so you say, you can see that, A is related to G, in the same way as U is related to H. That is, each after the addition of PV, gives rise to the other. And on that basis actually in, in a German language, one typically refers to the Gibbs free energy not as a free energy, but as the free enthalpy, because it is PV added to the Helmholtz free energy. I actually think that's a useful combination of terms that helps to keep them straight. But in English usage they're both called free energy. The Helmholtz free energy and the Gibbs free energy. And again if we now express this as a full change as opposed to a differential, we would have that for a spontaneous process a constant P and T. Delta G is equal to delta H minus T delta S, where the equality holds at equilibrium, and the inequality holds for spontaneous processes occurring on the way to equilibrium. Just as for the Helmholtz free energy, there can be competition between entropy changes, and enthalpy changes. In determining the sign of delta G, and at the higher temperatures, entropy will begin to dominate as it's multiplied by a larger, and larger temperature factor. So let's just do a simple example, maybe to, to cement some of those ideas. here we have the delta G expression, and again emphasizing it's isobaric isothermal. And let's just take an example. What would happen if we were to mix ammonia gas and hydrogen chloride gas? So one possibility would be that it would make the salt, ammonium chloride, which is a solid. So if we do this, at constant pressure. And let's use one bar pressure. We can look up in, thermodynamic tables what are the heats of formation at 298 kelvin and 1 bar pressure of ammonia gas, hydrogen chloride gas, and ammonium chloride solid. The difference between the products and the reactants by Hess's law, will be the enthalpy change for the reaction. And if you do that you discover it's minus 176.2 kilojoules. So, it's quite exothermic. You can look up the entropies of formation, as well. Third law entropies, if you will. And discover that the change in entropy for the reaction is minus 0.285 kilojoules per Kelvin. So that is a negative entropy change. That means there is an enormous decrease in disorder, or increase in order if you want to see it that way. And that certainly should not be surprising to us because we're taking two gases, which occupy lots of volume and they have lots of disorder associated with their diluteness. And they're all coming together and making a solid that occupies very little volume and is very ordered as a crystal. So if I take delta H minus T delta S, where T is 298.15 kelvin, and run the calculation, I discover it's minus 91.21 kilojoules. At 298.15. So that is negative, and it says that at that temperature, we would expect spontaneously to observe solid crystals of ammonium chloride form when these gases are mixed. And indeed, that's not an experiment I have a demo of, but, it's not an uncommon one, and one does see little white crystals forming on a tube containing these two gases. So although delta S is negative, the reaction is spontaneous, because the delta H term overwhelms the delta S term. But if we were to raise the temperature high enough so that minus a negative entropy, which would be a positive quantity, times a big prefactor. Outweighs the negative delta H, we could cause the reaction to cease to be spontaneous, and instead the reverse reaction would be spontaneous. So if you work out what temperature that is, it's 618 Kelvin, and so the prediction would be that if we were to raise the temperature of this tube containing the solid salt. Above 618 Kelvin instead of making more salt, we would actually turn the salt back into gas. And that illustrates that enthalpy entropy compensation. Alright. Well, let me pause here for a moment, ask you to consider a question that hopefully helps you see, again the relationship between the components in the Gibbs free energy. Okay. Well, remember that Helmholtz was interested in the Helmholtz free energy as a means of determining how much work could be extracted from a system at constant temperature and volume. Now let's think about the isothermal work from a spontaneous process at constant temperature and pressure. So here's the definition of the Gibbs free energy. And what we want to do is differentiate that. So now, I'll take my differential through. I will take notice that dU is equal to TdS plus del w reversible, so that's the reversible path to calculate dU. So, if I substitute that in, I've got a TdS minus a TdS, so that goes away. I'm just left with the del w reversible where I used to have dU. And I still have these other terms. However, the reversible work consists of the reversible PV work, as well as any other work I might get out of the system, and we'll see examples of other work later on. So, what is the reversible PV work? It's minus PdV, and then there's this other term, so if I replace dell W reversible with these, I have a minus PdV and a plus PdV. So that goes away, and I'm left with dg is equal to del w non pv minus sdt plus vdp. But we're at constant temperature, so dt is 0. We're at constant pressure, so dp is 0. And so we have that dg is equal to. Del w, non PV. That is, the free energy change tells you the maximum non PV work that can be extracted from the system from a spontaneous process, or that it must be done on the system to make a non-spontaneous process occur. Alright, and so dG less than 0, that would define spontaneity, and hence you have this maximum non-PV work you can get out of it, and vice versa. Well, we've now explored the relationship between those two free energies and work. Prior to going on to putting these into more practical, practical practice, I guess, is what I want to say there. Application, maybe. I want to spend a moment, and talk about the utility of Maxwell relations derived from the various state functions. And how they can be used in determining properties of things like gases. And so we'll begin looking at Maxwell relations that derive from the Helmholtz free energy. But before we do that, I think it's about time to do another demonstration. And in particular, now that we've seen the balance between enthalpy and entropy for reactions. And we know that we might be able to drive an endothermic reaction with an entropy change. Maybe we should look at a couple of reactions, exciting ones I hope. We've seen two examples of dramatically exothermic reactions, namely the thermite reaction and the reaction of carbon dioxide with elemental magnesium. However, we've now gotten to the point of realizing that spontaneity for a chemical process is not dictated by enthalpy. But rather by free energy, suggesting that we should be able to find spontaneous processes where increases in entropy may outweigh decreases in enthalpy. So that a reaction may proceed, even though it is formally endothermic. I'd like to demonstrate one example of such a reaction. I'm going to put a small puddle of water on this wooden block, and then place this glass flask. On the puddle. Next, I'm going to add some solid strontium hydroxide octahydrate and then some ammonium nitrate. When these two solids are mixed physically, by stirring. A reaction takes place that liberates the waters of crystallization that are included in the solid strontium hydroxide octohydrate, leading to a slurry of liquid water, dissolved ammonia, and strontium nitrate. The liberation of water. Dramatically increases the entropy of the system, which drives the reaction. Even though the enthalpy change is actually very unfavorable. That is, the reaction is very endothermic. How do we know it's endothermic? Well, let's see. As I'm stirring, the solids are becoming a bit wet. And I can smell liberated ammonia, that escape of ammonia as a gas also dramatically increases the entropy of the process. And now I have a fairly complete reaction. And if I lift the flask from the block, oops I can't lift the flask from the block. The reaction is so endothermic that it has taken heat from the puddle of water, freezing it to ice that now bonds the flask to the block. And indeed, I can feel the cold through my gloves. Now, having demonstrated an endothermic process, I can't resist doing one last exothermic demonstration. In this test tube, I have some solid potassium chlorate, a strong oxidizing agent. And here. I have a gummy bear. A piece of candy that is essentially a mixture of sugar, starch, and gelatin. All of these are organic compounds that can be burned exothermically by a strong oxidizing agent. To make things more interesting, let's heat the potassium chlorate with this torch until it liquifies. [SOUND] [SOUND] There, now, with the help of some tongs, we're going to ask our gummy bear to make a sacrifice for the good of science [SOUND]. [SOUND] Wow. Did you see that. The Gummy Bear was spontaneously immolated with the generation of a good bit of light and noise. [SOUND] Now you know why you can get so much energy from the controlled burning of sugars that your body undertakes as part of normal metabolism. It was nice of the gummy bear to dedicate himself to expanding our knowledge, don't you think [SOUND]?