I think we're ready to now consider spontaneity and the Second Law of Thermodynamics. And to do that I want to construct a special system, one in which that we're going to look at heat flow. So energy as heat flows spontaneously from a region of higher temperature to a region of lower temperature. And sometimes this statement is known as the Zeroth Law of Thermodynamics. And I think I mentioned earlier in the course that this is not a postulate, you can actually prove this in a statistical-mechanical way. But it's a bit beyond what we'd like to do. For now, let's just accept it. It certainly squares with our experience. The Zeroth Law of Thermodynamics, heat will flow from high temperature to low temperature. So now, imagine you can construct the following system. It is an isolated system, which is to say, it's perfectly insulated from its surroundings and it consists of two boxes. Those two boxes are rigid, so there is a hard wall surrounding each box. But the wall that joins them is able to conduct heat. So, heat can flow from one side to the other, although the volume of the individual boxes themselves does not change. So, the fact that it's isolated, that adjective means no exchange of energy with the surroundings, whether heat, work, whatever, it's isolated. The rigid aspect means that there cannot be any work done. Because dV is equal to zero for both of these two compartments. So The First Law tells us that the sum of the internal energies in the two compartments UA plus UB must be a constant. Right? My system is isolated and I don't have any work to do, so UA plus UB are constant. VA and VB are also constant. That's just by definition of being rigid. So let's imagine that I'm actually working with ideal gasses. That'll make life a little bit more simple. It's not a requirement that you work with ideal gasses. The nice thing is that any other system you might imagine can always be imagined being brought into contact with these ideal gasses in a very similar sort of arrangement. And, hence, it would have to follow the same behavior because of The First Law that energy is conserved as the ideal gases. That's what makes the ideal gases wonderful to work with. So, although, they are in equilibrium when we bring them together, they're not in equilibrium with each other. They're at different temperatures perhaps. But in any case the entropy of the total system is defined as the entropy of the left side, I'll call it a, and the entropy of the left side b. So what I want to do is I want to determine the energy and the entropy. So, given that I've got no changes in volume, that means that dU is just going to be equal to del q. It's also equal to, since this is reversible heat, it's equal to TdS, where T is the temperature on an individual side, either A or B. And this depends on there being no work, this, this dV equals zero situation. So the total entropy at change dS is going to be the sum of the two individual entropy changes. dS in box A plus dS in box B. Right? And so I'll just express that then. I'll move the temperature over on the other side here. dU of A divided by T at A plus dUB over tB. Now, in so far, as UA plus UB must be a constant, d of UA plus UB must be zero because the derivative of a constant is zero. Which means dUA must be the negative of dUB, that is any energy change in A must have come from B. That's, doesn't seem like rocket science. So given that, I can just replace this dUA by minus dUB over TA, so here's the minus over TA and I'll just bring the dUB out front. So there's a constant dUB here, so constant, that's dUB, times 1 over TB minus 1 over TA. Well, let's just consider the possible situations. There's, there's three possibilities. Either the temperature in box B started higher than that in A or it started lower than that in A. Or, I did bring them together when their two temperatures were exactly equal. Well, what's going to happen under those circumstances? If the temperature in box B is greater than A, heat will flow out of B into A and that will make the internal energy B go down. It's less than zero. So if this is a negative number and B is larger than A, then, I've got 1 over a big number, which is a small number, minus 1 over not as big a number. So a, a bigger thing that's being subtracted, this also is negative. Negative times negative. I get the change in entropy to be positive. By contrast, if A is greater than B in temperature, then the flow of heat will be to increase the internal energy in U. And so again if I think about that, this is now a positive quantity. Since A is bigger than B, this inverse is smaller than this inverse. So this ends up being positive. So once again, dS is greater than zero. Doesn't matter which direction the heat flows, the entropy change is greater than zero. Of course, if TA equals TB, there's no net energy flow, so I get zero DU. I'll also get this term is equal to zero, so zero times zero is certainly zero. There's no change in entropy at all. Okay, so, the spontaneity and entropy then, the feature I'd like you to notice about this system is that the spontaneous flow of energy as heat from a body at a higher temperature to a body at a lower temperature is governed by the condition, dS is greater than zero. The heat stops flowing when they're at the same temperature. And dS becomes zero thereafter. So, in an isolated system, the energy remains constant. So any spontaneous process must be due to an increase in the entropy. Unlike energy, entropy is not conserved. So that's a key feature of entropy. It increases whenever a spontaneous process takes place. And the entropy of an isolated system will continue to increase until the entire system is in equilibrium. And at that point the entropy remains constant. At that point it will have its maximal entropy. Continues increasing until it can't increase even more because it's at equilibrium. So we say then that dS is greater than 0 for a spontaneous process in an isolated system. And the sorts of things that can happen at equilibrium are reversible processes. And for those, dS is equal to 0. So a way to think about this is that in an isolated system, if you just start it out of equilibrium. That was when I brought my two gases into contact with each other, at different temperatures for instance, that spontaneous processes will occur. So this is a plot of entropy against time. So over time spontaneity, spontaneity, things are happening, things are happening, entropy is increasing, increasing, increasing. And finally, I hit a maximum value of S, the point at which the system is at equilibrium. And at that stage the entropy does not change any longer, dS becomes zero. So what about a general situation, a non-isolated system? So isolated systems are convenient to think about, but we're often interested in systems that can exchange heat, work, what have you, with the surroundings. Well, in that case the change in entropy comes from two sources. So there's the entropy produced just by an irreversible process. So all these spontaneous irreversible processes that are taking place, that's creating entropy. And then, there's entropy because of heat exchanged. So remember the definition of entropy would be the reversible heat change, divided by the temperature, that defines dS. So that's an exchange between the system and the surroundings that becomes possible once it's no longer an isolated system. And so we could write that as dS equals dS produced. So that is always non-negative and associated with spontaneous processes plus dS exchanged. And that can be positive, or negative, or zero. It depends on the sign of the heat transfer which way that might go. So, could also write dS produced over delta q over T. So, for the reversible process, D S, I've got a system at equilibrium. So it won't create any produced entropy, spontaneous entropy. It can, exchange heat with the surroundings through a reversible process. Del q reversible over T that's, defines dS under reversible conditions. Under irreversible conditions, I've got some entropy that comes from the spontaneous process, plus an irreversible heat exchange with surroundings, delta q irreversible over T. Because this quantity is always greater than zero, that means that the net dS is greater than the irreversible heat exchange with the surroundings divided by T. And so here, then, is a statement of The Second Law. It says there is a thermodynamic function of a system, called the entropy S, such that for any change in the thermodynamic state of the system dS is greater than or equal to del q over T. Or if I express it not as the infinitesimal change but as a total change, delta S is greater than or equal to the integral of del q over T. The equality sign applies if the change is carried out reversibly. An inequality sign applies if the change is carried out irreversibly at any stage, so it's a bit like the, the spoonful of wine and the spoonful of sewage. If you have a barrel of s- sewage and you put in a spoonful of wine think of sewage as an irreversible process. You put in a spoonful of wine its still sewage. If you have a barrel of wine, think of that as a reversible process, and you put in a spoonful of sewage, now it's sewage. So it doesn't take much irreversibility to poison the process. It introduces the greater than sign, the inequality sign. Let's look at that a little more, the entropy of irreversible process. So, here, I have that, statement of The Second Law delta S greater than or equal to del Q over T. Let me consider the following. I've got two states of a system. I am going to initially isolate my system from the surroundings. I'm going to perform some sort of irreversible step to get me to State 2. Then I'm going to put my system back in contact with the surroundings and I will reversibly transform from State 2 to State 1. Entropy is a state function and so delta S for the entire process must be zero. So the, the path integral that is a circular path of dS is zero because of the state function properties. And so, what is delta S? Well, it's the integral from State 1 to State 2 of the irreversible heat change over t. Plus the integral from State 2 to State 1 of the reversible heat exchanged over T. And that is because of the irreversibility, so there is this greater than sign, I've got an irreversible step. Mind you what was the irreversible heat exchanged in that irreversible step, it's zero. I had the system isolated. What is it in the reversible step? Well, this defines entropy, so this is just dS, the integral from 2 to 1 of dS is S1 minus S2. And as a result, I get zero greater than zero plus S1 minus S2. And that implies, by just adding S2 to both sides, S2 must be greater than S1. [SOUND]. So, that irreversible step, which corresponds to looking at S2 compared to S1, increased the entropy. So we talked about how spontaneous processes increase the entropy. This is another proof, if you will, that a spontaneous and irreversible process increases the entropy. All right. Well, let's take a moment. I want you to have a chance to think a little more about this and maybe answer a question, and then we'll come back. Okay. Well I want to close by at least introducing one small element of historical context and introduce to you Rudolph Clausius. And so Clausius is shown here and he was the one who first really expressed The Second Law in detail, in 1865, in a paper he published on entropy. And the statement that could be used would, he actually formulated the first two laws of thermodynamics in a common statement, which is the energy of the universe is constant. You can think of that as the first law of thermodynamics. The entropy is tending to a maximum. So that's for the whole universe, and so in a way you could think of the whole universe is an isolated system. If there were a part of the system that we hadn't considered, we wouldn't have the whole universe. We should just add that back in. And we know that for an isolated system, entropy increases until it hits a maximum. So some people refer to that as the heat death of the universe, which hopefully is a long way in the future. But, The Second Law guarantees it's out there somewhere. And then, the mathematical expressions for this are delta U is equal to q plus w and delta S is greater than or equal to the integral of del q over T. So an enormous amount of power in these two relatively simple equations. And also, I might add an enormous amount of gravitas. I, I wish I could sit here looking as, as stern and knowledgeable as Clausius does. But I'll just settle for what I've got. So after this we will continue. I want to look next, we've, we really discussed entropy in the way Clausius discussed entropy to some extent. It is a phenomenal, logical, observational [SOUND] thing that was deduced from the properties of gases and studying heat transfers in gases. Classical thermodynamics. But I want to [UNKNOWN] bring us back to our focus in this course, which is on the molecular underpinnings of those thermodynamics. So we're going to take a look at statistical entropy next and see ultimately how that relates to our molecular picture.