The previous lesson introduced thermodynamic systems, equilibrium states and state functions. We now turn to a central question: how can the energy of a system be incorporated into this macroscopic description?
Some courses treat this question too quickly: the first law is presented as a mere statement of energy conservation, and the energy balance formula follows immediately, with no further justification. We shall meet these formulas in Sections 3 and 4.3, and the reader in a hurry may indeed turn to them directly (see also the short summary in Section 7).
The construction leading to these formulas is, however, a subtle one. First, the first law asserts more than energy conservation, which (nowadays) seems obvious from a microscopic point of view. We shall show that this law in fact bridges the logical gap between the existence of an energy defined mechanically on a space of some coordinates, and that of a state function depending on only a handful of macroscopic variables.
We shall then show that the additivity of energy is a further assumption, needed to pass from the conservation of energy of an isolated system to an energy balance at the boundary of a closed system. It is this last step that finally makes the epistemic and logical status of heat precise: heat is defined as whatever transfer of energy remains in that balance once the macroscopic work done on a closed system has been accounted for, .
In this lesson we first consider closed systems: no matter crosses their boundary. The reason is simple: in an open system, matter itself carries energy across the boundary and complicates the energy balance. Open systems will be treated later in the course.
1. The microscopic internal energy
Consider a classical, non-quantum and non-relativistic system in an inertial frame1. Consider point particles of masses , positions and velocities . At any instant, its microscopic state is completely determined by
where denotes the classical phase space of the system, of dimension in this simple model. We assume that all internal forces, for instance the attractive or repulsive forces between molecules, are conservative. A total potential energy may then be associated with them, . The system may also be subject to external conservative forces, its weight for instance. In the same way, an external potential energy is associated with them.
The system need not be at rest in the chosen frame. At every instant one may define its center of mass and its velocity , which may itself depend on time. Introducing the total mass of the system and the velocities relative to the center of mass,
the total kinetic energy may then be written as
Expanding the square, one finds that the cross terms cancel exactly, since . This result is known as König's theorem in classical mechanics:
Hence:
The total kinetic energy therefore always splits2 into the macroscopic kinetic energy of the center of mass, and that of the residual relative motions, the “disordered” ones, which make up what is called thermal agitation.
Collecting the various terms, the total mechanical energy finally reads
Remark: the term collects the contributions of the internal degrees of freedom that this minimal point-particle model does not describe, for instance the rotational or vibrational degrees of freedom of the molecules. If these are modeled explicitly, the phase space must be enlarged accordingly.
which therefore depends, in general, on a considerable number of variables, and which satisfies:
In what follows we shall consider systems that are macroscopically at rest, free of global rotation, and whose external potential energy does not change. Up to a choice of origin, we may therefore write
We now introduce the thermodynamic energy state function, provisionally written , and explain why it must not be identified a priori with .
2. The thermodynamic internal energy
Take as our system a saucepan of water placed on a hotplate. We remain within the simple framework described above: the saucepan is macroscopically at rest and its external potential energy does not change. We may therefore write up to a constant.
When the water is heated, no macroscopic kinetic energy appears and the saucepan does not move. Granting the strict conservation of energy in all its forms, the energy supplied to it must therefore end up in its microscopic internal energy:
Thermodynamics seeks to describe exactly the same change. We should therefore like to construct a quantity such that
The solution looks obvious. Is it not enough to identify the thermodynamic internal energy with the microscopic internal energy?
Such an identification would in fact be mathematically incorrect, since the two functions do not have the same domain of definition. is a function defined on phase space and depends on at least variables, whereas depends only on a small number of independent variables describing the equilibrium state (recall that the are macroscopic state variables, such as temperature, pressure or volume).
The two functions must nevertheless be related in such a way that represents, at the macroscopic scale, the internal energy corresponding to the equilibrium state . How this dimensional reduction works must be explained. The question is a deep one and goes beyond the scope of this introductory course. A microscopic description is needed if one wishes to derive this passage between the two scales. Subsection 6.2, which lies outside the syllabus, outlines how statistical physics solves the problem.
From a strictly thermodynamic point of view, however, no justification of this microscopic identification is possible, and the existence of as a function of a few macroscopic variables only must be postulated. This will be the role of the first law of thermodynamics, which therefore asserts not only the conservation of energy, but also, and above all, that this energy can be represented at equilibrium by a state function defined on the macroscopic space .
Once the independent state variables have been chosen, say (, , ) for an ideal gas, the function defines a scalar field on the state space; in the enlarged space of coordinates , its graph is a hypersurface, called the equilibrium surface, whose role in the rest of this course will be crucial, cf. Figure 1.

