The First Law of Thermodynamics

Push the plunger on a bicycle pump and hold your thumb over the outlet. The air inside gets warmer. No flame touched it. Where did that energy come from? Your hand did work on the gas. The First Law of Thermodynamics tells you exactly how that work turns into stored internal energy. This law is the accountant of chemistry. Every reaction, every phase change, every biological process obeys one rule. Energy is never created or destroyed. It is only moved between a system and its surroundings as heat or work. Without this bookkeeping, calorimetry, thermochemistry, and enthalpy would have no foundation. This article builds the law from a definition of internal energy as a state function. You will see the equation ΔU=q+w\Delta U = q + w derived from that idea. Then you will see it applied to two fully numeric examples. Finally you will see the traps that catch nearly every beginner, especially sign conventions.

Key takeaways
  • The First Law states ΔU=q+w\Delta U = q + w: internal energy changes only through heat and work exchanged with the surroundings.
  • Internal energy UU is a state function — its change depends only on initial and final states, never on the path taken.
  • Heat qq and work ww are path functions; their individual values depend on how a process is carried out.
  • The law is a statement of energy conservation applied to thermodynamic systems, isolated or otherwise.
  • For an isolated system, q=0q = 0 and w=0w = 0, so ΔU=0\Delta U = 0 exactly.
  • Key idea: even though heat and work separately depend on the path between two states, their sum always equals the same fixed change in internal energy.
The core insight

Internal energy is a state function, so although heat and work individually depend on the path taken between two states, their sum q+wq + w is path-independent and equals ΔU\Delta U — this single fact is what makes thermodynamic bookkeeping possible.

The physical picture

Imagine a gas sealed in a cylinder fitted with a frictionless, movable piston. The gas has some total internal energy UU: the sum of the kinetic energies of its molecules tumbling and colliding, plus the potential energies stored in their intermolecular interactions and bond vibrations. You cannot measure UU directly — there is no "energy-meter" — but you can measure how it changes when the system interacts with its surroundings. There are exactly two channels for that exchange. Heat, qq, is energy transferred because of a temperature difference — molecules on the hot side jostle molecules on the cold side, transferring kinetic energy through collisions. Work, ww, is energy transferred through organized, directional motion — a piston pushing outward against an opposing pressure, a shaft turning, an electric charge moving through a potential difference. The First Law says these two channels account for all of the change in UU:

ΔU=q+w\Delta U = q + w

The crucial subtlety is that qq and ww are not properties of the system — they are properties of the process. Compress a gas quickly and irreversibly, or slowly and reversibly, between the same two states, and qq and ww will differ between the two paths. Yet ΔU\Delta U, the change in internal energy, comes out identical every time. That invariance is the operational meaning of "state function," and it is the entire reason the First Law is useful rather than merely descriptive.

Figure
Two different paths between the same initial and final states give different q and w, but the same ΔU
State A (U₁ = 500 J) State B (U₂ = 620 J) Path 1: q = 200 J, w = -80 J Path 2: q = 30 J, w = 90 J Both paths: ΔU = U₂ - U₁ = 120 J

Notice in the figure that Path 1 gives q+w=200+(−80)=120q + w = 200 + (-80) = 120 J, and Path 2 gives q+w=30+90=120q + w = 30 + 90 = 120 J. Different splits, same total — because UU only cares about endpoints.

Figure
Energy accounting for the system: heat and work are the only two doors in or out
System, U q in (heat, +) w out (system does work, -) w in (work done on system, +) ΔU = q + w (IUPAC convention)

The core relations

ΔU=q+w\Delta U = q + w

where ΔU\Delta U is the change in internal energy, qq is heat absorbed by the system (positive when entering), and ww is work done on the system (positive when energy is added this way; this is the IUPAC sign convention used throughout physical chemistry).

dU=δq+δwdU = \delta q + \delta w

where the dd denotes an exact differential (path-independent) and the δ\delta denotes inexact differentials (path-dependent quantities that only become path-independent once summed).

ΔUisolated=0\Delta U_{\text{isolated}} = 0

where an isolated system exchanges neither heat nor work with its surroundings, so its internal energy is strictly constant.

∮dU=0\oint dU = 0

where the internal energy returns exactly to its starting value after any cyclic process — the defining test of a state function.

Derivation AWhy ΔU = q + w must hold

Goal. Show that defining UU as a state function, combined with conservation of energy, forces the relation ΔU=q+w\Delta U = q + w for any process.

Step 1. Start from conservation of energy. Total energy in the universe is conserved. Partition the universe into "system" plus "surroundings." Any energy that leaves the surroundings must enter the system, and vice versa. Classify all such transfers into exactly two categories: heat (transfer driven by a temperature gradient) and work (transfer driven by an organized force acting through a displacement, or equivalent generalized forces such as electrical or magnetic).

