The **second law of thermodynamics** states that the total entropy of an isolated system can never decrease over time. The total entropy of a system and its surroundings can remain constant in ideal cases where the system is in thermodynamic equilibrium, or is undergoing a (fictive) reversible process. In all processes that occur, including spontaneous processes,^{[1]} the total entropy of the system and its surroundings increases and the process is irreversible in the thermodynamic sense. The increase in entropy accounts for the irreversibility of natural processes, and the asymmetry between future and past.^{[2]}

Historically, the second law was an empirical finding that was accepted as an axiom of thermodynamic theory. Statistical mechanics, classical or quantum, explains the microscopic origin of the law.

The second law has been expressed in many ways. Its first formulation is credited to the French scientist Sadi Carnot, who in 1824 showed that there is an upper limit to the efficiency of conversion of heat to work, in a heat engine, also referred to as Carnot's rule or limit.^{[3]}

# Introduction

The first law of thermodynamics provides the basic definition of internal energy, associated with all thermodynamic systems, and states the rule of conservation of energy.^{[4]}^{[5]} The second law is concerned with the direction of natural processes.^{[6]} It asserts that a natural process runs only in one sense, and is not reversible. For example, heat always flows spontaneously from hotter to colder bodies, and never the reverse, unless external work is performed on the system. The explanation of the phenomena was given in terms of entropy.^{[7]}^{[8]} Total entropy (S*) can never decrease over time for an isolated system because the entropy of an isolated system spontaneously evolves toward thermodynamic equilibrium: the entropy should stay the same or increase.*

*In a fictive reversible process, an infinitesimal increment in the entropy (d*S*) of a system is defined to result from an infinitesimal transfer of heat (δ*Q*) to a closed system (which allows the entry or exit of energy – but not mass transfer) divided by the common temperature (*T*) of the system in equilibrium and the surroundings which supply the heat: ^{[9]}*

Different notations are used for infinitesimal amounts of heat (δ) and infinitesimal amounts of entropy (d) because entropy is a function of state, while heat, like work, is not. For an actually possible infinitesimal process without exchange of mass with the surroundings, the second law requires that the increment in system entropy fulfills the inequality ^{[10]}^{[11]}

*This is because a general process for this case may include work being done on the system by its surroundings, which can have frictional or viscous effects inside the system, because a chemical reaction may be in progress, or because heat transfer actually occurs only irreversibly, driven by a finite difference between the system temperature (*T*) and the temperature of the surroundings (*Tsurr*). ^{[12]}^{[13]} Note that the equality still applies for pure heat flow,^{[14]}*

The second term represents work of internal variables that can be perturbed by external influences, but the system cannot perform any positive work via internal variables. This statement introduces the impossibility of the reversion of evolution of the thermodynamic system in time and can be considered as a formulation of *the second principle of thermodynamics* – the formulation, which is, of course, equivalent to the formulation of the principle in terms of entropy.^{[16]}^{[17]}

The zeroth law of thermodynamics in its usual short statement allows recognition that two bodies in a relation of thermal equilibrium have the same temperature, especially that a test body has the same temperature as a reference thermometric body.^{[18]} For a body in thermal equilibrium with another, there are indefinitely many empirical temperature scales, in general respectively depending on the properties of a particular reference thermometric body. The second law allows a distinguished temperature scale, which defines an absolute, thermodynamic temperature, independent of the properties of any particular reference thermometric body.^{[19]}^{[20]}

# Various statements of the law

The second law of thermodynamics may be expressed in many specific ways,^{[21]} the most prominent classical statements^{[22]} being the statement by Rudolf Clausius (1854), the statement by Lord Kelvin (1851), and the statement in axiomatic thermodynamics by Constantin Carathéodory (1909). These statements cast the law in general physical terms citing the impossibility of certain processes. The Clausius and the Kelvin statements have been shown to be equivalent.^{[23]}

