A gas sealed under a piston is a machine with exactly two knobs. You can change how much room it has, and you can change how hot it is. Everything else (the pressure it pushes with, the energy stored inside it, the work it delivers to the crankshaft) follows from those two. So if you draw a picture with volume across the bottom and pressure up the side, one dot on that picture is the complete story of the gas at one instant, and a curve is the complete story of a process.
That picture is the PV diagram, and it is the single most useful drawing in thermodynamics. Once you can read it, a question like "how much heat does this engine throw away every cycle" stops being a wall of algebra and becomes a walk around a closed loop, one leg at a time, with a small amount of arithmetic at each corner.
The last lesson, entropy, gave you the rule that decides which processes can happen at all. This one is the bookkeeping: given a cycle that does happen, how much work comes out and how much heat goes in.
One dot is one state
Every point on a PV diagram satisfies the ideal gas law,
where is the number of moles, J/mol·K is the gas constant, and is the absolute temperature in kelvin. Read that as a statement about the diagram: if you know where the dot is, you know , because . You never have to be told the temperature at a corner. You can always compute it.
Try it on a corner you will meet again. A state at Pa and m³ holding mol has
The product has units of joules: a pascal is a newton per square metre and a cubic metre times that is a newton-metre. That is worth remembering, because it means an area on this diagram is an energy in joules with no conversion factor at all.
The second thing a dot tells you is the internal energy. For a monatomic ideal gas the molecules have only translational motion, three directions to move in, and the kinetic theory result is
Again, no temperature needed. Multiply the coordinates of the dot, take three halves of it, and you have in joules. For a diatomic gas the two rotational modes add another and you get . Write if you prefer symbols, with for monatomic gases.
depends only on where you start and where you finish, never on the path between them. Two states with the same product have the same internal energy, even if one is reached by a wild detour. A closed loop therefore has , always.
The four legs you will actually see
Almost every cycle in a problem is built from four kinds of leg, and each has a recognisable shape.
An isochoric leg holds the volume fixed. The piston is locked, so the dot moves straight up or down. The gas cannot push anything through a distance, so the work is zero.
An isobaric leg holds the pressure fixed. The dot moves horizontally. The gas pushes with a steady force while the piston moves, so the work is .
An isothermal leg holds the temperature fixed. Then is a constant, so the dot traces a hyperbola: pressure falls as volume grows, in exact inverse proportion. Since never changes, on this leg, so every joule of heat that enters comes straight back out as work.
An adiabatic leg lets no heat in or out at all, . The gas does work only by spending its own internal energy, so it cools as it expands. That means it drops off a temperature curve as it goes, and the resulting path is steeper than the isotherm through the same point. Here , which is for a monatomic gas.
Quick check
Two curves leave the same point on a PV diagram heading down and to the right. One falls off more steeply than the other. Which is which?
Work is the area under the path
Push a piston of area out by a small distance against pressure . The force on the piston is , so the work the gas does is . But is exactly the extra volume the gas gained. So the work done by the gas in a small step is , and over a whole leg,
That integral is the area under the curve, measured down to the volume axis. Reading rightwards means expanding, and the work counts positive: the gas is paying out energy. Reading leftwards means being squeezed, and the same area counts negative.
Three of the four legs give you this area without any calculus. On an isochore there is no width, so . On an isobar the region is a rectangle, so . On a straight slanted line the region is a trapezium, and the area is the average height times the width:
Only the isotherm needs the integral, and it is a short one. Substitute and pull the constants out:
Worked example 1: work along three simple legs
A gas expands at constant pressure Pa from m³ to m³. The path is a horizontal segment traced left to right, so
Now heat a sealed rigid tank so the state runs straight up from Pa to Pa at m³. The volume never changes, so and J. The pressure tripling is irrelevant to the work; nothing moved.
Finally, take 1.0 mol at 300 K from m³ to m³ along an isotherm:
Compare that with the isobaric answer you would get at the starting pressure, Pa, which would be 2493 J. The isotherm gives less because the pressure sags as the gas expands.
Reaching for on a leg where the pressure is not constant. That formula is the isobaric case and nothing else. On an isotherm use ; on a straight slanted line use the trapezium; on an adiabat use , which is far less painful than integrating .
Heat comes from the first law
You now have from the shape and from the endpoints. The first law of thermodynamics ties them to the heat:
with the heat that flows into the gas and the work the gas does. The signs matter and this is the convention every problem in the bank uses. So the heat on any leg is , and for a monatomic gas that is
Three consequences drop out at once. On an isochore, , so . On an isotherm, , so . On an adiabat, , so .
Try the isochore: a monatomic gas at m³ whose pressure drops from Pa to Pa has
Negative, so 600 J leaves the gas. That is what cooling at fixed volume looks like.
Quick check
A monatomic gas expands along an isobar. Of the heat that enters, what fraction becomes work done by the gas?
Around a closed loop
Take the gas all the way around a cycle and it comes home to the state it started in. Its internal energy is a property of the state, so for the whole trip, and the first law collapses to
Every joule of net heat absorbed comes out as net work. And the net work is the area enclosed by the loop, because the outbound leg contributes the area under it as positive and the return leg subtracts the area under itself, leaving the sandwiched region between them.
Go clockwise and the expansion happens along the upper, high-pressure part of the loop, so the positive contribution wins and . That is an engine. Go counterclockwise and the sign flips: you feed work in, and the device moves heat from cold to hot. That is a refrigerator.
The way to work a cycle without drowning is a table: one row per leg, three columns headed , and . Each process type hands you one entry free. Compute a second from the geometry or the endpoints. Get the third from . Then check that the column sums to zero. That check catches sign errors before they poison an efficiency.
Worked example 2: heat rejected by a rectangular cycle
A monatomic gas goes clockwise around A m³, Pa → B m³, Pa → C m³, Pa → D m³, Pa → A. How much heat leaves per cycle?
Heat leaves on the two legs where the dot moves down or left, so B→C and C→D. Do them one at a time.
B→C is isochoric at m³ with the pressure falling by Pa. No work, so
C→D is isobaric at Pa, compressing from to m³. The work is
negative because the gas is being squeezed. The internal energy change uses the endpoints: J and J, so J. Then
Total heat rejected is J.
You can sanity-check this. The enclosed area is J of net work, so the heat absorbed on the other two legs must be J. Adding A→B ( J, J, so J) to D→A (, J) gives exactly 3900 J. The books balance.
Efficiency, and cycles with slanted legs
An engine's efficiency is what you get divided by what you pay for:
is the sum of only the positive heats. Do not use the net heat in the denominator: the whole point is that you paid for all the heat that went in, including the part you later threw away. For the rectangle above, .
For a refrigerator the useful output is the heat pulled out of the cold space, so the figure of merit is the coefficient of performance , where is the work you put in. A cycle that absorbs 800 J from the cold side while you supply 200 J of work has . There is no contradiction with efficiency being under 1; these are different ratios.
Worked example 3: a triangular cycle
Vertices A m³, Pa, B m³, Pa, C m³, Pa, traversed A→B→C→A with the closing leg a straight line. The gas is monatomic. Find the efficiency.
Net work first. The triangle has base m³ and height Pa, so its area is J. That is the magnitude of the net work per cycle.
Now the legs. A→B is isobaric: J, and J, so J, entering.
B→C is isochoric: and J, so J, also entering.
So J and
The third leg is worth doing as a check, because it is the one that trips people. C→A is a straight slanted line, so its work is the trapezium:
Its internal energy change is J, so
Check the columns. Work: J, which matches the area to the joule and tells you the sense of travel: going right along the bottom, up the right-hand side, and back down the diagonal puts the enclosed region above the outbound leg, so this loop runs counterclockwise and the signed net work is J. Internal energy: , exactly as a closed loop demands. The heat column sums to J, equal to the net work, which is the closing check.
The efficiency the question wants is the useful output over the gross heat paid for, , and the sense of travel does not change either number's size.
Putting the net heat in the denominator of the efficiency. If a cycle absorbs 3900 J and rejects 3000 J, the net heat is 900 J and is also 900 J: you would get an efficiency of 1, which is nonsense. The denominator is the gross heat in, 3900 J.
The Carnot cycle and the adiabatic shortcut
Two isotherms joined by two adiabats make a Carnot cycle. Because no heat crosses the adiabats, all the heat in arrives on the hot isotherm at and all the heat out leaves on the cold isotherm at . On an isotherm , and the geometry of the two adiabats forces the volume ratios on the two isotherms to be equal. So the two heats are in the ratio of the temperatures, and
Between 500 K and 300 K that is . Run the same loop backwards as a fridge between 400 K and 250 K and the coefficient of performance is .
The net work follows just as quickly. For 2.0 mol running the hot isotherm at 600 K from to m³ and the cold one at 300 K, the volume ratio is 3 on both, so
The other classic is the Otto cycle: adiabatic compression, isochoric heating, adiabatic expansion, isochoric cooling. Heat is exchanged only on the two constant-volume legs, where . Working through the ratios gives
with the compression ratio. Compress a monatomic gas from m³ to m³, a ratio of 8, and with you get , so .
Recognising the technique
A problem wants PV-diagram bookkeeping when it hands you a list of states as pairs, or describes a sequence of legs by name (isobaric, isochoric, isothermal, adiabatic) or asks for work, heat, efficiency or coefficient of performance "per cycle". Those phrases mean: draw the loop, then make the table.
Inside that, the sub-choices are decided by single words. "Rigid", "sealed container", "constant volume" means and . "At constant pressure" or "the piston is free and the outside pressure is fixed" means . "Isothermal" or "in contact with a reservoir at " means and you need the logarithm. "Insulated", "adiabatic" or "too fast for heat to flow" means and . "Straight line on the PV diagram" means trapezium.
And three shortcuts save real time. If the question only asks for net work, find the enclosed area and stop. If it only asks for between two states, take and ignore the path entirely, which is why a monatomic gas going from Pa m³ to Pa m³ has , both products being 600 J. And if it asks for the temperature at a corner, that is and nothing more.
Next you leave thermodynamics for a while and pick up wave basics, where the same habit (identify the quantity that is conserved, then track it step by step) comes back in a new costume.