Heat, Work and the First Law

Rub your hands together on a cold morning and they warm up. Pump up a bicycle tyre and the pump gets hot. In both cases you did no "heating" — there was no flame, no hotplate — yet the temperature rose. You raised the internal energy of something by doing work on it. Heat is not the only way to change how much energy is stored inside matter; pushing is another. The first law of thermodynamics is the bookkeeping rule that ties these two channels together into a single, unbreakable statement of energy conservation. It is nothing more, and nothing less, than "energy in equals energy stored plus energy out" — written carefully enough to be exact.

This page takes the school idea of work and internal energy and sharpens it into the master equation of thermodynamics. Get the sign convention straight and the rest of this module — engines, refrigerators, entropy — becomes bookkeeping you can actually do.

Internal energy: the hidden bank balance

Every lump of matter holds energy inside it that has nothing to do with where it is or how fast the whole lump is moving. Its molecules are perpetually darting, spinning and vibrating, and they tug on one another through intermolecular forces. Add up all that microscopic kinetic and potential energy and you get the internal energy U of the body. For an ideal gas — no intermolecular forces to speak of — U is purely the kinetic energy of the molecules, and so depends only on temperature.

The crucial point: U is a state function. It depends only on the current state of the system (its temperature, pressure, amount), not on the history of how it got there. Like the balance in a bank account, U is a number that is — it doesn't remember whether the money arrived as wages or as a gift. Heat and work, as we'll see, are the deposits and withdrawals: they are ways energy is transferred, not stuff a system "contains."

Two ways to change U: heat versus work

You can change a system's internal energy through exactly two channels, and telling them apart is the whole game.

The deep lesson of the nineteenth century — nailed down by Joule's paddle-wheel experiments — is that heat and work are interchangeable currencies of the same thing, energy. A given rise in internal energy can be produced by so many joules of heating or the same number of joules of stirring. That equivalence is what makes the first law possible.

The first law — and the sign convention that trips everyone

Conservation of energy for a closed system, written for these two channels, is the first law:

The minus sign is not decoration — it encodes a choice of bookkeeping. In this (physicist's / "engine") convention:

Heat you receive raises your balance; work you do drains it. That is all the equation says. (Beware: many chemistry books write \Delta U = Q + W, defining W as work done on the system. Same physics, opposite label — always check which W a book means.)

pV work: pushing back the world

The most important kind of work in thermodynamics is a gas expanding and pushing a piston. If the gas sits at pressure p and pushes a piston of area A out by a small distance \mathrm{d}x, the force on the piston is pA and the little bit of work is

\mathrm{d}W = (pA)\,\mathrm{d}x = p\,(A\,\mathrm{d}x) = p\,\mathrm{d}V,

because A\,\mathrm{d}x is just the extra volume swept out. Add up all the little pushes as the volume goes from V_1 to V_2:

W = \int_{V_1}^{V_2} p\,\mathrm{d}V.

That integral is exactly the area under the curve on a pressure–volume diagram. When the pressure is held constant (an isobaric expansion) it collapses to a simple rectangle, W = p\,\Delta V = p\,(V_2 - V_1). Reveal the figure to see the work appear as shaded area.

Worked examples

Example 1 — heat in, work out. A gas absorbs Q = 500\ \text{J} of heat and, in expanding, does W = 200\ \text{J} of work on its piston. Its internal energy changes by

\Delta U = Q - W = 500 - 200 = +300\ \text{J}.

Half a kilojoule went in as heat; 200 J left as work; the 300 J that stayed raised the internal energy (and so the temperature).

Example 2 — compressing a gas. You push a piston in, doing 150\ \text{J} of work on the gas while it loses 40\ \text{J} of heat to its surroundings. Here the work done by the gas is negative, W = -150\ \text{J}, and the heat added is Q = -40\ \text{J}:

\Delta U = Q - W = (-40) - (-150) = +110\ \text{J}.

Even though heat left, the internal energy rose — because you did more work squeezing it than the heat that escaped. This is exactly why a bicycle pump warms up.

Example 3 — isobaric pV work. A gas at constant pressure p = 2.0\times10^{5}\ \text{Pa} expands from V_1 = 1.0\times10^{-3}\ \text{m}^3 to V_2 = 3.0\times10^{-3}\ \text{m}^3. The work it does is

W = p\,\Delta V = (2.0\times10^{5})(3.0\times10^{-3} - 1.0\times10^{-3}) = (2.0\times10^{5})(2.0\times10^{-3}) = 400\ \text{J}.

For a century people thought exactly that. The caloric theory imagined heat as an invisible, weightless fluid ("caloric") stored inside hot bodies and flowing out into cold ones. It explained a lot — but it choked on friction. Count Rumford, boring cannon barrels in Munich around 1798, noticed the brass got endlessly hot as long as the drill kept turning — you could apparently squeeze out unlimited caloric from a finite lump of metal, which made no sense for a conserved fluid. James Joule finished the job in the 1840s, showing with paddle-wheels and falling weights that a fixed amount of mechanical work always produces the same amount of heating. Heat wasn't a substance stored in things; it was energy in transit. That is why the first law treats Q and W on the same footing — they are two ways of moving the one currency, energy. The SI unit of energy is named the joule for exactly this discovery.

Heat and work are not properties a system has — they are energy in transit. It is wrong to say "this gas contains 300 J of heat." A gas contains internal energy U (a state function); heat Q and work W only exist while energy is crossing the boundary. Take the gas from state A to state B by two different paths and you can find totally different Q and W for each — but \Delta U = Q - W comes out the same every time, because U only cares about the endpoints. The other classic slip is the sign: with \Delta U = Q - W, W is the work done by the system. If you accidentally use "work done on the system," flip the sign or you will double your errors.