The historical origin of the second law of thermodynamics was in Carnot's principle. It refers to a cycle of a Carnot heat engine, fictively operated in the limiting mode of extreme slowness known as quasi-static, so that the heat and work transfers are between subsystems that are always in their own internal states of thermodynamic equilibrium. The Carnot engine is an idealized device of special interest to engineers who are concerned with the efficiency of heat engines. Carnot's principle was recognized by Carnot at a time when the caloric theory of heat was seriously considered, before the recognition of the first law of thermodynamics, and before the mathematical expression of the concept of entropy. Interpreted in the light of the first law, it is physically equivalent to the second law of thermodynamics, and remains valid today. In concise terms, Carnot's original statement was made from the viewpoint of the caloric theory, before the discovery of the first law of thermodynamics:

In modern terms, Carnot's principle may be stated more elaborately:

The German scientist Rudolf Clausius laid the foundation for the second law of thermodynamics in 1850 by examining the relation between heat transfer and work.^{[32]} His formulation of the second law, which was published in German in 1854, is known as the *Clausius statement*:

The statement by Clausius uses the concept of 'passage of heat'. As is usual in thermodynamic discussions, this means 'net transfer of energy as heat', and does not refer to contributory transfers one way and the other.

Heat cannot spontaneously flow from cold regions to hot regions without external work being performed on the system, which is evident from ordinary experience of refrigeration, for example. In a refrigerator, heat flows from cold to hot, but only when forced by an external agent, the refrigeration system.

Lord Kelvin expressed the second law as

Planck offered the following proposition as derived directly from experience. This is sometimes regarded as his statement of the second law, but he regarded it as a starting point for the derivation of the second law.

It is almost customary in textbooks to speak of the "Kelvin-Planck statement" of the law, as for example in the text by ter Haar and Wergeland.^{[37]}

The **Kelvin–Planck statement** (or the *heat engine statement*) of the second law of thermodynamics states that

Planck stated the second law as follows.

*Rather like Planck's statement is that of Uhlenbeck and Ford for *irreversible phenomena*.*

Constantin Carathéodory formulated thermodynamics on a purely mathematical axiomatic foundation. His statement of the second law is known as the Principle of Carathéodory, which may be formulated as follows:^{[43]}

Though it is almost customary in textbooks to say that Carathéodory's principle expresses the second law and to treat it as equivalent to the Clausius or to the Kelvin-Planck statements, such is not the case. To get all the content of the second law, Carathéodory's principle needs to be supplemented by Planck's principle, that isochoric work always increases the internal energy of a closed system that was initially in its own internal thermodynamic equilibrium.^{[13]}^{[46]}^{[47]}^{[48]}

In 1926, Max Planck wrote an important paper on the basics of thermodynamics.^{[47]}^{[49]} He indicated the principle

This formulation does not mention heat and does not mention temperature, nor even entropy, and does not necessarily implicitly rely on those concepts, but it implies the content of the second law. A closely related statement is that "Frictional pressure never does positive work."^{[50]} Using a now-obsolete form of words, Planck himself wrote: "The production of heat by friction is irreversible."^{[51]}^{[52]}

Not mentioning entropy, this principle of Planck is stated in physical terms. It is very closely related to the Kelvin statement given just above.^{[53]} It is relevant that for a system at constant volume and mole numbers, the entropy is a monotonic function of the internal energy. Nevertheless, this principle of Planck is not actually Planck's preferred statement of the second law, which is quoted above, in a previous sub-section of the present section of this present article, and relies on the concept of entropy.

A statement that in a sense is complementary to Planck's principle is made by Borgnakke and Sonntag. They do not offer it as a full statement of the second law:

Differing from Planck's just foregoing principle, this one is explicitly in terms of entropy change. Removal of matter from a system can also decrease its entropy.

*The second law has been shown to be equivalent to the internal energy *U* being a weakly convex function, when written as a function of extensive properties (mass, volume, entropy, ...). ^{[55]}^{[56]}*

# Corollaries

Before the establishment of the second law, many people who were interested in inventing a perpetual motion machine had tried to circumvent the restrictions of first law of thermodynamics by extracting the massive internal energy of the environment as the power of the machine. Such a machine is called a "perpetual motion machine of the second kind". The second law declared the impossibility of such machines.