Step 2. Define internal energy operationally. Let UU be the total energy contained within the system — translational, rotational, vibrational, and potential energy of its particles — excluding overall bulk kinetic and potential energy of the system as a whole (those belong to mechanics, not thermodynamics). By hypothesis, UU is a well-defined property of the system's state: fix temperature, pressure, composition, and phase, and UU is fixed.

Step 3. Apply energy conservation to an infinitesimal step. During an infinitesimal change, the system receives infinitesimal heat δq\delta q and infinitesimal work δw\delta w from the surroundings. Since these are the only two channels (Step 1), and since energy conservation forbids energy from appearing or vanishing,

dU=δq+δwdU = \delta q + \delta w

Step 4. Integrate along an arbitrary path. For a finite process taking the system from state 1 to state 2 along any path,

ΔU=∫12dU=∫pathδq+∫pathδw=q+w\Delta U = \int_1^2 dU = \int_{\text{path}} \delta q + \int_{\text{path}} \delta w = q + w

The left-hand integral evaluates to U2−U1U_2 - U_1 regardless of path, because UU is a state function (Step 2). The right-hand integrals, qq and ww individually, generally do depend on the path chosen — different routes redistribute how much energy travels as heat versus work.

Step 5. Confirm consistency via a thought experiment. Suppose two different paths between the same states 1 and 2 gave different values of ΔU\Delta U. Then you could construct a cycle: go from 1 to 2 via path A, then back from 2 to 1 via path B. If ΔUA≠ΔUB\Delta U_A \neq \Delta U_B, the cycle would produce a net change in UU despite returning the system to its original state — meaning you could extract unlimited energy by cycling forever. This contradicts both the observed constancy of state properties and energy conservation. Hence ΔU\Delta U must be identical for every path connecting the same two states, cementing UU as a genuine state function.

Step 6. Assemble the boxed result.

ΔU=q+w\boxed{\Delta U = q + w}

valid for any process connecting two equilibrium states, with qq and ww individually path-dependent but their sum path-independent.

Worked examples

Example 1 — Foundational: electrical heating of a rigid container. A rigid, insulated metal box contains 2.00 mol of an ideal monatomic gas. An electrical heater inside the box does 350 J of electrical work on the gas (stirring/resistive heating counts as work done on the system, since it is organized electrical energy, not a temperature-driven transfer). The box is rigid, so the gas cannot expand or contract — no pressure–volume work is exchanged with the surroundings. The box is perfectly insulated, so no heat escapes. Step 1: identify q and w. Rigid walls mean the volume cannot change, so wexpansion=0w_{\text{expansion}} = 0. The only work is the 350 J of electrical work done on the gas, so w=+350w = +350 J (IUPAC convention: positive when done on the system). Insulated walls mean q=0q = 0. Step 2: apply the First Law.

ΔU=q+w=0+350 J=350 J\Delta U = q + w = 0 + 350\ \text{J} = 350\ \text{J}

Step 3: sanity check via temperature rise. For a monatomic ideal gas, U=32nRTU = \tfrac{3}{2}nRT, so

ΔU=32nR ΔT\Delta U = \tfrac{3}{2}nR\,\Delta T

Solve for ΔT\Delta T:

ΔT=2 ΔU3nR=2(350 J)3(2.00 mol)(8.314 J K−1mol−1)=14.03 K\Delta T = \frac{2\,\Delta U}{3nR} = \frac{2(350\ \text{J})}{3(2.00\ \text{mol})(8.314\ \text{J K}^{-1}\text{mol}^{-1})} = 14.03\ \text{K}

A 14 K rise from 350 J of stirring in 2 mol of gas is physically reasonable — this is exactly the mechanism (mechanical/electrical work converting to thermal energy) behind Joule's classic paddle-wheel experiments that first demonstrated the mechanical equivalent of heat.

Example 2 — Applied: gas expansion doing work while absorbing heat. A sample of gas in a cylinder absorbs 750 J of heat from a hot reservoir. As it absorbs this heat, it expands against a constant external pressure and in doing so performs 480 J of work on the surroundings (pushing the piston outward). Step 1: assign signs carefully. Heat flows into the system: q=+750q = +750 J. The system does work on the surroundings, so energy leaves the system through the work channel: w=−480w = -480 J (IUPAC convention — work done by the system is negative ww). Step 2: apply the First Law.

ΔU=q+w=750 J+(−480 J)=270 J\Delta U = q + w = 750\ \text{J} + (-480\ \text{J}) = 270\ \text{J}

