All right. We've been doing a lot of work with ha ha. Work. Thermodynamics. work with pressure and volume changes in gasses and their influence on the path dependence of work, of heat. And the path independence of, of internal energy. So I want to look a little more carefully at pressure, this concept of pressure, from a statistical mechanical viewpoint. And so, I'll remind you of the definition of the internal energy, and that is a sum over all possible energy states within an ensemble, probability weighted by their contribution to the ensemble. And remember that in stat mech the probability is dictated by e to the minus beta times the energy. Which in this case depends on number of particles and volume, divided by the full partition function, the sum of all probabilities. So, I'm interested in the first law in the differential of the internal energy, dU. So, if I apply the chain rule to this expression, I will get probability times the differential of the energy. Plus energy times the differential of the probability. Well, the energy, itself, depends on number of particles and volume. And so, really, I need to chain rule through a bit further. But, for the moment, I'm going to work with a system with a constant number of particles. No particles coming in, no particles going out. In that case, I'll treat de as just the partial derivative of the energy, with respect to the volume, with number of particles held constant. And the reason that this differential expression is interesting is what if I compare it to first law expression, and in particular I'm going to consider reversible processes. Well I've got delta w reversible and delta q reversible. These two have a relationship because delta w reversible, what does this mean? It's an infinitesimal change in the energy levels, with probability remaining the same times a dv. That's why I want to equate this with work. It's because it's multiplying a dv term And the differential work is associated with a pressure times a differential volume. Meanwhile over here, the other piece of the term, just by what's left in the first law, must be associated with differential heat. And what is that? Well, it's infinitesimal changes in the probabilities of the levels with the energy of the levels remaining the same. So it might not be obvious what, how do these really correspond, one to another? It's actually a little helpful to take a look at it graphically, to help make this more clear. And in particular, let me, let me think about this first term. What's it really saying? Work. So differential work is, small changes in energy levels with constant probabilities. So, that would be like, so here might be a distribution within energy space, so every dot, the more dots the more probable. And, so as I go up in energy, I've got less probability. So, increasing the energy would be like pushing these levels further and further apart. And, in a sense, what pressure does in, say, reducing a volume in a box, for example, that would split the energy levels apart, they would become wider. And if I don't change the probabilities, the net energy is raised, and that's really sort of what this term is doing, that's the work term. What about the heat term? The heat term might even be a, a little bit more sensible in, in a way. If I keep the energy levels the same, so these lines are spaced just the same as these lines but I changed the probability of being in those levels. So, to increase the energy, I'd move probabilities out of low levels, up into high levels. That's like increasing the temperature, it's adding heat. Decreasing the energy, obviously the opposite direction. So, pressure then, I mean, given this relationship of work, differential work is this probability times differential energy. And the more common differential work is just minus pdv. I'll get that the pressure is this expression here, proceeding dv. It's the probability weighted, the ensemble weighted values of partial e, partial v. Or, if I want to compute pressure, it is minus. So I've just been carrying this negative sign through. Partial derivative of energy with respect to volume. Keeping the number of particles constant, averaged over the ensemble. So in video 3.4, I just sort of presented this as a trust me, this is the way to compute pressure, and showed that if that was the way to compute pressure, then the ideal gas partition function recovered the ideal gas equation of state. Here's an actual way to appreciate why that's how we calculate pressure. Because of this du being used on the partition function for energy. Alright, well, that's as I said kind of a digression because I want to provide an atomistic understanding of pressure which certainly to do thermodynamics. You don't have to know why pressure is what it is, it's just some quantity you can measure. But for a chemist it's useful to see how that comes from molecular concepts. Next we're going to move on to a new state function. And in particular, having worked a lot with internal energy up to this point, we're going to look at something called enthalpy.