Carnot's theorem (1824) is a principle that limits the maximum efficiency for any possible engine. The efficiency solely depends on the temperature difference between the hot and cold thermal reservoirs. Carnot's theorem states:

- All irreversible heat engines between two heat reservoirs are less efficient than a Carnot engine operating between the same reservoirs.
- All reversible heat engines between two heat reservoirs are equally efficient with a Carnot engine operating between the same reservoirs.

In his ideal model, the heat of caloric converted into work could be reinstated by reversing the motion of the cycle, a concept subsequently known as thermodynamic reversibility. Carnot, however, further postulated that some caloric is lost, not being converted to mechanical work. Hence, no real heat engine could realise the Carnot cycle's reversibility and was condemned to be less efficient.

Though formulated in terms of caloric (see the obsolete caloric theory), rather than entropy, this was an early insight into the second law.

The Clausius theorem (1854) states that in a cyclic process

The equality holds in the reversible case^{[57]} and the strict inequality holds in the irreversible case. The reversible case is used to introduce the state function entropy. This is because in cyclic processes the variation of a state function is zero from state functionality.

For an arbitrary heat engine, the efficiency is:

where *W*n is for the net work done per cycle. Thus the efficiency depends only on qC/qH.

In addition, a reversible heat engine operating between temperatures *T*1 and *T*3 must have the same efficiency as one consisting of two cycles, one between *T*1 and another (intermediate) temperature *T*2, and the second between *T*2 and*T*3. This can only be the case if

Therefore, if thermodynamic temperature is defined by

then the function *f*, viewed as a function of thermodynamic temperature, is simply

and the reference temperature *T*1 will have the value 273.16. (Any reference temperature and any positive numerical value could be used – the choice here corresponds to the Kelvin scale.)

According to the Clausius equality, for a reversible process

So we can define a state function S called entropy, which for a reversible process or for pure heat transfer^{[14]} satisfies

With this we can only obtain the difference of entropy by integrating the above formula. To obtain the absolute value, we need the third law of thermodynamics, which states that *S* = 0 at absolute zero for perfect crystals.

For any irreversible process, since entropy is a state function, we can always connect the initial and terminal states with an imaginary reversible process and integrating on that path to calculate the difference in entropy.

Now reverse the reversible process and combine it with the said irreversible process. Applying the Clausius inequality on this loop,

Thus,

where the equality holds if the transformation is reversible.

An important and revealing idealized special case is to consider applying the Second Law to the scenario of an isolated system (called the total system or universe), made up of two parts: a sub-system of interest, and the sub-system's surroundings. These surroundings are imagined to be so large that they can be considered as an *unlimited* heat reservoir at temperature *TR* and pressure *PR* – so that no matter how much heat is transferred to (or from) the sub-system, the temperature of the surroundings will remain *TR*; and no matter how much the volume of the sub-system expands (or contracts), the pressure of the surroundings will remain *PR*.

Whatever changes to *dS* and *dSR* occur in the entropies of the sub-system and the surroundings individually, according to the Second Law the entropy *Stot* of the isolated total system must not decrease:

According to the first law of thermodynamics, the change *dU* in the internal energy of the sub-system is the sum of the heat *δq* added to the sub-system, *less* any work *δw* done *by* the sub-system, *plus* any net chemical energy entering the sub-system *d ∑μiRNi*, so that:

where μiR are the chemical potentials of chemical species in the external surroundings.

Now the heat leaving the reservoir and entering the sub-system is

where we have first used the definition of entropy in classical thermodynamics (alternatively, in statistical thermodynamics, the relation between entropy change, temperature and absorbed heat can be derived); and then the Second Law inequality from above.

It therefore follows that any net work *δw* done by the sub-system must obey

It is useful to separate the work *δw* done by the subsystem into the *useful* work *δwu* that can be done *by* the sub-system, over and beyond the work *pR dV* done merely by the sub-system expanding against the surrounding external pressure, giving the following relation for the useful work (exergy) that can be done:

It is convenient to define the right-hand-side as the exact derivative of a thermodynamic potential, called the *availability* or *exergy* *E* of the subsystem,

The Second Law therefore implies that for any process which can be considered as divided simply into a subsystem, and an unlimited temperature and pressure reservoir with which it is in contact,

