Home/Lessons/Lesson 4

The First Law of Thermodynamics

Keywords: Internal energy, First law, Pressure-volume work, Heat transfer, State function, Exact differential, Quasi-static process, Adiabatic process, Extensivity

Final version

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 there as the expression of energy conservation, which the founders of thermodynamics gradually brought to light over the course of the 19th century (see Lesson 2), and the energy balance formula then follows immediately, with no further justification.

The construction leading to these formulas is, however, more subtle, and it rests on two points. First, the first law asserts more than this conservation, which (nowadays) seems obvious from a microscopic point of view. It 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.

Second, writing the energy balance in terms of work and heat requires a further assumption, the additivity of energy (see Section 7.4). It is this assumption that allows us to pass from an isolated system, whose energy is conserved, to the exchanges across the boundary of a closed system. This last step finally makes precise the epistemic and logical status of heat, defined as whatever transfer of energy remains once the macroscopic work received by the 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 frame (quantum and relativistic cases require a suitably adapted treatment), made up of point particles of masses , positions and velocities . At any instant, its microscopic state is completely determined by the list , where is the momentum. Here 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, with . 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, but its total kinetic energy can always be written as the sum of two terms. The first is the macroscopic kinetic energy of the bulk motion, the second that of the residual relative motions, the “disordered” ones, which make up what is called thermal agitation. We thus have:

(1)

Proof.
Let denote the total mass of the system, the velocity of its center of mass, which may depend on time, and the velocities relative to the center of mass:

The total kinetic energy then reads

Expanding the square, one finds that the cross terms cancel, since . This result is known as König's theorem in classical mechanics:

We thus indeed have , with and .

The translation of the center of mass does not necessarily exhaust the macroscopic kinetic energy. The system may undergo an ordered global rotation. In that case one may write the decomposition

where is the position of the center of mass and where now denotes the residual motion left after the global translation and rotation have been subtracted. Choosing so that this residual motion carries zero total angular momentum about the center of mass, one obtains

where is the inertia tensor about the center of mass. The energy of the global rotation is then added to the macroscopic kinetic energy, and the separation between macroscopic and microscopic kinetic energy therefore remains possible.

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.

Definition 1 (Microscopic internal energy)
We will write for the microscopic internal energy. It is a function defined on phase space,

which in general depends on a considerable number of variables, and which satisfies:

(2)

In what follows we will 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. If we grant the strict conservation of energy in all its forms, the energy supplied to the water when it is heated must end up in its microscopic internal energy:

Thermodynamics seeks to describe exactly the same change. We would therefore like to construct a quantity such that

The solution looks obvious. Why not simply 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 7.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 .

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 will simply write for the thermodynamic internal energy , understood to be defined on the space of equilibrium states only.

Remark 1 (Near-equilibrium extensions)
Let us mention that, for systems sufficiently close to equilibrium, the thermodynamic description can be extended by enlarging the state space. For instance, in the example already met of a metal bar placed between two thermal reservoirs, one may introduce a stationary local temperature field , rather than a single temperature, and define a local density of internal energy. The total energy then becomes a functional of these fields. We will not develop this so-called near-equilibrium thermodynamics here.

3. The first law of thermodynamics

The previous section has laid much of the groundwork; we can now state:

First law of thermodynamics for a closed system
For every closed thermodynamic system there exists a state function

called the internal energy, determined only up to an additive constant, at least twice differentiable, such that, for every equilibrium state and up to negligible fluctuations (see Subsection 7.2),

(3)

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 the systems considered here, we therefore simply 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 the interaction energy between and its surroundings 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 will 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

(4)

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: these two notions, and the link between them, are discussed in the “Going further” section (Section 7.4).

It now remains to define these two modes of transfer. Before doing so, however, we must specify a sign convention, an entirely standard one, that we will use throughout the rest of this course.

