The First Law of Thermodynamics
Pump up a bike tyre with a hand pump and the barrel gets hot — noticeably, sometimes almost too
hot to hold. You didn't light anything; you just squeezed some air. So where did the warmth come
from? You pushed, and that push went straight into the gas, speeding up its particles.
You did work on the gas, and it stored that work as extra
internal energy — which is exactly
what "hotter" means.
Heating is not the only way to raise a gas's internal energy: doing mechanical work on it does the
job just as well. The first law of thermodynamics is the bookkeeping rule that
ties the two together. It is nothing more than
conservation of energy,
written out carefully for a gas — but writing it carefully, and getting every sign right, is the
whole art of this topic.
Two ways to change a gas's internal energy
Trap some gas in a cylinder under a piston and there are exactly two ways to
change the energy locked in its particles:
-
Heat it. Put a flame under the cylinder and energy flows in through the walls
by heating. We call the heat supplied Q.
-
Do work on it. Push the piston in and you compress the gas — a force moving
through a distance, so mechanical work is done. We call the work done on the gas
W.
Every joule that goes in this way has to end up somewhere, and for a sealed lump of gas
the only place it can go is the internal store. So the change in internal energy is simply the sum
of the two inputs:
\Delta U = Q + W.
That is the first law of thermodynamics. Read it out loud: the increase in a
system's internal energy equals the heat supplied to it plus the work done on
it. Nothing is created and nothing vanishes — energy is only shuffled between the surroundings and
the gas's particles.
For a closed system (a fixed quantity of gas), the change in internal energy is the heat supplied
to the system plus the work done on the system:
- \Delta U = Q + W.
- Q is the heat energy supplied to the system —
positive when heat flows in, negative when heat flows out.
- W is the work done on the system — positive
when the gas is compressed, negative when the gas expands and pushes back.
It is conservation of energy applied to a gas: internal energy can only change by heating or by
working.
The sign convention — pin it down now
The single hardest thing about the first law is not the physics but the bookkeeping of
signs. We will use one convention throughout, and it is worth branding onto your memory:
- Q > 0: heat flows into the system (you heat it).
- W > 0: work is done on the system (you compress it).
With this "energy in is positive" convention, both terms on the right of
\Delta U = Q + W add energy to the gas when they are positive — tidy and
symmetric. If instead heat leaves the gas, Q is negative; if the gas
expands and does work on its surroundings, W is negative. Whenever you
write a number down, first ask: is energy going into the gas or out of it? In means plus,
out means minus.
Work at constant pressure: W = -p\,\Delta V
How much work does compressing a gas actually do? Take a gas held at constant pressure
p in a cylinder of cross-sectional area A,
and push the piston in by a small distance d.
Step 1 — the force on the piston. Pressure is force per unit area, so to hold the
gas at pressure p the piston pushes with force
F = pA.
Step 2 — the work done pushing it in. Work is force times distance:
W = Fd = pA\,d.
Step 3 — turn distance into a volume change. Moving the piston in by
d shrinks the gas's volume, and the amount it shrinks by is
A\,d. Compression reduces the volume, so
\Delta V = -A\,d, i.e. A\,d = -\Delta V.
Substituting,
W = p\,(A\,d) = -p\,\Delta V.
So the work done on a gas at constant pressure is
W = -p\,\Delta V. Check the signs against the convention: compress it
(\Delta V < 0) and W = -p\,\Delta V > 0 —
positive work done on the gas, exactly as it should be. Let it expand
(\Delta V > 0) and W < 0 — the gas is doing
work on the surroundings instead, draining its own internal energy.
Putting the two results together gives the working form of the first law for a gas at constant
pressure:
\Delta U = Q - p\,\Delta V.
Four special processes
The power of \Delta U = Q + W is that in many important situations one
of the three quantities is zero, and the law collapses to something simple. Four
cases are worth knowing cold.
-
Constant volume (isochoric). The gas can't push a piston, so no work is done:
W = 0. The law becomes \Delta U = Q —
all the heat you supply goes straight into internal energy, and the temperature rises.
-
Constant pressure (isobaric). The piston is free to move, so the gas does work
as it expands: W = -p\,\Delta V and
\Delta U = Q - p\,\Delta V. Some of the heat raises the internal
energy; the rest is spent pushing the piston out.
-
Isothermal (constant temperature). For an ideal gas the internal energy depends
only on temperature, so if T is held fixed then
\Delta U = 0. The law gives 0 = Q + W, i.e.
Q = -W: every joule of work done on the gas is immediately shed as
heat, and vice versa.
-
Adiabatic (no heat flow). The gas is insulated, or the change is so fast that
no heat has time to move: Q = 0. Then
\Delta U = W — the internal energy changes purely through work.
Compress a gas adiabatically and all your work heats it up; let it expand adiabatically
and it cools itself down.
That last case is the bike pump. The squeeze is quick, so hardly any heat escapes through the
barrel in time — the change is roughly adiabatic, Q \approx 0, and your
work W lands almost entirely in the gas's internal energy:
\Delta U = W > 0. Hotter gas, warm barrel.
Worked examples
Example 1 — heat in, work in. A gas is supplied
500\text{ J} of heat while a piston compresses it, doing
200\text{ J} of work on the gas. Find the change in internal energy.
Both inputs add energy, so both are positive:
Q = +500\text{ J}, W = +200\text{ J}.
\Delta U = Q + W = 500 + 200 = +700\text{ J}.
The internal energy rises by 700\text{ J}, so the gas gets hotter.
Example 2 — heat in, gas expands. A gas absorbs
800\text{ J} of heat and, at a constant pressure of
2.0\times10^{5}\text{ Pa}, expands by
\Delta V = +2.0\times10^{-3}\text{ m}^3. Find
\Delta U.
The gas expands, so it does work on the surroundings — the work done on it is negative:
W = -p\,\Delta V = -(2.0\times10^{5})(2.0\times10^{-3}) = -400\text{ J}.
\Delta U = Q + W = 800 + (-400) = +400\text{ J}.
Only half the heat stayed in the gas as internal energy; the other
400\text{ J} went into pushing the piston out.
Example 3 — adiabatic compression. A gas is compressed rapidly in an insulated
cylinder, the piston doing 300\text{ J} of work on it. No heat can
escape. What happens to the internal energy?
Insulated and fast, so Q = 0:
\Delta U = Q + W = 0 + 300 = +300\text{ J}.
Every joule of work becomes internal energy — the gas heats up sharply, with no flame in sight.
This is precisely how a diesel engine ignites its fuel.
Example 4 — isothermal expansion. A gas expands slowly at constant temperature,
doing 600\text{ J} of work on the surroundings. How much heat flows,
and in which direction?
Constant temperature means \Delta U = 0. The gas does
600\text{ J} of work on the surroundings, so the work done on
it is W = -600\text{ J}. Then
0 = Q + W \;\Rightarrow\; Q = -W = +600\text{ J}.
600\text{ J} of heat flows into the gas — exactly enough to
replace the energy it spent doing work, keeping its temperature (and internal energy) unchanged.
See the first law happen
Here is a cylinder of gas. Slide Q to pour heat in (or draw it out), and slide
W to do work on the gas (push the piston in) or let it expand. Watch three things:
the heat arrow at the base, the work arrow on the piston, and the
ΔU bar on the right. The bar is just Q + W — whenever it
rises above the line the gas warms, whenever it drops below the gas cools. Set
Q = 0 for an adiabatic change, or trim Q and
W so they cancel for an isothermal one, and see the temperature hold
steady.
Three sign-and-heat traps that catch nearly every exam candidate:
-
Get the sign convention straight and stick to it. We use
\Delta U = Q + W with Q the heat
into the system and W the work done on the system —
so compression gives W > 0. Some books write
\Delta U = Q - W, where their W is the work
done by the gas. Both are correct; they are the same law with the same physics. What is
fatal is mixing them mid-question. Decide "energy in is positive" and never waver.
-
Adiabatic does not mean "no temperature change". It means no heat flow,
Q = 0 — and yet the temperature very much changes, because
\Delta U = W. Compress a gas quickly and it heats up even though not a
single joule of heat entered it; the warming came entirely from work. Confusing "no heat" with
"no temperature change" is the classic slip.
-
An expanding gas loses internal energy if left alone. When a gas expands it does
work on its surroundings, so W < 0. With no heat supplied
(Q = 0) that means \Delta U < 0: the gas
cools. This is why gas rushing out of an aerosol can or a CO_2
cartridge comes out cold, and why rising air in the atmosphere chills as it expands.
A petrol engine needs a spark to ignite its fuel. A diesel engine has no spark plug at
all — so what sets the fuel alight? The answer is the first law. On the compression stroke the
piston slams into the air in the cylinder so fast that essentially no heat escapes: the change is
adiabatic, Q \approx 0. The piston does a large amount
of work W on the air, and since
\Delta U = W, all of it becomes internal energy. The air is squeezed to
a small fraction of its volume and its temperature rockets to around
500\,^\circ\text{C} — hotter than the ignition point of diesel. Fuel
sprayed into that superheated air bursts into flame on contact, no spark required.
It is the exact same physics as the warm bike pump, just turned up to eleven: work in, no heat out,
internal energy up, temperature up. Rudolf Diesel patented the idea in the 1890s, and every diesel
lorry, ship and generator on Earth still runs on that one line of thermodynamics.