Let us finally note an immediate corollary, which illustrates the difference between and rather well: in the equilibrium thermodynamics developed here, the thermodynamic internal energy is in general not defined outside equilibrium states. During a violent process undergone by a gas, for instance, it is possible, and indeed common, that no single temperature or pressure can be assigned to it any longer. In that case the thermodynamic internal energy cannot be assigned to it directly either, since it is defined only on the space of equilibrium states . The difficulty is not that the energy has ceased to exist, for its microscopic energy remains perfectly well defined at every instant, but simply that the system is no longer represented by a point .
All this being said, from the next section onwards the mechanical function will no longer appear directly: we shall simply write for the thermodynamic internal energy , understood to be defined on the space of equilibrium states only.
3. The first law of thermodynamics
The previous section has done much of the groundwork; we can now state:
called the internal energy, determined only up to an additive constant, at least twice differentiable, such that, for every equilibrium state ,
The first law also asserts the conservation of energy: for an isolated system,
The regularity of the function is likewise a non-trivial assumption. In practice, may be taken to be . Since is determined only up to a constant, because of the potential energies involved in equality 3, only its variations carry physical meaning. For simplicity, we shall restrict ourselves in what follows to processes in which the macroscopic kinetic and potential energies do not change. We then have .
Consider now a closed system , which may exchange energy, but not matter, with its surroundings. The global system
can always be embedded in an isolated system. The first law then imposes
Under the further assumption that energy is additive, that is, that their interaction energy is negligible, we have , so that
The assumption of additivity thus turns the conservation of energy into a balance between subsystems: whatever energy is gained by the system is lost by its surroundings, and conversely. It remains to specify how this energy can be transferred across the boundary of the system. We shall distinguish two modes of transfer: work, written , which has an independent definition inherited from mechanics, and heat, written .
The energy balance will then take the form
where denotes the work received by the system and the heat received by it.
Note that the assumption that energy is additive is not a trivial one. At an elementary level, it may simply be granted for the usual thermodynamic systems. It is not always valid, however. Long-range interactions in particular can defeat both the additivity and the extensivity of energy at once, see Section 6.4.
It now remains to define these two modes of transfer. Before that, it is essential to note a sign convention, an entirely standard one, that will be used throughout this course.
correspond to energy received by the system, whereas
correspond to energy given up to the surroundings.
4. Work, heat and the energy balance
4.1. Work
One of the advantages of work is that it has a definition independent of thermodynamics, inherited from mechanics. When an external force acts on a point of the boundary of the system and that point is displaced by , the elementary work supplied by this force, and therefore received by the system, is
For an extended system, the contributions of all the external forces doing work on its boundary must be summed.
The case that will serve us most often in practice is that of a fluid contained in a vessel with one movable wall, which leads us to evaluate the work of the pressure forces. Consider a gas enclosed in a cylinder by a flat piston of cross-section , cf. Figure 2. The axis points outward from the gas. When the piston is displaced by an amount , the volume changes by
Let denote the external pressure exerted on the boundary of the gas. The force received by the gas is directed inward and is
The elementary work received by the gas is therefore
that is
The banker's rule makes the sign immediate to check. In a compression, , hence : the gas receives work. In an expansion, , hence : the gas supplies work to its surroundings.
Note that the pressure appearing in this formula is indeed the pressure external to the system, which in general has no reason to equal the pressure of the gas itself. This is particularly important to keep in mind for violent, out-of-equilibrium processes, where the internal pressure is in general not even defined.

