First law of thermodynamics

Push a bicycle pump hard and shut, then feel it warm up in your hand, even though no fire touched it. Where did that heat come from? From the work your arm did on the trapped air, and the first law of thermodynamics is simply the accounting rule that tracks every joule of energy through episodes like this. It says heat, work, and internal energy are locked together by nothing more exotic than conservation of energy: whatever heat you pour into a system either raises its internal energy, gets spent doing work, or splits between the two, with no energy created or lost. This article builds that one equation, Q=ΔU+WQ=\Delta U+W, from the idea of internal energy as a state property, works a full numeric example, and shows how three special cases -- constant volume, constant temperature, and no heat exchange -- fall straight out of it by setting one term to zero.

The core insight

The first law of thermodynamics, Q=ΔU+WQ=\Delta U+W, is energy conservation for heat and work: any heat supplied to a system either raises its internal energy or is spent doing work, and setting one term to zero gives the isochoric, isothermal, and adiabatic special cases.

The core idea

Internal energy is a state property. The internal energy UU of a gas is the total kinetic and potential energy stored in the random motion of its molecules -- for an ideal gas, purely kinetic energy tied to temperature. What makes UU special is that it is a state property: its value depends only on the current state of the system (its temperature, for an ideal gas), never on the road taken to get there. Heat QQ and work WW do not share this privilege. They are path-dependent quantities -- the amount of heat you must supply, or work you must do, to move a gas between the same two states can differ completely depending on the process used.

The law itself. The first law is a bookkeeping statement of energy conservation:

Q=ΔU+WQ = \Delta U + W

where: QQ is the heat supplied to the system, ΔU\Delta U is the resulting change in internal energy, and WW is the work done by the system on its surroundings.

Sign convention. This syllabus fixes the signs so that: Q>0Q>0 when heat flows into the system and Q<0Q<0 when it flows out; ΔU>0\Delta U>0 when internal energy rises and ΔU<0\Delta U<0 when it falls; W>0W>0 when the system does work on its surroundings (a gas expanding, pushing a piston out) and W<0W<0 when work is done on the system (compression). Getting this convention backwards is the single most common source of a wrong sign in the final answer, so it is worth restating before touching any numbers: heat in is positive, work done by the gas is positive.

Work as area under a pp-VV curve. For an ideal gas, a small volume change dVdV at pressure pp does work dW=p dVdW=p\,dV on the surroundings, so over a finite process from volume V1V_1 to V2V_2,

W=∫V1V2p dVW = \int_{V_1}^{V_2} p\,dV

where: pp is the gas pressure and VV the volume. Geometrically, this integral is nothing more than the area swept out under the process curve on a pp-VV diagram -- a picture worth keeping in mind even before any calculus is done, since many exam questions simply ask you to read WW off a graph as an area.

Figure
A p V diagram showing a gas expanding from V1 to V2 at pressure p, with the work done by the gas shaded as the area under the curve between the two volumes
Work done by a gas equals the area under the p to V curve volume V pressure p V1 V2 W = area under curve gas expands: pushes piston, does positive work

Special cases. Each of the three named processes is just the first law with one term forced to zero.

  • Isochoric (constant volume): dV=0dV=0 so W=0W=0, leaving Q=ΔUQ=\Delta U -- every joule of heat supplied goes straight into raising internal energy and temperature, none is spent on work.
  • Adiabatic (no heat exchange): Q=0Q=0, so ΔU=−W\Delta U=-W -- any work the gas does on its surroundings is paid for entirely out of its own internal energy, which is why a gas cools when it expands adiabatically.
  • Isothermal (constant temperature): for an ideal gas UU depends only on TT, so constant TT forces ΔU=0\Delta U=0 and Q=WQ=W -- every joule of heat supplied is converted, in full, into work done by the gas.

The equation you should be able to derive on demand

Derivation AGetting Q equals Delta U plus W from energy conservation and the meaning of work

The goal is to show, in one short chain of reasoning grounded in nothing more than the conservation of energy and the physical definition of work as force times displacement, exactly why heat supplied to a gas must split between raising its internal energy and doing mechanical work on the surroundings -- and why no third destination for that energy is possible for a closed system.

Step 1. Start from the conservation of energy for a closed system (fixed amount of gas, no matter crossing the boundary). Any energy that enters the system as heat, QQ, must end up somewhere: it either stays inside the system, changing its internal store of molecular kinetic and potential energy, or it leaves the system again in some other form. For a gas doing mechanical work on a piston, that "other form" is precisely the work WW done by the gas on its surroundings.

Step 2. Write this bookkeeping as an equation. Energy in equals energy retained plus energy given out: Q=ΔU+WQ = \Delta U + W. Here ΔU=Ufinal−Uinitial\Delta U = U_{\text{final}} - U_{\text{initial}} is how much the internal energy store has grown, and WW is how much energy has left the system as mechanical work performed on the surroundings.