Step 3: interpret physically. Even though the gas gave up 480 J to push the piston, it absorbed more than enough heat (750 J) to cover that expenditure and still increase its internal energy by 270 J. If instead the gas had absorbed only 400 J of heat while doing 480 J of work, ΔU\Delta U would be 400−480=−80400 - 480 = -80 J — the gas would cool internally despite absorbing heat, because it "spent" more energy pushing the piston than it "earned" from the reservoir. This illustrates why qq alone never tells you how UU changes; you must always close the energy balance with ww. Step 4: extension check (path independence). If this same net change, ΔU=270\Delta U = 270 J, were instead achieved by a rapid irreversible expansion doing only 300 J of work, the First Law demands q=ΔU−w=270−(−300)=570q = \Delta U - w = 270 - (-300) = 570 J of heat absorbed — a different heat and work pair, same ΔU\Delta U, exactly as path independence requires.

Limiting cases & common traps

SituationConsequence for the First Law
Isolated system (no heat or work exchange)q=0q = 0, w=0w = 0, so ΔU=0\Delta U = 0 exactly
Adiabatic process (thermally insulated only)q=0q = 0, so ΔU=w\Delta U = w
Rigid, non-stirred containerw=0w = 0 (no expansion work), so ΔU=q\Delta U = q
Cyclic process (returns to start)ΔU=0\Delta U = 0 over the full cycle, even though q≠0q \neq 0 and w≠0w \neq 0 individually
Ideal gas, constant temperatureΔU=0\Delta U = 0 since UU depends only on TT for an ideal gas

The chemist behind it

The First Law's chemical form owes an enormous debt to Germain Hess, whose 1840 law of constant heat summation showed that the heat of an overall chemical reaction is the same regardless of the number of intermediate steps — an early, purely empirical chemical statement of path-independence for energy changes in reactions at constant pressure. Hess established this before the general First Law was even formulated by Joule, Helmholtz, and Clausius in the 1840s–1850s, making his thermochemical measurements a striking chemical anticipation of a universal physical law.

Origins · 1 minGermain Henri Hess and how this was discovered
GH
Germain Henri Hess
1802-1850 · Swiss-Russian chemist whose 1840 law of constant heat summation was the first clear experimental demonstration that reaction enthalpy is path-independent, foreshadowing the First Law's state-function structure

Ask the tutor: How does defining enthalpy as H=U+PVH = U + PV simplify heat measurements at constant pressure?

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

A state function depends only on the current equilibrium state of a system — its temperature, pressure, volume, and composition — not on how the system got there. Internal energy fits this: two samples of gas at the same TT, PP, and composition have the same UU, regardless of history. Heat and work, by contrast, are measures of energy in transit during a specific process. The same overall change in UU can be achieved with many different combinations of qq and ww, so neither one alone is fixed by the endpoints — only their sum is.

Does the First Law forbid perpetual motion machines?

Yes, specifically machines of the "first kind," which would produce more energy output than they consume with no other source. Because ΔU=q+w\Delta U = q + w for any process, and ΔU=0\Delta U = 0 over any complete cycle, a device cannot output more work than the heat and work put into it over a full cycle. Any claimed device that violates this is, by definition, creating energy from nothing, which the First Law strictly forbids regardless of the mechanism proposed.

How does the First Law connect to enthalpy, which I have not covered yet?

Enthalpy is defined as H=U+PVH = U + PV, a bookkeeping convenience for processes at constant pressure, where expansion work is automatically absorbed into the definition. It is built directly on the First Law: because UU is a state function and PP, VV are state functions, HH is guaranteed to be a state function too. You will meet this formally in the next topic, but the underlying justification is exactly the state-function argument developed here.

Is w always negative when a gas expands?

Using the IUPAC convention adopted here, yes: when a system does work on its surroundings, such as gas pushing back a piston during expansion, ww is negative because energy leaves the system through that channel. Some older texts use the opposite convention, ΔU=q−w\Delta U = q - w, where ww is defined as work done by the system and is positive for expansion. Always check which convention a textbook or problem uses before assigning signs, since this is the single most common source of sign errors.

Can ΔU be zero even if q and w are both nonzero?

Yes, and this happens constantly. Any cyclic process returns the system to its starting state, so ΔU=0\Delta U = 0 over the full cycle, even though heat was absorbed and work was done at various stages along the way. Isothermal expansion of an ideal gas is another example: UU depends only on TT for an ideal gas, so if TT is constant, ΔU=0\Delta U = 0 even though the gas absorbs heat and does work simultaneously, with q=−wq = -w exactly.

Before this

Where this leads