Integrating, we obtain the following formula for a finite process during which the external pressure is known:
This integral shows that, in order to compute the total work, the value of must be known all along the process. This has a major consequence: the work can in general not be determined from the initial and final states and alone: its expression depends on the process followed.
Three particular cases are worth pointing out here.
- If is constant, then .
- Along an isochoric process, , and the work of the pressure forces vanishes: and .
- In an expansion into a vacuum, , so the work of the pressure forces vanishes as well.
For an interface whose area is increased, the surface tension leads, under the usual conditions, to work of the form
Energy may also be transferred without any visible mechanical displacement. For instance, moving a charge through a potential difference can give rise to electrical work of the form
where is the external electric potential, often written in this context so as not to confuse it with the volume. Here too the sign of is chosen in accordance with the banker's convention.
Subsection 6.3 will make the general form of the external work terms precise.
4.2. Heat
Work cannot be the only mode of energy transfer, since heating a gas held in a rigid vessel raises its temperature and its energy without any external work being done. Energy has therefore crossed the boundary of the system without having been transferred as work. This second mode of energy transfer is called heat, or heat transfer.
In the construction adopted here (see Subsection 6.1 for an equivalent alternative construction), for a physical process connecting two equilibrium states and , once all the work terms received by the system have been identified, the heat received is defined by
so that we recover the relation announced above,
Since the work depends on the path of the process , while the energy change does not, the amount of heat exchanged must necessarily depend on it as well.
In thermodynamic language, one says that the internal energy is a state function (by postulate), whereas the work and the heat are not. Recall what this means: the fact that and cannot be functions of the state of the system at a given instant means that the system does not possess “an amount of work or of heat”; rather, and are transfers of energy at its boundary during some process , exactly what we were after, in view of the various experiments described in Lesson 2.
Let us note that in a cyclic process the system returns to its initial state, so that
The first law then imposes
A cyclic machine can therefore not supply work indefinitely without receiving an equal amount of energy from its surroundings. This is, historically, what is called the impossibility of perpetual motion of the first kind.
4.3. Differential form of the first law
The relation
connects two equilibrium states and . It always holds, in the sense that it does not require the intermediate states themselves to be representable by points of the space of equilibrium states . If the process is a violent one, the system may temporarily leave the equilibrium surface defined over , while and remain perfectly well defined.
One special case must now be spelled out. Suppose the process is quasi-static. At every instant the system is then, by definition, in an equilibrium state. Such a process can be represented by a path
made of infinitesimally close equilibrium states, which never leaves the equilibrium surface. Since is a state function that is differentiable on , its change between two infinitesimally close states is an exact differential, written .
We then write and for the corresponding elementary transfers of heat and work. In this case the first law takes the form
The difference in notation between on the one hand and or on the other is not merely cosmetic. It indicates that the former is an exact differential while the latter two are not, which is the mathematical counterpart of the fact that the energy change does not depend on the path followed, whereas and do. The next section reviews, for the newcomer, the mathematics needed to grasp this crucial point.
In the particular case where the only work is that of the pressure forces, and where may be identified with the pressure of the system, this relation becomes
connects two equilibrium states and remains usable even when the intermediate process is not quasi-static. The differential form
is valid only for a quasi-static process, which can be represented by a path in the space of equilibrium states.
5. Exact and inexact differential forms
This section gathers the minimum of mathematics needed to give a precise meaning to the distinction between on the one hand, and and on the other. Readers already familiar with it may skip it.
5.1. The differential of a function
Let be a function of the variables , assumed differentiable. Its differential is the expression
which measures the change of when one moves from the point to the neighboring point . The essential point is the following: if one follows a path from a point to a point , then summing all these elementary changes gives
In particular, along a closed path we have:
5.2. Differential forms
Consider now an expression of the same kind, which must on no account be confused with the differential of a function. Let be arbitrary functions. We define by
Such an object is called a differential form. Once the functions are given, integrating it along a path raises no difficulty. But nothing guarantees that there exists a function of which is the differential, that is, such that for every .
- If such a function exists, the form is said to be exact, and one writes . The integral then depends only on the endpoints.
- Otherwise the form is said to be inexact, and it is then written rather than , as a reminder that it is the differential of no function. (Mathematicians would simply write the form as .)
5.3. Schwarz's criterion
A simple test for deciding whether a differential form is exact is Schwarz's criterion. For simplicity we work with two variables (the generalization is immediate), with
If were exact, we would have and , hence
since the order of differentiation is immaterial for a twice continuously differentiable function. We thus have a convenient test:
Up to subtleties that will not arise in thermodynamics, the converse holds as well.
5.4. Example: the work of the pressure forces
When the elementary transfers can be expressed in terms of the state variables along the quasi-static path, and become differential forms on , and one can check whether they are exact or not.
By way of example, take moles of an ideal gas undergoing a quasi-static process, with . We then have . Since , the elementary work reads
identifying and . This is indeed a differential form defined on the state space. Schwarz's criterion gives
The two cross derivatives are not equal: the elementary work is indeed not an exact differential. There is therefore, in this case, no state function of which would be the change, and the work received between two states does depend on the path followed. The same reasoning applies to : since is exact and is not, their difference cannot be exact either.
6. Going further
This section gathers the more advanced considerations announced earlier. It may be skipped on a first reading.
6.1. Two possible constructions of the first law
We have chosen here the following logical order: the existence of the state function is postulated by the first law, work is defined independently by mechanics, and heat is then defined by the balance
A remarkable fact follows. If the process is adiabatic, then , which forces the adiabatic work to be, in its turn, always independent of the path followed.
This points to another possible construction of the internal energy: an operational one, hence independent of any microscopic consideration, and as it happens closer to the historical route. One begins by characterizing adiabatic processes without introducing the quantity beforehand, so as to avoid any circularity in the reasoning.
The idea is a clever one: what is defined is not the transfer itself, but the apparatus. A wall is said to be adiabatic when the state of the system it encloses can be changed only by moving the external mechanical coordinates, that is, the piston, a stirrer or an electric current. The test is then direct: one holds these coordinates fixed and alters the surroundings arbitrarily, by plunging the enclosure into an ice bath, say, or bringing it close to a flame. If no state variable of the system changes, then the wall is adiabatic.
This characterization involves only states and mechanical displacements, never a transfer of energy: it therefore precedes any notion of heat. In practice, one approaches it by good insulation, or by working fast compared with the thermal relaxation time.
The work received, for its part, is measured in a purely mechanical or electrical way. This is the whole empirical content of Joule's experiments, carried out between 1843 and 1850 and repeated since with ever greater precision: a mass falling through a height supplies , with no heat transfer involved. All the arrangements he devised and built in an adiabatic enclosure in the above sense (paddle wheel, heating resistor or compression of a gas) led him to the same conclusion: the same work supplied produces the same change of state, which for him constituted “the mechanical equivalent of heat”, as explained in Lesson 2. Joule was thus the first to show (an experimental indication of the fact) that adiabatic work does not depend on the path followed.
It was then Carathéodory, in 1909 [2], and above all Born, in 1921, who proposed to elevate this experimental fact into a postulate. Granting it, it becomes easy to construct a state function by setting
and then to define heat by difference for general processes, as we have done.
This construction is adopted in many textbooks, notably those of Pippard [3] and Callen [4]. It is equivalent to ours: postulating and then deducing the path-independence of adiabatic work is equivalent to postulating the path-independence of that work and then constructing . A detailed account of this conceptual evolution, from Joule to Carathéodory and Born, will be found in Rosenberg [5].
6.2. Micro- and macrostates
If one does not follow the operational route described above, then Section 2 has brought a fundamental question to light: how can an energy defined on a space of coordinates be reduced to a function of only a few macroscopic variables? Statistical physics constructs this passage between the two scales. Its outline is as follows.
In statistical physics, a point of the space of equilibrium states is called a macrostate. To one and the same macrostate there generally corresponds a gigantic number of microstates compatible with the same macroscopic constraints.
One then shows that the energies of these microstates are distributed extremely narrowly about their mean value as , the so-called thermodynamic limit. In other words, the relative fluctuations of the energy tend to zero:
One may then set , the average being taken over all microstates compatible with the macrostate. It is the concentration just mentioned that gives this definition its meaning. At every instant the system occupies a single microstate, not the average: only because nearly all of them carry the same energy can one speak of the energy of the macrostate, and can two identical preparations yield the same measurement.
One may picture the situation by imagining that to a macrostate there corresponds a very large collection of microstates that are microscopically different but macroscopically indistinguishable. This picture resembles that of an equivalence class on phase space. The precise construction will, however, be slightly different, and will involve a probability distribution on phase space.
The following figure summarizes this procedure.