Step 3. Confirm that no other energy channel exists for this system. The gas is not gaining or losing molecules, is not radiating away energy by some unaccounted mechanism, and its kinetic energy as a bulk object is taken as unchanging (the container is not itself flying across the room). With heat and work as the only two ways energy crosses the system boundary, and internal energy as the only reservoir inside it, Q=ΔU+WQ=\Delta U+W is forced -- it is simply energy conservation with the boundary drawn around the gas.

Step 4. Note the deeper reason UU appears alone on one side while QQ and WW appear as flows: UU is a state property, fixed once the state (temperature, for an ideal gas) is fixed, so ΔU\Delta U depends only on the start and end states. QQ and WW individually depend on the path between those states, but their combination Q−WQ-W always equals the same ΔU\Delta U no matter which path was taken -- this path-independence of the combination is exactly what makes the first law a genuine law of physics rather than a definition.

Worked example

An ideal gas absorbs 500 J of heat and does 200 J of work on its surroundings while expanding. Find the change in internal energy of the gas.

Step 1. Assign signs using the convention. Heat is added to the gas, so Q=+500 JQ=+500\ \text{J}. The gas expands and pushes back its surroundings, so it does positive work: W=+200 JW=+200\ \text{J}.

Step 2. Apply the first law, solved for ΔU\Delta U: ΔU=Q−W=500−200=300 J\Delta U = Q - W = 500 - 200 = 300\ \text{J}.

Step 3. Interpret the result. The internal energy of the gas rises by 300 J. Even though the gas gave up 200 J as work on its surroundings, it received more heat (500 J) than it spent, so the leftover 300 J stays behind and raises its temperature.

Competitive stretch

A gas is compressed isothermally, and 150 J of work is done on the gas by an external agent. How much heat does the gas exchange with its surroundings, and in which direction?

Step 1. Isothermal means constant temperature, and for an ideal gas that forces ΔU=0\Delta U = 0.

Step 2. Work done on the gas is work done by the gas with a flipped sign, so W=−150 JW = -150\ \text{J}.

Step 3. Apply the first law: Q=ΔU+W=0+(−150)=−150 JQ = \Delta U + W = 0 + (-150) = -150\ \text{J}. A negative QQ means the gas releases 150 J of heat to its surroundings -- exactly the energy that compression tried to add as internal energy, but which the constant-temperature condition forces the gas to give away as heat instead.

Common traps

  • Flipping the sign convention silently: some textbooks define WW as work done on the gas, turning the law into Q=ΔU−WQ=\Delta U-W -- this syllabus uses WW as work done by the gas, so check the convention before plugging in numbers.
  • Treating QQ or WW as state properties like UU -- only UU (and TT, pp, VV for an ideal gas) depend solely on the state; heat and work depend on the path taken.
  • Assuming "isothermal implies ΔU=0\Delta U=0" is universal -- it is specifically a consequence of an ideal gas, whose internal energy depends only on temperature.
  • Confusing "adiabatic" with "no temperature change" -- adiabatic only means Q=0Q=0; temperature still changes as work is done at the expense of, or adding to, internal energy.

Ask the tutor: if the sign convention for QQ, WW, and ΔU\Delta U keeps tripping you up, or you want extra practice telling apart the isochoric, adiabatic, and isothermal cases, ask the AI tutor for a focused drill.

Why is internal energy called a state property but heat and work are not?

Internal energy depends only on the current condition of the gas -- for an ideal gas, its temperature -- so two processes that start and end at the same states always show the identical ΔU\Delta U, regardless of the route taken. Heat and work are different: you can move a gas between the same two states along a fast path or a slow path, a straight line on a pp-VV diagram or a curved one, and the heat supplied and work done will generally differ between those routes, even though ΔU\Delta U stays fixed and equal to Q−WQ-W in every case.

Does the first law apply to processes that are not ideal gases, like liquids or solids?

Yes -- the first law itself, Q=ΔU+WQ=\Delta U+W, is a completely general statement of energy conservation and holds for any closed system, not just ideal gases. What is specific to ideal gases is the extra fact that UU depends only on temperature, which is what makes "isothermal implies ΔU=0\Delta U=0" true. For a real gas, liquid, or solid, internal energy can depend on volume or pressure too, so that particular shortcut no longer applies even though the underlying law still does.

If work done by the gas is positive, why does the gas end up losing energy when it does work?

Because doing positive work means the gas is pushing outward and transferring energy to its surroundings -- exactly like spending money reduces your bank balance. In the equation Q=ΔU+WQ=\Delta U+W, a positive WW subtracts from what is available to raise ΔU\Delta U for a given QQ: ΔU=Q−W\Delta U=Q-W. If the heat supplied is smaller than the work done, ΔU\Delta U turns negative and the gas's internal energy (and temperature, for an ideal gas) actually falls, even while heat is flowing in.

Before this

Where this leads