Key point (The banker's sign convention)
Throughout this book, a transfer of energy is counted positively when it is received by the system, and negatively when it is supplied by the system. Thus

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 ; see Figure 1. 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

(5)

The banker's convention makes the sign easy 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 whatsoever to equal the pressure of the gas itself. It is particularly important to remember this for violent, out-of-equilibrium processes, where the internal pressure is in general not even defined.

Work received by a gas when a piston of cross-section S is displaced. In an expansion, dV>0 while the force exerted by the external pressure opposes the displacement: the work received is therefore negative.
Figure 1. Work received by a gas when a piston of cross-section is displaced. In an expansion, while the force exerted by the external pressure opposes the displacement: the work received is therefore negative.

Integrating, we obtain the following formula for a finite process during which the external pressure is known:

(6)

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 cannot in general 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.

  1. If is constant, then .
  2. Along an isochoric process, , and the work of the pressure forces vanishes: and .
  3. In an expansion into a vacuum, , so the work of the pressure forces vanishes.

Remark 2 (Other forms of work)
The work of the pressure forces is only one example among others. The general form of the work terms is presented in Subsection 7.3.

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 7.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

(7)

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. In other words, the system does not possess “an amount of work or of heat”: and are transfers of energy across its boundary during a process . This is precisely the status suggested by the experiments described in Lesson 2.

Let us note that in a cyclic process the system returns to its initial state. We therefore have and . A cyclic heat engine therefore cannot 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.

Remark 3
To compare heat, mechanical work and electrical work concretely between the same states, see the exercise “Same change in internal energy, three modes of transfer”.

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 , 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, by definition, in an equilibrium state. Such a process can then be represented by a path

made of infinitesimally close equilibrium states, which never leaves . 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

(8)

The notation is explained in the next section.

Key point (Two formulations of the first law)
Its integrated form

connects two equilibrium states and remains usable even when the intermediate process is not quasi-static. Its 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 these notions 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 . (Mathematicians simply write the form as ; physicists write as a reminder that it is an elementary change.)

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 . But since the order of differentiation is immaterial for a twice continuously differentiable function, we would then have

We thus have a convenient test:

Its contrapositive reads:

Up to subtleties that will not arise in thermodynamics, the converse holds as well.

Remark 4
To practice telling an exact differential apart from a path-dependent form, see the exercise “Integrating a differential form along a path”.

5.4. Example: the work of the pressure forces

When the expression of is known, one can check whether it is a differential form on , and whether or not it is exact. By way of example, take moles of an ideal gas undergoing a quasi-static process. We have , which is not a priori a differential form on the space of equilibrium states , since in general nothing relates to . Let us consider the usual case where (reversible process; see the next lesson).

In this case, is indeed a differential form on . But since , the elementary work reads

identifying and . 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. The same reasoning then applies to : since is exact and is not, their difference cannot be exact either.

6. 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 will 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.

7. Going further

This section gathers the more advanced considerations announced earlier. It may be skipped on a first reading.

7.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 implies that the adiabatic work is, for its part, 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 1849 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 we explained in Lesson 2. Joule was thus the first to provide an experimental indication that adiabatic work does not depend on the path followed.

It was then Carathéodory, in 1909 [2], and above all Born, in 1921 [3], who proposed to elevate this experimental fact into a postulate. Once this is granted, 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 [4] and Callen [5]. It is equivalent to ours: postulating and then deducing the path-independence of adiabatic work amounts to the same thing as postulating the path-independence of that work and then constructing . A detailed account of this conceptual evolution, from Joule to Carathéodory and Born, can be found in Rosenberg [6].

7.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.

One and the same macrostate X is compatible with an immense number of microstates. On our scale their energies are extremely concentrated about a single macroscopic value, which is what makes it possible to define U_ th(X).
Figure 2. One and the same macrostate is compatible with an immense number of microstates. On our scale their energies are extremely concentrated about a single macroscopic value, which is what makes it possible to define .

7.3. Generalized work terms

The work of the pressure forces,

is not the only form of work. For a wire being stretched, if denotes its length and the tensile force received,

For an interface whose area is increased, the surface tension leads, under the usual conditions, to surface work

Energy may also be transferred without any visible mechanical displacement. Moving a charge through a potential difference thus gives rise to electrical work

where is the external electric potential, written this way so as not to confuse it with the volume, and where the sign of is chosen in accordance with the banker's convention.

These various forms of work share a common structure. In every case, the quantity being differentiated is extensive, while its prefactor is intensive. In general, we will therefore write any 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

7.4. Additivity and extensivity of the internal energy

These two properties are often confused. Neither of them is postulated by the first law. They are further assumptions, which we will often make, but which do not always hold. Let us begin by recalling their definitions.

Additivity.

Consider two systems and , combined into a single system . The energy is said to be additive if

that is, if the interaction energy between and is negligible compared with their own energies. It is this assumption that allowed us, in Section 3, to write the energy balance between a closed system and its surroundings.

Extensivity.

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, then multiplies its energy by ,

Additivity implies extensivity.

Let us join together identical copies of one and the same homogeneous system. The resulting system is nothing but the original one, at fixed intensive variables and with its size multiplied by . If the energy is additive, its energy is therefore

which is exactly extensivity for an integer factor . The argument extends to a rational factor by cutting the system into identical parts, and then to any by continuity. The converse, on the other hand, is not necessarily true.

One might object that, taking , extensivity gives , which looks like additivity. This is, however, a very special case, that of two identical subsystems, of the same nature and in the same state, that is, with the same intensive variables. Additivity is a much stronger property, which concerns two arbitrary systems, possibly of different natures and in different states, such as a hot body and a cold body brought into contact, or a system and its surroundings. It is precisely this general case that the energy balance requires. Extensivity, which compares a system only with copies of itself, says nothing about the interaction energy between two different systems.

By contraposition, a system whose energy is not extensive cannot have an additive energy. Now one expects long-range forces between the constituents of the system, gravitational ones in particular, to ruin its extensivity, and hence also the additivity of its energy.

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.

We will rely on the extensivity of energy throughout 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, ...), by contrast, gravity is 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 will return to this in the advanced part of the book.

8. References

On the conceptual evolution of the first law, from Joule to Carathéodory and Born, see Rosenberg [6]. For a classical presentation, see Pippard [4] and Callen [5].

  1. J. P. Joule, “On the Mechanical Equivalent of Heat,” Phil. Trans. R. Soc. Lond. 140, 61–82 (1850)
  2. C. Carathéodory, “Untersuchungen über die Grundlagen der Thermodynamik,” Math. Ann. 67, 355–386 (1909)
  3. M. Born, “Kritische Betrachtungen zur traditionellen Darstellung der Thermodynamik,” Phys. Z. 22, 218–224, 249–254, 282–286 (1921)
  4. A. B. Pippard, Elements of Classical Thermodynamics for Advanced Students of Physics, Cambridge University Press (1957)
  5. H. B. Callen, Thermodynamics and an Introduction to Thermostatistics, 2nd ed., Wiley (1985)
  6. 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)
  7. A. M. Steane, “First Law, internal energy,” chap. 7 in Thermodynamics: A Complete Undergraduate Course, Oxford University Press (2017)
  8. 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)