i.e. the change in the subsystem's exergy plus the useful work done *by* the subsystem (or, the change in the subsystem's exergy less any work, additional to that done by the pressure reservoir, done *on* the system) must be less than or equal to zero.

In sum, if a proper *infinite-reservoir-like* reference state is chosen as the system surroundings in the real world, then the Second Law predicts a decrease in *E* for an irreversible process and no change for a reversible process.

This expression together with the associated reference state permits a design engineer working at the macroscopic scale (above the thermodynamic limit) to utilize the Second Law without directly measuring or considering entropy change in a total isolated system. (*Also, see process engineer*). Those changes have already been considered by the assumption that the system under consideration can reach equilibrium with the reference state without altering the reference state. An efficiency for a process or collection of processes that compares it to the reversible ideal may also be found (*See second law efficiency*.)

This approach to the Second Law is widely utilized in engineering practice, environmental accounting, systems ecology, and other disciplines.

For a spontaneous chemical process in a closed system at constant temperature and pressure without non-*PV* work, the Clausius inequality Δ*S > Q/Tsurr* transforms into a condition for the change in Gibbs free energy

# History

The first theory of the conversion of heat into mechanical work is due to Nicolas Léonard Sadi Carnot in 1824. He was the first to realize correctly that the efficiency of this conversion depends on the difference of temperature between an engine and its environment.

*Recognizing the significance of James Prescott Joule's work on the conservation of energy, Rudolf Clausius was the first to formulate the second law during 1850, in this form: heat does not flow *spontaneously* from cold to hot bodies. While common knowledge now, this was contrary to the caloric theory of heat popular at the time, which considered heat as a fluid. From there he was able to infer the principle of Sadi Carnot and the definition of entropy (1865).*

Established during the 19th century, the Kelvin-Planck statement of the Second Law says, "It is impossible for any device that operates on a cycle to receive heat from a single reservoir and produce a net amount of work." This was shown to be equivalent to the statement of Clausius.

The ergodic hypothesis is also important for the Boltzmann approach. It says that, over long periods of time, the time spent in some region of the phase space of microstates with the same energy is proportional to the volume of this region, i.e. that all accessible microstates are equally probable over a long period of time. Equivalently, it says that time average and average over the statistical ensemble are the same.

There is a traditional doctrine, starting with Clausius, that entropy can be understood in terms of molecular 'disorder' within a macroscopic system. This doctrine is obsolescent.^{[58]}^{[59]}^{[60]}

In 1856, the German physicist Rudolf Clausius stated what he called the "second fundamental theorem in the mechanical theory of heat" in the following form:^{[61]}

*where *Q* is heat, *T* is temperature and *N* is the "equivalence-value" of all uncompensated transformations involved in a cyclical process. Later, in 1865, Clausius would come to define "equivalence-value" as entropy. On the heels of this definition, that same year, the most famous version of the second law was read in a presentation at the Philosophical Society of Zurich on April 24, in which, in the end of his presentation, Clausius concludes:*

This statement is the best-known phrasing of the second law. Because of the looseness of its language, e.g. universe, as well as lack of specific conditions, e.g. open, closed, or isolated, many people take this simple statement to mean that the second law of thermodynamics applies virtually to every subject imaginable. This is not true; this statement is only a simplified version of a more extended and precise description.

In terms of time variation, the mathematical statement of the second law for an isolated system undergoing an arbitrary transformation is:

where

The equality sign applies after equilibration. An alternative way of formulating of the second law for isolated systems is:

The expression of the second law for closed systems (so, allowing heat exchange and moving boundaries, but not exchange of matter) is:

Here

The equality sign holds in the case that only reversible processes take place inside the system. If irreversible processes take place (which is the case in real systems in operation) the >-sign holds. If heat is supplied to the system at several places we have to take the algebraic sum of the corresponding terms.

For open systems (also allowing exchange of matter):

# Statistical mechanics

