The First Law of Thermodynamics

The first law of thermodynamics is one of the most reliable statements in all of science: energy is never created or destroyed, only moved around and changed in form. When applied to systems that exchange heat and do work, this principle becomes a precise accounting rule. Master it and you understand why engines need fuel, why a gas heats up when you compress it, and why a perpetual motion machine can never work.
Energy in, energy out
Imagine a gas trapped in a cylinder with a movable piston. You can change the energy stored inside that gas in exactly two ways: by adding or removing heat, and by doing work on it (or letting it do work on you). The first law says the change in the gas’s internal energy equals what you put in minus what comes out.
“Internal energy,” written U, is the total microscopic energy of all the molecules: their kinetic energy of motion plus the potential energy of their interactions. We rarely know U’s absolute value, but we can always track how it changes.
Here ΔU is the change in internal energy, Q is the heat added to the system, and W is the work done by the system on its surroundings. Add heat and ΔU rises; let the gas push the piston outward and do work, and ΔU falls.
Getting the signs right
Sign conventions trip up almost everyone, so fix them firmly:
- Q is positive when heat flows into the system, negative when it flows out.
- W is positive when the system does work on its surroundings (gas expands), negative when work is done on the system (gas is compressed).
Some textbooks write the law as ΔU = Q + W, defining W as work done on the system instead. Both are correct; just keep one convention throughout a problem. In this article W is always work done by the system, the convention common in engineering and heat-engine analysis.
The first law is not a new force or substance. It is a conservation principle: internal energy is a property of the system’s state, while heat and work are merely two channels through which energy crosses the boundary.
Why state matters: paths versus properties
Internal energy is a state function. That means ΔU depends only on the starting and ending conditions of the gas, never on the route taken between them. Heat and work, by contrast, are path functions: the same change in state can be reached with different combinations of Q and W.
You can warm a gas from state A to state B by piling on heat while letting it expand, or by compressing it hard so friction-free work raises its temperature with little heat. The Q and W differ, but Q − W lands on the same ΔU every time. This is why the first law is so powerful for engineering: it constrains every possible process, no matter how complicated the path.
Pressure-volume work
For a gas expanding against external pressure, the work has a concrete form. When a gas at pressure p pushes a piston so the volume increases by a small amount ΔV, the work done is:
If the pressure changes during the process, you sum many small p·ΔV slices, which is the area under the curve on a pressure-volume diagram. Two special cases are worth memorising:
- Constant volume (isochoric): ΔV = 0, so W = 0 and ΔU = Q. All the heat becomes internal energy.
- Insulated (adiabatic): Q = 0, so ΔU = −W. Compress an insulated gas and its temperature rises purely from the work you do, which is why a bicycle pump warms up.
Why perpetual motion is impossible
A “first-kind” perpetual motion machine would produce work endlessly with no energy input. The first law forbids it outright: if W comes out and Q is zero, then ΔU must fall by exactly that amount, and a finite system runs out of internal energy. To keep delivering work, you must keep supplying heat or some other energy. Every real engine obeys this, which connects directly to the broader study of conservation laws and to the idea of energy itself.
Frequently asked questions
Is heat the same thing as temperature?
No. Temperature measures the average kinetic energy of molecules, while heat is energy in transit because of a temperature difference. A bathtub of warm water holds more heat energy than a spark, even though the spark is far hotter.
Does the first law say energy can never run out?
Energy is conserved in total, but useful energy degrades. The first law tracks quantity; the second law of thermodynamics tracks quality, explaining why energy spreads into less useful forms over time.
What is internal energy made of?
For an ideal monatomic gas it is purely the translational kinetic energy of the atoms, proportional to temperature. Real substances add rotational, vibrational, and intermolecular potential energy, but for any system ΔU is what the first law tracks.