 We're now going to take a look at the amount of exergy associated with different forms of energy. And if you recall from the end of last lecture, what we were saying was that in order to do exergy analysis, what we need to do is find a way to quantify the amount of exergy for the different forms of energy that we typically study within thermodynamics. So the first form of energy that we will look at is that of internal energy. And in order to do this analysis, what we're going to do is we're going to look at a piston cylinder device undergoing what we will assume to be a number of reversible processes. So the question is, what we're trying to do is determine how much work can we get out of a system at temperature T. Temperature T would be associated with the internal energy of that particular system. And what we're going to do is we're going to, in order to study this, is we're going to consider a gas in a piston cylinder device. And we're going to assume the atmospheric pressure is P0. The gas is inside of our piston cylinder device. And we will assume that it is at pressure P and T. And we'll call the boundary there 1. Now what is happening is, if this gas is at a higher temperature, let's assume that a couple of things could take place. One is the gas could expand and in the process of expanding, what we are doing is we're doing boundary work and we'll be interested in the amount of useful boundary work coming out of that. And at the same time, if the gas is at a temperature that is hotter than the surroundings and we'll say the surroundings are at temperature T0, then what we can do is we can put a heat engine between the gas at the hotter temperature and the surroundings. So what I'm going to do is I'm going to sketch a heat engine here and the heat loss from our gas, which is at a hotter temperature, we will denote that as delta Q. Some of the heat will be converted into work and some of it can be rejected by our heat engine. And then what we have is we have an amount of work coming out here with our heat engine. So that is a scenario that we're going to examine. What I want to do now is apply a first law analysis to this system and with this we will then ultimately come up with a form for extra G associated with internal energy. So taking a look at the first law applied to the gas within the piston cylinder device, I denoted that with boundary one. The first law to begin with for a fixed mass system. Now what we're going to assume is that the piston cylinder device is not moving, so kinetic energy and potential energy will drop out. The other thing, remember in my schematic for the piston cylinder device, we had delta Q and delta W. Now the heat was leaving the piston cylinder device and with our convention of heat transfer into a system being positive, that means that the heat transfer is negative. So I can write minus delta Q. Now it was doing work, so that is positive. So it's minus delta W is equal to the change in internal energy. Now what I'm going to do with the work term, I'm going to expand that into useful work and work being done on the surroundings. Remember when we do extra G analysis, we need to take into account the amount of work that is being done on the surroundings. So let me expand delta W. So we have useful boundary work and then we also have the work that is being exerted upon the surroundings and given that it is an expanding piston cylinder device, the useful work is going to be the pressure above the atmosphere multiplied by the change in volume plus the work done on the surrounding atmosphere. So the reason why I'm subtracting off the P0 here is I want pressure above the surrounding atmospheric pressure or our dead state pressure P0. So with that, what we can do is plug this term for the work into the first law and what we end up with is this equation. So we will label this equation one. That's the first thing that we will consider. The second thing I want to consider is the work going through the heat engine because if you recall with our piston cylinder device, we also had a heat engine. So let's take a look at the heat engine and what we're going to do is we're going to try to quantify the work coming out of that heat engine. And what we're going to assume is that we have a reversible heat engine so that would be perhaps the Carnot heat engine or any other heat engine that is reversible. In order to determine the work coming out, we look at the thermal efficiency for a reversible process times the heat transfer coming through that heat engine, which is delta Q. We know that the thermal efficiency for the reversible engine can be expressed in this following manner where T is the higher temperature of our gas and T0 is the surrounding temperature. And so what we can do is we can expand this. Now the first term here, this is heat flow into the heat engine and it is positive. The second term here, the one with the delta Q over T, this heat is crossing our boundary 1 and consequently it is considered a negative term. So with that, and what I will do is I will introduce the definition of entropy for the delta Q over T, which we saw earlier in the course, and we obtain that expression. So the trick with that one is the fact that the temperature transfer across 1 is negative and consequently this term becomes positive. And with that I can now rearrange in terms of delta Q and I will call this equation 2. So what I'm now going to do is I'm going to sub equation 2 into equation 1 and with that we obtain the following. What I'm going to do is combine the two forms of work, both the heat engine as well as the boundary work useful into what we will call the total useful work coming out of our gas at pressure P and temperature T. So there we have an expression for the total useful work coming out of our internal energy. And what we're going to do is we're going to integrate this with respect to the dead state. So we're integrating from some arbitrary temperature T to the dead state which is 0 or T0 and we'll use the subscript 0 to denote the dead state. So let's take a look at what happens when we integrate that. We then get the total useful work to be equal to the internal energy change with respect to the dead state. So that gives us total useful work. And usually what we will be doing is we will be looking at this per unit mass. And so I will then rewrite it and we're going to use a little x and a subscript u to denote x or g for internal energy. So these are now small us to denote that it is per unit mass again for the specific volume and then finally for the entropy. So that gives us an expression for the x or g associated with internal energy. Now what we'll do is we'll go on and we'll look at the x or g for other forms of energy that we encounter within the first law.