*Statistical mechanics gives an explanation for the second law by postulating that a material is composed of atoms and molecules which are in constant motion. A particular set of positions and velocities for each particle in the system is called a microstate of the system and because of the constant motion, the system is constantly changing its microstate. Statistical mechanics postulates that, in equilibrium, each microstate that the system might be in is equally likely to occur, and when this assumption is made, it leads directly to the conclusion that the second law must hold in a statistical sense. That is, the second law will hold on average, with a statistical variation on the order of 1/√*N* where *N* is the number of particles in the system. For everyday (macroscopic) situations, the probability that the second law will be violated is practically zero. However, for systems with a small number of particles, thermodynamic parameters, including the entropy, may show significant statistical deviations from that predicted by the second law. Classical thermodynamic theory does not deal with these statistical variations.*

# Derivation from statistical mechanics

The first mechanical argument of the Kinetic theory of gases that molecular collisions entail an equalization of temperatures and hence a tendency towards equilibrium was due to James Clerk Maxwell in 1860;^{[62]} Ludwig Boltzmann with his H-theorem of 1872 also argued that due to collisions gases should over time tend toward the Maxwell-Boltzmann distribution.

Due to Loschmidt's paradox, derivations of the Second Law have to make an assumption regarding the past, namely that the system is uncorrelated at some time in the past; this allows for simple probabilistic treatment. This assumption is usually thought as a boundary condition, and thus the second Law is ultimately a consequence of the initial conditions somewhere in the past, probably at the beginning of the universe (the Big Bang), though other scenarios have also been suggested.^{[63]}^{[64]}^{[65]}

The second part of the Second Law states that the entropy change of a system undergoing a reversible process is given by:

where the temperature is defined as:

See here for the justification for this definition. Suppose that the system has some external parameter, x, that can be changed. In general, the energy eigenstates of the system will depend on x. According to the adiabatic theorem of quantum mechanics, in the limit of an infinitely slow change of the system's Hamiltonian, the system will stay in the same energy eigenstate and thus change its energy according to the change in energy of the energy eigenstate it is in.

The average defining the generalized force can now be written:

Expressing the above expression as a derivative with respect to E and summing over Y yields the expression:

The first term is intensive, i.e. it does not scale with system size. In contrast, the last term scales as the inverse system size and will thus vanishes in the thermodynamic limit. We have thus found that:

Combining this with

Gives:

If a system is in thermal contact with a heat bath at some temperature T then, in equilibrium, the probability distribution over the energy eigenvalues are given by the canonical ensemble:

Here Z is a factor that normalizes the sum of all the probabilities to 1, this function is known as the partition function. We now consider an infinitesimal reversible change in the temperature and in the external parameters on which the energy levels depend. It follows from the general formula for the entropy:

that

# Living organisms

There are two principal ways of formulating thermodynamics, (a) through passages from one state of thermodynamic equilibrium to another, and (b) through cyclic processes, by which the system is left unchanged, while the total entropy of the surroundings is increased. These two ways help to understand the processes of life. This topic is mostly beyond the scope of this present article, but has been considered by several authors, such as Erwin Schrödinger, Léon Brillouin^{[66]} and Isaac Asimov. It is also the topic of current research.

To a fair approximation, living organisms may be considered as examples of (b). Approximately, an animal's physical state cycles by the day, leaving the animal nearly unchanged. Animals take in food, water, and oxygen, and, as a result of metabolism, give out breakdown products and heat. Plants take in radiative energy from the sun, which may be regarded as heat, and carbon dioxide and water. They give out oxygen. In this way they grow. Eventually they die, and their remains rot away, turning mostly back into carbon dioxide and water. This can be regarded as a cyclic process. Overall, the sunlight is from a high temperature source, the sun, and its energy is passed to a lower temperature sink, i.e. radiated into space. This is an increase of entropy of the surroundings of the plant. Thus animals and plants obey the second law of thermodynamics, considered in terms of cyclic processes. Simple concepts of efficiency of heat engines are hardly applicable to this problem because they assume closed systems.

