 So we'd like to be able to use thermodynamic variables, energy or entropy or other variables to predict what's going to happen spontaneously in a chemical process. So let's start with a relatively straightforward or at least well-confined example of a process, not quite chemistry just yet. Let's suppose we have two different materials. If you want to, you can picture these as different blocks of different metals in contact with one another, but they don't have to be metals. There could be any two systems at all as long as they're in contact with one another. Energy needs to be able to flow from one into the other. So I'm also not going to want energy to flow between these systems and the outside world, the environment. So let me surround these two blocks of materials A and B with this insulating wall. So all I mean by this insulating wall is it's going to block the transfer of energy. I'm going to have no transfer of energy between A and B and the outside world. So it's thermally insulated from the outside world. I'm going to allow these two systems A and B to be different materials, different sizes, different masses, different everything. They can have different temperatures. They can have different energies. So the energy of A and the energy of B can be different from one another as can their temperatures, as can their entropies. Each one of these properties that we list might be different from one from one than the other. And our goal is to understand what is going to spontaneously happen. Simple enough system, close enough to systems that we have everyday experience with that we kind of have an idea of what's going to happen. If the temperatures, for example, are different, if this system is hotter than system A, then the temperature of B will drop and the temperature of A will increase. In other words, energy will flow from the hotter one to the colder one, changing the temperatures of the two systems as that happens. So the purpose of thermally insulating the material is to guarantee that the energy of the two systems is constrained or constant. So when energy flows from one to the other, the energy of A can change, the energy of B can change, but the total energy of the two systems combined is not going to change. Energy has to be conserved. So in order to predict what's going to happen, if we think about it from a microscopic point of view anyway, what's going to happen is as energy flows from one to the other, so there might be some heat transferred from one of these systems to the other, that's going to change the temperatures, change the energies, change the entropies. But we know what is going to happen is energy is going to transfer in a way that maximizes the total entropy. We've seen that before when we've solved some simpler problems in statistical mechanics, we maximize the entropy, and that will be the state of the system that's most probable. So thinking back to remember what the heat is, remember what heat is. This system B, there might be a bunch of different energy levels. I might have particles occupying different energy levels of the system. When heat is transferred from one to the other, heat is, by definition, heat is not changing the energy of the states themselves, it's changing the probability that those states are occupied. So perhaps some particles will fall down from higher energies to lower states or vice versa. That corresponds to heat being transferred. So that's going to happen on the B side, it's also going to happen on the A side. So particles on the A side might jump up to higher energy levels as particles on the B side fall down to lower energy levels or vice versa. So we want to understand how much and why that's going to happen. Again from the microscopic point of view, we know what to do, it's just a little bit tedious. We can figure out what distribution of these probabilities maximizes not the entropy of A or the entropy of B, but the sum of the entropy of the two things combined. And that's a complicated process in general and not much fun. We'd much rather be able to understand what's going to happen just knowing the values of the energies and entropies and temperatures and so on, the thermodynamic variables. To see how we can go about doing that, let's go back to what we know about energies and entropies. So remember our definition of the internal energy. Using this thermodynamic connection formula, energy is kt squared d log q dt. If we knew the partition function, we could calculate the energy. Likewise, the entropy, if we know the partition function, we have a thermodynamic connection formula that tells us how to get from q to the entropy. What we're interested in here is as heat flows back and forth in which direction or in what amount, the temperature of the two systems is going to change. We expect, as we pointed out at the beginning, if one of these systems is hotter than the other, what we expect to be happening is the hot system is going to cool down, the colder system is going to warm up, and so we're interested in knowing how the energy of that system is going to change as the temperature changes. So let's ask ourselves, what is du dt? That derivative tells us as the temperature is changing, how much does it change the energy? And in particular, it's not going to matter too much, but we're doing these derivatives at constant n and v. We're not allowing the number of molecules in this block to change. I'm not allowing material to transfer from block B to block A or vice versa, just energy. So the number of molecules is not changing, and the volume is not changing, just the energy and the temperature are changing. So since we know what this expression looks like, we can take its temperature derivative. Temperature shows up here in two ways. It shows up in the kT squared in front of this derivative, but q itself might be temperature dependent. In fact, it probably is temperature dependent. That's why taking its derivative with respect to temperature makes sense, but this derivative itself might still have some temperature dependence. So t shows up in these two places. So if we use the product rule, temperature derivative of kT squared gives me 2kT, and I keep the d log q dt around. Or I could leave the kT squared alone, take the temperature derivative of d log q dt. That just gives me a second temperature derivative of log q. So that whole expression is the temperature derivative of this thing. That tells me how quickly the energy changes as the temperature of block A increases or decreases, or block B increases or decreases. We can do the same thing for the entropy. If I ask, how is the entropy of block B changing as I change its temperature? Or how is the entropy of block A changing? dS dt, again just taking the derivative of this expression. q has some temperature dependence hiding in it most likely. So I need to include the possibility that q depends on temperature. So temperature derivative of k log q gives me k d log q dt. This second term, again, I need the chain rule. Temperature derivative of kT is just k times d log q dt. Or leaving the kT alone, taking the temperature derivative of d log q dt, gives me the second derivative of log q with respect to t. So if I look at that expression, the first two terms, k d log q dt and k d log q dt, those are the same. So I've got 2k d log q dt. I'll leave the last term unchanged, kT, d squared log q dt squared. But now notice this expression dS dt, which is equal to these two terms, looks very similar. Not exactly the same, but very similar to the term we got for du dt. In fact, if I just ignore that t, 2k d log q dt looks like this one. And if I ignore one of these t, one of these t's, I have a t squared here, but only a single factor of t down here. If I ignore the second t up here, this term looks exactly like this term. So in other words, if I write dS dt, the expression I've got right here, that's equal to du dt, the first expression we derived. If I just divide out a temperature, if I take this expression, divide by temperature to get rid of the two t's I want to ignore, then I've got the same expression as I have here for dS dt. And again, these are both partial derivatives at constant n and v. So we're almost to the key result here. If I rearrange this equation to say, let's leave dS dt over here. And let's divide by that derivative du dt. So this derivative divided by this derivative is equal to 1 over t. Because both of these are derivatives with respect to t, the same constant variables, constant n and v, the dT's cancel. And I can write that dS du at constant n and v is equal to 1 over t. So here's a rather important result. It's important in two ways. First of all, notice that this expression doesn't have anything, doesn't have q's in it anymore. If we were solving this particular problem for a block of iron and a block of copper or something like that, then I would need to know what is the partition function for this many atoms of copper at a particular temperature. But the q's have all canceled. Notice that this expression just says, when I change the energy of something, the rate at which the entropy changes as I change its energy is proportional, is equal to 1 over the temperature. That's a true statement for any substance, regardless of what its partition function is, regardless of what its energy levels are. That's a relationship between these thermodynamic variables. So that's really the important thing about thermodynamics is we've gotten away from equations that are true only for a particular type of system. Now we've got an equation that's true for every system. And regardless of whether we're talking about two blocks of metal or something else, we can use this expression. Also, although it may not be obvious just yet, this is the key to understanding what direction heat is going to transfer in the system and why heat transfers from hotter to colder. So to explore that a little further is what we'll look at next.