Work, Heat, and Inexact Differentials
Stand at a trailhead and look up at a summit. Your gain in altitude is fixed the moment you name the two points — it does not care whether you took the steep direct scramble or the gentle switchbacks. But the distance you walk and the calories you burn depend entirely on the route. Thermodynamics runs on exactly this distinction, and it is sharper than it first appears. Internal energy , entropy , volume, pressure, temperature — these are state functions, with a definite value at every equilibrium state, depending only on where the system is. Work and heat are process quantities: they describe transfers that happen during a change and depend on the whole path connecting start to finish. The mathematical name for this difference is exact versus inexact differentials. The change of a state function around any closed loop is zero, — the integrability condition that makes a genuine function of the state variables. Work and heat enjoy no such closure. The work in expanding a gas from to is , which visibly depends on how the pressure varies along the way. A system can be driven around a closed cycle back to its exact starting state () while having done net work and absorbed net heat — that is precisely what a heat engine does, and no state function could ever manage it. We flag the difference with notation: for the exact differential of a state function, or for the inexact differential of a process quantity. The is a warning label — there is no function of the state whose differential is , so "" is meaningless. A body does not contain heat or work; it exchanges them. The startling content of the first law is that the specific combination is exact even though neither term is: . The second law goes one better — for reversible processes the inexact becomes exact once divided by the absolute temperature, so is an integrating factor that manufactures the entropy . These two repairs turn the ragged one-forms of heat and work into the exact differentials that organize all of equilibrium thermodynamics.
- State functions (, , , , ) depend only on the current equilibrium state; their infinitesimals are exact differentials with .
- Work and heat are process quantities: they depend on the entire path in state space, so are inexact and need not vanish.
- The exactness (integrability) test: is exact iff for all ; fails it.
- The first law combines two inexact differentials into one exact differential — the path-dependent parts cancel.
- An integrating factor can rescue an inexact differential: is exact, with the integrating factor — this defines entropy.
- Sign convention here: with (work done on the system); some texts write with (work done by the system).
- Key idea: The infinitesimals of work and heat are inexact differentials — line elements with no parent state function — so their integrals are path-dependent; the first law makes the combination the exact , and the second law supplies as an integrating factor turning into the exact .
Where this lives today
The exact/inexact distinction is not a nineteenth-century curiosity — it is the daily grammar of energy engineering. Every cycle diagram in a thermodynamics course (Otto, Diesel, Brayton, Rankine) exploits the fact that is a nonzero enclosed area while ; the whole enterprise of extracting work from heat depends on heat and work being process quantities. The idea of an integrating factor reaches far beyond thermodynamics. Carathéodory's 1909 axiomatic reformulation of the second law is built entirely on when a one-form (the heat) admits an integrating factor, connecting thermodynamics to the differential geometry of Pfaffian systems. And in modern stochastic thermodynamics, heat and work are tracked as fluctuating, path-dependent quantities along individual trajectories of tiny systems — a colloidal bead in an optical trap, a single biomolecule pulled by force — where the Jarzynski and Crooks relations turn statements about these inexact differentials into equalities that hold arbitrarily far from equilibrium. The humble has become a research tool.
The physical picture
Return to the mountain. Altitude is a state function — the elevation gain between trailhead and summit is fixed, and a round trip returns you to the same height. Distance walked and calories burned are process quantities — they depend on the route entirely. Internal energy is the altitude; work and heat are the distance and the calories. Two different hikers reaching the same summit can burn wildly different calories; two different thermodynamic paths between the same states can involve wildly different heat and work. A differential such as tells you only the work for a tiny step at the current pressure. To get the total you must integrate along a specified path — and different paths between the same endpoints give different totals because takes different values along the way. There is simply no "work content" to subtract. The figure makes the path-dependence unmissable: the work is the area under the curve, and two curves with the same endpoints enclose different areas.
The cancellation in is like two unreliable bookkeepers whose individual entries drift but whose net balance is always exactly right. Heat and work each depend on the path, yet their sum is rigidly fixed by the endpoints. Nature guarantees this even while forbidding you to define either quantity alone as a state function. An integrating factor is a magic divisor that repairs the defect. The reversible heat is path-dependent, but is a perfect differential whose loop integral vanishes — a parent function (the entropy) exists. That single mathematical fact is the gateway from heat engines to entropy, and the figure below shows the repair in action: the inexact form has curling "field lines," the divided form does not.
The core equations
The first thing to write is the work of a quasi-static pressure. Adopting the physics convention — is work done on the system — compressing the gas () does positive work on it, so we need a minus sign. (Many thermodynamics texts, and Fermi's classic, instead track work done by the system and write with ; identical physics, opposite sign bookkeeping — check which one a source uses.)
where: — inexact differential of work done on the system; — pressure at the moving boundary; — infinitesimal volume change. Compression () gives ; expansion gives (the gas spends its energy). The first law in differential form combines this with heat, and asserts the sum is exact.
where: — exact differential of internal energy; — inexact heat absorbed; — inexact work on the system. The physics is entirely in the claim that the sum is of a state function. The precise test for whether any one-form is exact is the equality of its mixed partials.
where: — coefficient functions of the state variables; the condition is Clairaut's theorem run backwards — a parent with exists precisely when the cross-derivatives agree. The cleanest operational distinction between state and process quantities is the cyclic integral.
where: — integral around a closed path in state space. Only the state function returns to its value; the process quantities generally do not — and their nonvanishing loop integrals are what an engine harvests. The total work for a finite process is a line integral over the chosen path.
where: — the specific route in space; the explicit -dependence is the mathematical face of path-dependence. Finally, the second law's gift: divide the reversible heat by the absolute temperature and it becomes exact.
where: — exact differential of entropy; — heat along a reversible path; — absolute thermodynamic temperature. The integrating factor is what makes entropy a state function at all.
This is the central technical fact of the chapter, and we prove it explicitly on an ideal gas so it carries a verifiable number rather than remaining a slogan. The reversible heat one-form fails the exactness test — its mixed partials disagree, so no "heat content" function exists. Dividing by the absolute temperature produces a one-form whose mixed partials do agree, so a parent function (the entropy) exists. The strategy: write in the independent variables using the first law and the ideal-gas law, apply the cross-derivative test to prove inexactness, then apply it again to to prove exactness, and finally exhibit the parent function.
Step 1. For a reversible ideal-gas step, combine (ideal gas, depends on only) with the first law and :
using .
Step 2. Apply the exactness test in variables . The coefficient of is (constant) and of is . Compute the cross-derivatives:
Why this proves inexactness: the two disagree, so no function has these as its partials — is inexact.
Step 3. Now divide the whole one-form by :
The new coefficients are and . Their cross-derivatives are
Why this matters: they now agree, so the divided form is exact — a parent function exists.
Step 4. Read off the parent by integrating each term:
Its differential reproduces exactly, so is the entropy — a state function born from an inexact differential by the integrating factor . Verified: the two cross-derivative computations ( for ; both zero for ) and the parent are checked symbolically with sympy in verify_aq-sm-work-heat-inexact-differentials.py. Cf. Pathria & Beale §1.1, Fermi Ch. 4.
Go deeper · Derivation B · 1 minPath dependence of work: an explicit two-path comparison
We compute the work for an ideal gas carried between the same two endpoints along two different paths and show the totals differ — a direct, numerical proof that is inexact and has no parent function. Let state A be and B be on the same isotherm, so with and . Path 1 is the reversible isotherm; path 2 first drops the pressure at fixed volume (no work) and then expands at the lower constant pressure. If the two works disagree, no function can exist.
Step 1. Path 1, isothermal. The pressure follows the hyperbola throughout, and the work done by the gas is
Step 2. Path 2, isochoric drop then isobaric expansion. Dropping at fixed does zero work; expanding at constant from to does
Step 3. Compare with a concrete case: mol at , . Then , while . Why they differ: the isotherm keeps the pressure high early in the expansion, enclosing more area under the – curve; the rectangular path does its expansion entirely at the lower pressure.
Step 4. Same endpoints, different work: . Because the line integral depends on the route, has no parent function — it is inexact. (Both paths share the same , since both endpoints lie on one isotherm and is a state function.) Verified: and recomputed in the verify script; the inequality confirms inexactness. Cf. Fermi Ch. 1, Reif §4.1.
Limiting cases
How the same endpoints give different and for an ideal gas going from to (work quoted as done by the gas; ):
| Case | Result | Meaning |
|---|---|---|
| Isothermal reversible | Constant , so ; all absorbed heat leaves as work. | |
| Free (Joule) expansion | Expansion into vacuum: no work, no heat, same — but differ completely from the isotherm. | |
| Adiabatic reversible | No heat; the temperature drops, so the endpoints differ in . | |
| Closed cycle | State function returns; heat and work need not — this is how engines run. |
Worked examples
Example 1 — Same endpoints, two paths, two different works (a real number).
Step 1. Take 1 mol of ideal gas at , expanding from to along (Path A) a reversible isotherm and (Path B) an isochoric pressure drop followed by isobaric expansion at the lower pressure.
Step 2. Path A work by the gas: . Compute , so .
Step 3. Path B work by the gas: only the isobaric leg contributes, . Using and , this is .
Step 4. The two differ by despite identical endpoints — a direct demonstration that work is path-dependent. Both share (endpoints on one isotherm), so by the first law each path's heat equals its work by: , — heat is path-dependent too.
Example 2 — Testing exactness of the heat one-form and finding the integrating factor.
Step 1. Write the reversible heat for an ideal gas in variables : . The coefficients are (of ) and (of ).
Step 2. Cross-derivatives: and . For 1 mol at (molar volume at STP), , which is nonzero — so is inexact.
Step 3. Divide by : . New cross-derivatives: and . They agree, so is exact.
Step 4. The parent function is . Its differential is exactly , so is the integrating factor and is the entropy. This is the mathematical birth certificate of entropy from an inexact differential.
Going further
References. Fermi, Thermodynamics, Ch. 1–2 · Pathria & Beale, Statistical Mechanics, 3rd ed., Ch. 1 · Kardar, Statistical Physics of Particles, Ch. 1 · Reif, Fundamentals of Statistical and Thermal Physics, Ch. 4 · Callen, Thermodynamics and an Introduction to Thermostatistics, Ch. 4 · Landau & Lifshitz, Statistical Physics Part 1, §§11–13
Provenance. All equations are standard textbook results. A verifier should recompute: (1) the exactness test for (fails) and for (holds), per Pathria & Beale §1.1 and Fermi Ch. 4; (2) the two-path works and for 1 mol at 300 K, ; (3) the parent function . The sign convention with (work on the system) is stated explicitly; the Fermi/IUPAC work-by-the-system alternative is noted. Constants: .
Builds on: Zeroth Law of Thermodynamics and Empirical Temperature · Partial derivatives and total differentials · Line integrals in state space Leads to: First Law of Thermodynamics and Internal Energy · Second Law of Thermodynamics and Entropy · Reversible and Irreversible Processes · Carnot Cycle and Thermodynamic Temperature · Maxwell Relations
Origins · 1 minHermann von Helmholtz and how this was discovered
Helmholtz placed the interconversion of work and heat on a firm footing in his 1847 memoir Über die Erhaltung der Kraft, arguing that mechanical work, heat, electricity and the rest are interconvertible forms of a single conserved quantity. That principle is exactly what makes internal energy a state function: even though and are separately inexact and path-dependent, their sum is exact. His later free-energy potential then quantified how much of that internal energy is actually extractable as work once the inexact, entropy-producing part of heat is subtracted — the practical payoff of distinguishing exact from inexact differentials.
What exactly is an inexact differential?
It is a differential form for which no function exists whose partial derivatives are the . The test is whether the mixed partials agree: . If they do, exists (exact); if not, no parent function exists (inexact). For written in , the coefficients are and , and , so it is inexact. The physical consequence is that depends on the path.
Why does the article use δ instead of d for heat and work?
The (some books use or đ) is a deliberate warning that the quantity is not the differential of any state function. Writing would falsely suggest a function of the state exists whose small change is — it does not. The says: "this is a small amount of heat exchanged in this step, but there is no total heat you are incrementing." It is the notational conscience of the whole exact/inexact distinction.
Isn't δW = −p dV just always equal to the change in some "work function"?
No, and that is the whole point. gives the work for one infinitesimal step, but to total it up you integrate along a path , and different paths give different answers. There is no function such that ; if there were, the work between two states would be path-independent, which contradicts the explicit two-path calculation (1729 J vs 1247 J for the same endpoints). Work is genuinely a functional of the path, not a difference of endpoint values.
How can 1/T possibly be the right integrating factor and not some other function?
For an ideal gas you can check it directly — dividing by makes the cross-derivatives vanish (see Derivation A), while dividing by, say, or does not. But the deeper answer is that the second law forces the integrating factor to be a universal function of temperature alone, the same for every substance. Carathéodory's theorem guarantees that the heat one-form for a simple system admits an integrating denominator, and the requirement that it be substance-independent pins it (up to scale) to the absolute temperature . That universality is why works for gases, solids, magnets — everything.
Do free expansion and reversible isothermal expansion really have the same ΔU?
Yes — that is exactly what makes the comparison so instructive. Both take an ideal gas from to at the same temperature (free expansion keeps constant because of an ideal gas depends on only and when ). Since the endpoints are identical, is identical: zero. But the free expansion has , , while the reversible isotherm has . Identical , utterly different heat and work — the cleanest possible demonstration that and are process quantities.
Does the same p dV that is inexact become part of the exact dU?
It does, and that cancellation is the magic of the first law. The work one-form is inexact on its own, and the heat one-form is inexact on its own, but their sum is exact. The path-dependent piece of the work is precisely cancelled by a path-dependent piece of the heat, leaving a quantity () that only sees the endpoints. So the very term that ruins exactness by itself becomes a legitimate part of an exact differential once heat is added back.