From the thermodynamic viewpoint that considers (a), passages from one equilibrium state to another, only a roughly approximate picture appears, because living organisms are never in states of thermodynamic equilibrium. Living organisms must often be considered as open systems, because they take in nutrients and give out waste products. Thermodynamics of open systems is currently often considered in terms of passages from one state of thermodynamic equilibrium to another, or in terms of flows in the approximation of local thermodynamic equilibrium. The problem for living organisms may be further simplified by the approximation of assuming a steady state with unchanging flows. General principles of entropy production for such approximations are subject to unsettled current debate or research. Nevertheless, ideas derived from this viewpoint on the second law of thermodynamics are enlightening about living creatures.

# Gravitational systems

In systems that do not require for their descriptions the general theory of relativity, bodies always have positive heat capacity, meaning that the temperature rises with energy. Therefore, when energy flows from a high-temperature object to a low-temperature object, the source temperature is decreased while the sink temperature is increased; hence temperature differences tend to diminish over time. This is not always the case for systems in which the gravitational force is important and the general theory of relativity is required. Such systems can spontaneously change towards uneven spread of mass and energy. This applies to the universe in large scale, and consequently it may be difficult or impossible to apply the second law to it.^{[67]} Beyond this, the thermodynamics of systems described by the general theory of relativity is beyond the scope of the present article.

# Non-equilibrium states

The theory of classical or equilibrium thermodynamics is idealized. A main postulate or assumption, often not even explicitly stated, is the existence of systems in their own internal states of thermodynamic equilibrium. In general, a region of space containing a physical system at a given time, that may be found in nature, is not in thermodynamic equilibrium, read in the most stringent terms. In looser terms, nothing in the entire universe is or has ever been truly in exact thermodynamic equilibrium.^{[67]}^{[68]}

For purposes of physical analysis, it is often enough convenient to make an assumption of thermodynamic equilibrium. Such an assumption may rely on trial and error for its justification. If the assumption is justified, it can often be very valuable and useful because it makes available the theory of thermodynamics. Elements of the equilibrium assumption are that a system is observed to be unchanging over an indefinitely long time, and that there are so many particles in a system, that its particulate nature can be entirely ignored. Under such an equilibrium assumption, in general, there are no macroscopically detectable fluctuations. There is an exception, the case of critical states, which exhibit to the naked eye the phenomenon of critical opalescence. For laboratory studies of critical states, exceptionally long observation times are needed.

In all cases, the assumption of thermodynamic equilibrium, once made, implies as a consequence that no putative candidate "fluctuation" alters the entropy of the system.

It can easily happen that a physical system exhibits internal macroscopic changes that are fast enough to invalidate the assumption of the constancy of the entropy. Or that a physical system has so few particles that the particulate nature is manifest in observable fluctuations. Then the assumption of thermodynamic equilibrium is to be abandoned. There is no unqualified general definition of entropy for non-equilibrium states.^{[69]}

There are intermediate cases, in which the assumption of local thermodynamic equilibrium is a very good approximation,^{[70]}^{[71]}^{[72]}^{[73]} but strictly speaking it is still an approximation, not theoretically ideal. For non-equilibrium situations in general, it may be useful to consider statistical mechanical definitions of other quantities that may be conveniently called 'entropy', but they should not be confused or conflated with thermodynamic entropy properly defined for the second law. These other quantities indeed belong to statistical mechanics, not to thermodynamics, the primary realm of the second law.

Even though the applicability of the second law of thermodynamics is limited for non-equilibrium systems, the laws governing such systems are still being discussed. One of the guiding principles for systems which are far from equilibrium is the maximum entropy production principle.^{[74]}^{[75]} It states that a system away from equilibrium evolves in such a way as to maximize entropy production, given present constraints.^{[76]}

The physics of macroscopically observable fluctuations is beyond the scope of this article.

# Arrow of time

Thermodynamic Asymmetry in Time

The second law of thermodynamics is a physical law that is not symmetric to reversal of the time direction. This does not conflict with notions that have been observed of the fundamental laws of physics, namely CPT symmetry, since the second law applies statistically, it is hypothesized, on time-asymmetric *boundary conditions*.^{[77]}

The second law has been proposed to supply a partial explanation of the difference between moving forward and backwards in time, such as why the cause precedes the effect (the causal arrow of time).^{[78]}

# Irreversibility