6.3. Generalized work terms
The various forms of work met above share a common structure. We have seen the forms
for pressure work,
for the stretching of a wire, and again
for surface work. Note that in every case the quantity being differentiated is extensive, while its prefactor is intensive. Generalizing, we shall write any mechanical work term in the form
where denotes the external generalized force (generally intensive) conjugate to the coordinate (generally extensive), with the sign matching our convention.
When the external generalized forces can be identified with the corresponding thermodynamic forces of the system (for example ), the first law may then be written in the form
6.4. Extensivity of the internal energy
In the previous lesson we presented the internal energy as an extensive quantity: multiplying the size of a homogeneous system by a factor , at fixed intensive variables, multiplies its energy by ,
This property is not postulated by the first law. It is a further assumption, which we shall often make, but which does not always hold. One indeed expects the presence of long-range forces between the constituents of the system, gravitational ones in particular, to ruin its extensivity.
Let us make this precise. Consider constituents distributed at constant density in a space of dimension , and suppose that their interaction potential energy behaves as
At fixed density , the typical linear size of the system grows as
Let us now evaluate the total interaction energy in three steps.
Counting the neighbors.
Fix one constituent and ask how many others lie at a distance between and . This is the density times the volume of the corresponding shell:
where denotes the area of the unit sphere in dimension , that is in three dimensions.
Summing over distances.
Each of these neighbors contributes . The interaction energy of a single constituent with all the others is therefore
The lower bound is the minimum distance of approach, below which the law ceases to hold and which prevents the integral from diverging as . The upper bound is the size of the system: there is no neighbor beyond it.
Summing over constituents.
We multiply by the number of constituents (dividing by two so as not to count each pair twice):
where the geometrical factor has been absorbed into the order of magnitude. Let us now look at the value of the integral:
If , the exponent is negative: the integral converges as and is dominated by its lower bound, hence of the order of the constant . If , it is on the contrary dominated by its upper bound and is of the order of . Finally, in the case , the antiderivative is a logarithm and the integral equals . Substituting, we thus obtain
Physically, the interpretation is clear. When , the forces are short-ranged: the decay of outweighs the growth in the number of neighbors. Each constituent feels only its immediate neighborhood, so that its energy does not depend on the size of the system, and the total is proportional to , which is extensive.
When , the opposite happens: the distant neighbors, far more numerous, win out, each constituent feels the system as a whole, and its own energy grows with the size of that system. The total then grows faster than , and extensivity is lost. Sufficiently short-ranged interactions therefore lead naturally to an extensive energy, whereas long-range interactions can destroy that property.
In three-dimensional Newtonian gravity, for instance,
and the above estimate gives, at fixed density,
The minus sign, which the order-of-magnitude argument does not by itself provide, reflects the attractive character of gravity.
The extensivity of energy will be used extensively in the rest of this book. Gravity is of course universal, but it is a very weak force: when studying two volumes of gas brought into contact, it can be neglected in practice. On the other hand, the internal forces within the gas, of van der Waals type, decay very fast (as ), so that extensivity is in that case very nearly exact.
For the description of so-called self-gravitating systems (stars, galaxies, ...), on the other hand, gravity is of course the essential ingredient, and the whole thermodynamic analysis must be taken up again from the start, since the extensivity of energy is necessarily lost. As a result, the thermodynamics of such systems is almost a subject of its own, and displays unexpected behavior: a star that radiates energy away, for instance, heats up instead of cooling down. We shall return to this in the advanced part of the book.
7. Summary
Let us summarize what this lesson has set up, and what will be used throughout what follows.
- The first law postulates the existence of a state function , the internal energy, and asserts the conservation of the energy of an isolated system.
- In the rest of the book we shall also assume it to be extensive, and sufficiently continuous and differentiable in all its variables.
- Supplemented by the additivity of energy, the first law allows conservation to be expressed as an energy balance between a closed system and its surroundings. Since work is defined independently by mechanics, heat is then defined as the remaining transfer, which leads to the useful formula .
- For a quasi-static process, this energy balance takes the differential form , in which only is an exact differential.
The analysis of open systems will be discussed elsewhere in the course.
8. References
On the conceptual evolution of the first law, from Joule to Carathéodory and Born, see Rosenberg [5]. For a classical presentation, see Pippard [3] and Callen [4].
- J. P. Joule, “On the Mechanical Equivalent of Heat,” Phil. Trans. R. Soc. Lond. 140, 61—82 (1850)
- C. Carathéodory, “Untersuchungen über die Grundlagen der Thermodynamik,” Math. Ann. 67, 355—386 (1909)
- A. B. Pippard, Elements of Classical Thermodynamics for Advanced Students of Physics, Cambridge University Press (1957)
- H. B. Callen, Thermodynamics and an Introduction to Thermostatistics, 2nd ed., Wiley (1985)
- R. M. Rosenberg, “From Joule to Caratheodory and Born: A Conceptual Evolution of the First Law of Thermodynamics,” J. Chem. Educ. 87, 691—693 (2010)
- A. M. Steane, “First Law, internal energy,” chap. 7 in Thermodynamics: A Complete Undergraduate Course, Oxford University Press (2017)
- E. A. Gislason and N. C. Craig, “Cementing the foundations of thermodynamics: Comparison of system-based and surroundings-based definitions of work and heat,” J. Chem. Thermodynamics 37, 954—966 (2005)