Irreversibility in thermodynamic processes is a consequence of the asymmetric character of thermodynamic operations, and not of any internally irreversible microscopic properties of the bodies. Thermodynamic operations are macroscopic external interventions imposed on the participating bodies, not derived from their internal properties. There are reputed "paradoxes" that arise from failure to recognize this.

Loschmidt's paradox, also known as the reversibility paradox, is the objection that it should not be possible to deduce an irreversible process from the time-symmetric dynamics that describe the microscopic evolution of a macroscopic system.

In the opinion of Schrödinger, "It is now quite obvious in what manner you have to reformulate the law of entropy – or for that matter, all other irreversible statements – so that they be capable of being derived from reversible models. You must not speak of one isolated system but at least of two, which you may for the moment consider isolated from the rest of the world, but not always from each other."^{[79]} The two systems are isolated from each other by the wall, until it is removed by the thermodynamic operation, as envisaged by the law. The thermodynamic operation is externally imposed, not subject to the reversible microscopic dynamical laws that govern the constituents of the systems. It is the cause of the irreversibility. The statement of the law in this present article complies with Schrödinger's advice. The cause–effect relation is logically prior to the second law, not derived from it.

The Poincaré recurrence theorem considers a theoretical microscopic description of an isolated physical system. This may be considered as a model of a thermodynamic system after a thermodynamic operation has removed an internal wall. The system will, after a sufficiently long time, return to a microscopically defined state very close to the initial one. The Poincaré recurrence time is the length of time elapsed until the return. It is exceedingly long, likely longer than the life of the universe, and depends sensitively on the geometry of the wall that was removed by the thermodynamic operation. The recurrence theorem may be perceived as apparently contradicting the second law of thermodynamics. More obviously, however, it is simply a microscopic model of thermodynamic equilibrium in an isolated system formed by removal of a wall between two systems. For a typical thermodynamical system, the recurrence time is so large (many many times longer than the lifetime of the universe) that, for all practical purposes, one cannot observe the recurrence. One might wish, nevertheless, to imagine that one could wait for the Poincaré recurrence, and then re-insert the wall that was removed by the thermodynamic operation. It is then evident that the appearance of irreversibility is due to the utter unpredictability of the Poincaré recurrence given only that the initial state was one of thermodynamic equilibrium, as is the case in macroscopic thermodynamics. Even if one could wait for it, one has no practical possibility of picking the right instant at which to re-insert the wall. The Poincaré recurrence theorem provides a solution to Loschmidt's paradox. If an isolated thermodynamic system could be monitored over increasingly many multiples of the average Poincaré recurrence time, the thermodynamic behavior of the system would become invariant under time reversal.

*James Clerk Maxwell imagined one container divided into two parts, *A* and *B*. Both parts are filled with the same gas at equal temperatures and placed next to each other, separated by a wall. Observing the molecules on both sides, an imaginary demon guards a microscopic trapdoor in the wall. When a faster-than-average molecule from *A* flies towards the trapdoor, the demon opens it, and the molecule will fly from *A* to *B*. The average speed of the molecules in *B* will have increased while in *A* they will have slowed down on average. Since average molecular speed corresponds to temperature, the temperature decreases in *A* and increases in *B*, contrary to the second law of thermodynamics.*

One response to this question was suggested in 1929 by Leó Szilárd and later by Léon Brillouin. Szilárd pointed out that a real-life Maxwell's demon would need to have some means of measuring molecular speed, and that the act of acquiring information would require an expenditure of energy.

*Maxwell's 'demon' repeatedly alters the permeability of the wall between *A* and *B*. It is therefore performing thermodynamic operations on a microscopic scale, not just observing ordinary spontaneous or natural macroscopic thermodynamic processes.*

# Quotations

# See also

- Thermodynamic equilibrium
- Heat death of the universe
- Clausius–Duhem inequality
- Fluctuation theorem
- History of thermodynamics
- Jarzynski equality
- Quantum thermodynamics
- Laws of thermodynamics
- Maximum entropy thermodynamics
- Reflections on the Motive Power of Fire
- Thermal diode
- Relativistic heat conduction