Physics Tutor
Language: English

The Second Law of Thermodynamics and Entropy

Why heat flows from hot to cold, why a gas spreads out and never gathers back by itself, and how entropy, , gives time its direction.

Twenty gas molecules start in the left half of a box. When the wall is removed they spread through the whole box and practically never crowd back: the number W of possible arrangements, and with it the entropy S = k·ln W, rises and stays high.
Twenty gas molecules start in the left half of a box. When the wall is removed they spread through the whole box and practically never crowd back: the number W of possible arrangements, and with it the entropy S = k·ln W, rises and stays high.

Before this topic: First Law of Thermodynamics and Heat Engines

Beginner

Key ideas

  • On its own, heat always flows from hot to cold, until both are at the same temperature.
  • Left alone, things spread out and mix, but they never un-mix by themselves.
  • Entropy measures how spread out things are; for a system left completely alone it never goes down.
  • Spread-out arrangements win simply because there are vastly more of them than tidy ones, like five heads in ten coin tosses.
  • No engine can turn all of its heat into work: some energy always spreads out as waste heat.

Some things happen by themselves in only one direction.

Step 1: heat goes downhill. Leave a hot mug of cocoa on the table and it cools until it matches the room; the room never pushes heat back into the mug to make it hotter. Energy passes from the faster-jiggling molecules of the hot object to the slower ones of the cold object until both jiggle the same on average.

Step 2: things spread out. Spray perfume in one corner and soon the whole room smells of it. The molecules wander about at random, and they never gather back into the bottle by themselves.

Step 3: it is a matter of counting. Toss ten coins. Getting all ten heads can happen in only one way, but getting five heads and five tails can happen in 252 different ways. Molecules are like trillions of coins: tidy arrangements (all in one corner) are rare, spread-out ones are overwhelmingly common, so random motion lands in them and stays there.

Step 4: entropy. Physicists measure how spread out energy and matter are with a quantity called entropy. For a system left completely alone, entropy can only grow or stay the same. This is the second law of thermodynamics, and it gives time a direction: a film of a mug warming up by itself looks wrong.

The same law is why no engine can turn all its heat into work, and why a fridge needs a motor.

Check yourself: you drop an ice cube into warm lemonade. Which way does heat flow? Could it ever reverse by itself? (From the lemonade into the ice; no.)

In the animation, a wall keeps 20 molecules in the left half of a box. When it is removed they spread out until the bars show about 10 on each side, and they practically never all crowd back to the left.

Intermediate

Key ideas

  • Clausius: heat never flows by itself from cold to hot. Kelvin–Planck: no cycle turns all the heat of one reservoir into work.
  • Heat received reversibly at temperature changes entropy by ; in an isolated system .
  • : with 10 of 20 molecules on each side , with all on one side .
  • Heat pumps and fridges move heat from cold to hot only with work: .

Two statements of one law

Energy conservation alone would let a hot mug grow hotter by drawing heat from the cooler room. That never happens. The second law of thermodynamics picks out which energy-conserving processes really occur, in two classic statements:

The two are equivalent. If heat could leak by itself from cold to hot, an engine's waste heat could leak straight back to the hot reservoir, and heat from that reservoir alone would have become work; a perfect engine driving a refrigerator would break Clausius in turn. A refrigerator does move heat from cold to hot, but not by itself: a motor supplies work.

Entropy: heat divided by temperature

Entropy turns the law into arithmetic. When a body at a constant absolute temperature receives heat reversibly (slowly, without friction or temperature jumps), its entropy changes by

in joules per kelvin (J/K). Heat leaving a body is a negative . A reservoir is a body so large that its temperature does not change. The entropy of a reservoir changes by however the heat arrives.

The second law then says that in an isolated system, which exchanges neither heat nor work with its surroundings, the total entropy never decreases:

The equal sign holds only for idealised reversible processes. Friction, mixing and heat crossing a temperature gap all give , so they cannot run backwards by themselves.

When heat passes from a body at to one at , the hot body loses and the cold one gains :

This is positive exactly when , because a joule carries more entropy at a lower temperature: the Clausius statement in symbols.

Entropy as a count of arrangements

Why must the total grow? The answer is counting. A macrostate is what you see from outside, such as how many molecules are in each half of a box; a microstate is the full microscopic detail, such as which molecules are in which half. The number of microstates that look like one macrostate is its multiplicity, and

where is the Boltzmann constant.

With of the molecules on the left and on the right, the number of ways to choose which molecules are on the left is

Random motion visits every microstate equally often, so the gas spends nearly all its time near the macrostate with the largest .

Worked example: the gas in the animation

The box holds molecules, all on the left behind a wall: one way only, so and . This counts only the left-or-right part of the entropy; the rest does not change, because the temperature does not.

At the wall disappears. One molecule across gives ; five across give and ; ten on each side give

These are the values on the and readouts when the blue and green bars show 10 and 10. Once the gas is mixed, drifts between 7 and 12, so stays between 11.3 k and 12.1 k, never near zero.

Nothing pushes the gas: the gold arrows show three molecules flying straight and bouncing off the walls. Each molecule is equally likely to be in either half, so all assignments are equally likely, and all-on-the-left has probability , the middle line of the table. For 2 molecules it would be 1 in 4; for , zero for all practical purposes. Even ten and ten occurs only of the time, so the bars keep jiggling.

Worked example: a hotplate heating water

A hotplate at 600 K passes 1200 J of heat to a large pan of water at 300 K. Both keep their temperatures, so

The total rises by 2 J/K. The reverse transfer would give and is forbidden: the Clausius statement in numbers.

The 2 J/K measures lost work. An ideal engine between the same temperatures could have turned of the heat, 600 J, into work and rejected the other 600 J to the water, which would then gain only , exactly what the hotplate lost. Leaking directly throws away of possible work. Each joule per kelvin created beside surroundings at wastes joules of work.

Heat pumps and refrigerators

A heat pump uses work to take heat from a cold place and deliver to a warm one: a narrow heat arrow in from the cold side, a work arrow from the motor, a broad heat arrow out into the house. The warm side must gain at least the entropy the cold side loses, , which caps the coefficient of performance:

For a house at 20 °C and outdoor air at 0 °C, and : at most joules of heat per joule of electricity. A refrigerator across the same gap could remove at most joules per joule. Real machines reach 3 to 4, which is still three to four times the heat an electric heater gives. On a −20 °C day the limit falls to .

Common mistakes

Where you meet it

Power stations are heat engines bound by the second law: coal and nuclear plants turn only 33–45 % of their heat into electricity. Fridges, air conditioners and heat pumps run the same cycle backwards. The Earth absorbs sunlight emitted at about 5800 K and returns the same energy to space as infrared at about 255 K, exporting some 20 times more entropy than it receives; that outflow drives weather and life.

The Carnot efficiency comes from First Law of Thermodynamics and Heat Engines, and the speed distribution of Kinetic Theory of Gases is the one with the greatest entropy at a given energy. Counting ways to share energy with gave the first quantum formula, in Blackbody Radiation and the Quantum.

Advanced

Key ideas

  • ; the Clausius inequality makes a state function with when isolated.
  • Free expansion: , yet , evaluated along a reversible isotherm.
  • : doubling the room multiplies by ; the peak of has relative width about .
  • A ratchet and pawl at one temperature cannot turn thermal jiggling into work; it runs only as a heat engine between two temperatures.
  • The laws are time-reversible; irreversibility comes from a low-entropy start (the early universe) and the huge count of high- states.

From Carnot's postulate to entropy

This section builds entropy from a single experimental fact, so that is not merely defined but shown to exist. The fact is Carnot's postulate in its modern form: no cycle can take heat at one temperature and turn it into work with no other change. The lesson First Law of Thermodynamics and Heat Engines drew two consequences from it. All reversible engines working between the same two temperatures have the same efficiency, and that common efficiency defines the absolute temperature . A reversible engine that takes heat at and rejects at therefore obeys

Read this as a conservation rule: a reversible engine passes the quantity from the hot reservoir to the cold one unchanged. Entropy is that quantity, made into a property of the working substance.

Figure 1
Figure 1. A reversible cycle drawn as a loop on the – diagram, cut into thin strips by dashed adiabats. The purple strip is a small Carnot cycle: it takes in at and gives out at , with . Not to scale.
Legend
Pressure of the gas.
Volume of the gas.
Temperature at the hot end of the strip.
Temperature at the cold end of the strip.
Heat taken in along the hot end, at .
Heat given out along the cold end, at .
Step in entropy between the two adiabats that bound the strip: , which equals .

Figure 1 extends the rule from a two-temperature engine to any reversible cycle, drawn as an arbitrary closed loop on the – diagram. The trick is to slice the loop with adiabats, the curves along which a gas changes state without exchanging heat; the dashed curves are a few of a dense family. Look at the purple strip between two neighbouring adiabats, drawn far wider than it really needs to be. Its long sides are adiabats, so no heat crosses them. Its short ends are tiny pieces of the loop: the hot end at the upper left, at temperature , and the cold end at the lower right, at . Each end is so short that its temperature hardly changes along it, so it acts as an isotherm.

Two adiabats and two isotherms make a Carnot cycle, so the strip is a small Carnot engine: it takes in at , gives out at , and by the rule above

This common value, marked inside the strip, depends only on which two adiabats bound the strip, not on where the loop happens to cross them.

Now add up all the strips. Together they trace the loop: each inner adiabat is run once in each direction by the two strips that share it, so those legs cancel, and the ends join up into the outline of the loop. Counting heat as positive when it enters the gas, every strip contributes , so for the whole loop

A quantity whose integral round every closed path vanishes has the same integral along every path between two given states. That integral is therefore the change of a function of state, the entropy , with

and the adiabats are the curves of constant . Heat itself is not a function of state, because the heat a gas absorbs between two states depends on the path. Dividing by repairs this: is the integrating factor that turns into the exact differential .

What changes when a process is irreversible? An engine with friction, or with heat leaking across a finite temperature difference, delivers less work than a reversible engine from the same . By energy conservation it then rejects more heat, so . For a general cycle, imagine every heat the system receives being supplied, at the temperature where it enters, by a small reversible engine fed from one large reservoir at . That engine draws from the reservoir. Over a cycle everything returns to its starting state, so the net heat drawn from that single reservoir has all become work. Carnot's postulate forbids this to be positive, which gives the Clausius inequality

Here is the temperature of the reservoir that supplies each , since a system out of equilibrium need not have one temperature of its own; equality holds only for a reversible cycle.

Apply the inequality to a cycle that goes from state a to state b by any process and comes back reversibly. The reversible return contributes , so

An isolated system takes in no heat at all, so for it : its entropy can grow or stay the same, never fall. That is the second law in its most general form.

The Carnot limits as an entropy balance

Every limit on engines, heat pumps and refrigerators follows from one balance. Over a full cycle the working substance returns to its starting state, so its own entropy change is zero. Only the reservoirs' entropy changes, and the second law requires their total change to be zero or positive.

Figure 2
Figure 2. Entropy bookkeeping for a heat engine on a – diagram, where heats are areas. The cold reservoir gains more entropy, , than the hot one loses, ; the purple strip, of area , is the work lost. Drawn for and half the Carnot work.
Legend
Entropy, along the horizontal axis.
Absolute temperature, along the vertical axis.
Temperature of the hot reservoir.
Temperature of the cold reservoir.
Heat taken from the hot reservoir: the area of the tall rectangle, of height .
Heat given to the cold reservoir: the area of the lower rectangle, blue and purple together.
Entropy lost by the hot reservoir: the width of the tall rectangle.
Entropy gained by the cold reservoir: the width of the lower rectangle.
Entropy created in total, : the width of the purple strip that sticks out.
Area of the purple strip: the extra heat rejected, which is the work lost when the surroundings are at .

Figure 2 keeps this account on a – diagram, temperature up and entropy across. The point of this choice is that heat exchanged at a fixed temperature moves an entropy , so it can be drawn as a rectangle of height and width , whose area is : heats become areas. The engine takes from the hot reservoir at , rejects to the cold reservoir at , and delivers the work .

Now read the figure. The tall rectangle has height and width , the entropy the hot reservoir loses, so its area is . The lower rectangle, blue and purple together, has height and width , the entropy the cold reservoir gains, so its area is . The total entropy change is

so the lower rectangle must be at least as wide as the tall one. A reversible engine makes the two exactly as wide, up to the dashed line. The real engine drawn overshoots: the purple strip that sticks out has width , the entropy created, and area , the heat dumped into the cold reservoir beyond what a reversible engine would dump.

The work is what is left of after has been paid out. For a reversible engine it is the part of the tall rectangle above the level , the fraction of , and no engine can do better. The engine drawn, with , also loses the purple area: its surplus width is half of , so the lost area is a quarter of , and it delivers half the Carnot work. In symbols, means , hence

Run the cycle backwards and the work pumps the heat out of the cold side and delivers to the hot side. Now the hot side gains entropy and the cold side loses it, and the same balance, , caps the coefficients of performance of a heat pump and of a refrigerator:

Irreversibility therefore has a price in work. In a device that keeps running, the entropy created cannot pile up inside it; it must leave as heat into the surroundings at , and that heat, , is energy a reversible process would have delivered as work:

In Figure 2 the cold reservoir plays the surroundings, , and the lost work is exactly the purple area. Engineers use this rule to find the waste in a power station: combustion, and the large drop in temperature from the flame to the boiler water, create most of the entropy, so they cost most of the work.

Free expansion: entropy without heat

Entropy can grow with no heat at all, and this case is the classic trap. The gas in the animation expands into a vacuum. It pushes against nothing, so it does no work, and no heat crosses the walls, so . The energy of an ideal gas depends only on its temperature, so the temperature stays the same. Yet nobody ever sees the gas gather itself back into one half: the process is irreversible, and must rise. Writing is the mistake, because that integral gives only along a reversible path, and a free expansion is not one.

Figure 3
Figure 3. The reversible isotherm joining the same end states 1 and 2 as the free expansion. The strip of height and width has area and adds ; the whole area under the curve is the heat .
Legend
Pressure of the gas.
Volume of the gas.
Volume in state 1, before the expansion.
Volume in state 2, after it.
Temperature of the gas, constant along the curve, which is the isotherm .
Width of one thin strip: a small step in volume.
Area of the strip: the work done in that step, which equals the heat taken in.
Heat taken in over the whole path: the area under the curve, .

Because is a function of state, its change can be computed along any reversible path that joins the same two end states. Figure 3 draws the convenient one: a slow isothermal expansion against a piston, for an ideal gas at temperature . The curve is the isotherm , from state 1 at volume to state 2 at . The free expansion itself cannot be drawn on this diagram: between its end states the gas is churning, out of equilibrium, and has no single pressure.

Look at the thin strip of width . Over that step the pressure is , so the gas does the work , the area of the strip. The temperature, and with it , stays fixed, so by the first law the gas takes in exactly that much heat, ; the whole area under the curve is the total heat . Each strip adds to the entropy. Substituting makes cancel:

With , where is the number of molecules and is Boltzmann's constant,

The free expansion has exactly this entropy change, although it took in no heat. Doubling the volume adds per molecule: for a mole, and for the 20 molecules in the animation's box.

The same recipe handles a change of temperature. Along a reversible path the first law gives , where is the molar heat capacity at constant volume. Dividing by ,

so an ideal gas with constant has . For a liquid, whose volume hardly changes, only the first term matters: a mass with specific heat capacity , heated from to , gains . Warming 1 kg of water from 20 °C to 80 °C adds , with the temperatures in kelvin.

Counting microstates: the graph and the histogram

Thermodynamics says how much entropy changes; counting says why. A macrostate is what we observe, here how many molecules are in each half of the box. A microstate is the full detail: which molecule is where. Boltzmann's relation ties entropy to , the number of microstates that look like the same macrostate:

Doubling the volume doubles the number of places open to each molecule, so grows by a factor and , exactly the thermodynamic result. Requiring the two to agree is what fixes Boltzmann's constant, .

Counting also explains why heat flows from hot to cold, the Clausius statement of the second law. At fixed volume , so one joule changes by . A joule leaving a hot body therefore lowers its by less than the same joule raises the of a cold body. The flow increases the total number of microstates, which is why it is overwhelmingly what happens.

Figure 4
Figure 4. Twenty molecules, of them in the left half of the box. Below, the number of microstates of each split peaks at ; above, forms a dome whose top lies below the line .
Legend
Number of molecules in the left half of the box.
Number of microstates of the macrostate with molecules on the left: , with .
Width of the peak: the standard deviation of . The arrow ends at .
Entropy of the macrostate in units of , equal to .
Value of for all microstates together: the dashed line.
Gap between the top of the dome and , from Stirling's formula.

Figure 4 unpacks the two panels of the animation for molecules. Both parts of the figure share the horizontal axis , the number of molecules in the left half. Start with the histogram at the bottom. The bar over each has height , the number of ways to choose which molecules are on the left. It is 1 at both ends, since all-left and all-right can each happen in only one way, and it is largest, 184 756, at . The peak is binomial, with standard deviation ; the arrow runs from the centre to . Relative to the mean that width is , which is why the animation's blue dot stays near the top of the histogram yet keeps jiggling, between about 7 and 12.

The upper part plots the entropy of each of those macrostates, . Taking the logarithm flattens the sharp peak into a dome: zero at both ends, broad and flat at the top. The animation's graph reads this dome as changes with time: zero until the wall is removed at 1.8 s, a climb lasting about 3 s, then a plateau near 12 that never comes back down.

Why does the plateau sit below the dashed line ? The dashed line is , which counts all microstates of the gas, every split included; the top of the dome counts only those of the single likeliest split. The bracket in the figure marks the gap, and Stirling's formula, , gives its size:

For this is , against the exact 12.13. The gap grows only like , whereas grows like : for molecules the correction is about 27 against , utterly negligible.

The dome also gives probabilities. Every microstate is equally likely, so a macrostate with microstates has probability . Each of entropy below , the entropy of all microstates together, costs a factor ; the all-left state, with , has probability . For the molecules in a cubic centimetre of air the relative width is : the histogram becomes a spike, and the gas is never seen far from an even split.

Can thermal jiggling be harvested?

If molecules never stop jiggling, why not harvest that motion? Picture a tiny toothed wheel held by a spring-loaded pawl that lets it turn only forwards, on an axle that also carries vanes standing in a gas. Molecules strike the vanes from both sides, and the pawl seems to keep only the forward kicks. It fails. The pawl is just as small, so at the same temperature it is shaken too: now and then it lifts just as the wheel is kicked backwards, and on average the slips exactly cancel the steps. With the vanes hotter than the pawl the wheel does turn, but then the device is a heat engine working between two temperatures, bound by .

Maxwell's demon fails more subtly. It is a being that opens a trapdoor between the two halves only for fast molecules, sorting hot from cold without doing work. To decide, it must measure and record each molecule's speed, and its memory fills up. To keep going it must erase old records, and erasing one bit at temperature costs at least of work, at 300 K. This is Landauer's principle; the entropy the erasure creates is at least the entropy the sorting removed. Information is physical, and this cost has been measured with single colloidal beads.

Worked problem: three ways to double a volume

One mole of ideal gas at 300 K, in contact with a large reservoir at 300 K, doubles its volume. The gas always ends in the same state, at the same temperature with twice the volume, so its entropy change is always . Since , the heat drawn from the reservoir equals the work the gas does, and the reservoir loses the entropy . Compare three methods.

The work missing, compared with the reversible method, is each time: , all of it, for the free expansion, and , exactly , for the sudden one. The gas's own entropy change is the same in all three; the entropy change of everything together is not, and it measures the waste. For the 20 molecules of the animation the lost work at 300 K is .

Limits of validity and the arrow of time

The second law is statistical: effectively certain for very many particles, only a strong tendency for a few. In the box, all 20 molecules back on the left has probability at any moment. Fluctuation theorems make this precise: over a short time, histories that destroy an entropy are times rarer than those that create it. Beads a few micrometres across, held in optical traps, show such entropy-consuming stretches; for everyday processes is or more, and they never happen.

Thermodynamic entropy belongs to equilibrium states. For a gas that is still spreading, the value depends on how coarse the description is, here halves only. Counting also needs quantum mechanics: phase-space cells have a size set by Planck's constant, and identical molecules must not be counted as different, or mixing two samples of the same gas would seem to create entropy (the Gibbs paradox). As , tends to a constant, zero for a perfect crystal: the third law. Gravity reverses the everyday intuition: a self-gravitating gas raises its entropy by clumping into stars.

Finally, the arrow of time. Apart from a tiny asymmetry in some weak decays, the laws governing the collisions work equally well backwards: reverse every velocity and the gas would gather back on the left. Irreversibility comes from the starting point, a state of very low entropy from which almost every trajectory leads to higher . Our world's starting point goes back to the early universe, whose matter was spread almost perfectly evenly, a very low-entropy state for gravitating matter.

Where this leads

In Blackbody Radiation and the Quantum, Planck derived his radiation law in 1900 by counting the ways to share energy quanta among oscillators with ; the formula is carved on Boltzmann's tombstone in Vienna. The latent heats of Phase Changes and Latent Heat are entropy changes in disguise: is 1223 J/K for each kilogram of ice that melts. A heat flow through a wall, as in Conduction, Convection and Radiation, creates entropy at the rate . Black holes, treated in Gravity as Curved Spacetime, carry an entropy proportional to the area of their horizon. And information in bits, , is the general entropy in other units.

Key formulas

Entropy change for heat exchanged reversibly

Heat added slowly at a fixed absolute temperature raises a body's entropy by the heat divided by that temperature. The same joule counts for more at a low temperature, which is why heat flowing from hot to cold raises the total. Heat leaving the body is a negative and lowers its entropy.

Symbols
entropy change of the body
heat received (negative if given out)
absolute temperature at which the heat is exchanged

When it holds: For heat exchanged reversibly at constant , and for any heat entering or leaving a reservoir. If changes, integrate ; in an irreversible process exceeds .

Example: The pan of water at 300 K receiving 1200 J: .

Second law: the total entropy of an isolated system

Whatever happens inside an isolated system, the entropies of its parts add up to a total that can only grow or, in the reversible limit, stay the same. A part can lose entropy, as water does when it freezes, provided other parts gain at least as much. The inequality fixes the direction of every spontaneous process.

Symbols
change of the total entropy of all the parts

When it holds: For an isolated system, or for a system together with all the surroundings it interacts with. The law is statistical: for a handful of molecules, brief decreases do occur but are rare.

Example: Heat leaking from a hotplate at 600 K into water at 300 K: .

Entropy created by heat flowing from hot to cold

The cold body gains and the hot body loses . Since , the gain is larger and the total rises; the reverse flow would lower it, which is the Clausius statement. The entropy created measures the work lost by letting the heat flow without an engine.

Symbols
total entropy change of the two bodies
heat transferred
temperature of the colder body
temperature of the hotter body

When it holds: For bodies large enough to keep their temperatures. Bodies that warm or cool as the heat flows need for each one instead.

Example: 1200 J from 600 K to 300 K: ; an ideal engine could have turned 600 J of that heat into work.

Boltzmann's entropy

Entropy is times the natural logarithm of the number of microstates that look like the observed macrostate. The logarithm makes entropy additive, because the microstate counts of independent systems multiply. Systems drift towards macrostates with larger simply because there are more ways to be in them.

Symbols
entropy of the macrostate
Boltzmann constant,
number of microstates of the macrostate

When it holds: When all microstates are equally likely, as in an isolated system in equilibrium; in general . A classical depends on the size of the cells used for counting, so only differences of are meaningful.

Example: Ten of 20 molecules on each side: and .

Number of ways to share N molecules between two halves

There are ways to put the molecules in order; the order within each half does not matter, so divide by and . The result, a binomial coefficient, is 1 when all molecules are on one side and largest for an even split. Summed over all splits it gives , the total number of left–right assignments.

Symbols
number of microstates of the macrostate
total number of molecules
number of molecules in the left half
number of molecules in the right half,

When it holds: Counts only which half each molecule is in, for halves of equal size and independent molecules (an ideal gas).

Example: : for 20 and 0, for 15 and 5, for 10 and 10.

Entropy change of an ideal gas at constant temperature

In a slow isothermal expansion the gas absorbs heat equal to the work it does, ; dividing by gives the entropy change. Because is a state function, the result holds for any process between the same end states, including a free expansion with no heat at all. The second form is the counting view: the room open to each molecule grows by the factor .

Symbols
entropy change of the gas
amount of gas
molar gas constant,
final volume
initial volume
number of molecules
Boltzmann constant
temperature of the gas, the same at the start and at the end

When it holds: For an ideal gas whose initial and final temperatures are equal. If the temperature changes too, add , where is the molar heat capacity at constant volume.

Example: One mole doubling its volume: ; for the 20 molecules of the animation, .

Coefficient of performance of a heat pump

A heat pump uses work to lift heat from a cold place into a warm one, delivering . Because it adds the work to heat that already exists outdoors, its COP exceeds 1. The upper limit comes from requiring that the warm side gain at least the entropy the cold side loses, .

Symbols
coefficient of performance (heat delivered per unit of work)
heat delivered to the warm side
work supplied
absolute temperature of the warm side
absolute temperature of the cold side

When it holds: The equality needs an ideal reversible machine; real heat pumps reach 3 to 4 in mild weather. Temperatures must be in kelvins, although their difference is the same in °C.

Example: House at 20 °C, outdoor air at 0 °C: .

Coefficient of performance of a refrigerator

A refrigerator is the same machine with another goal: the useful output is the heat removed from the cold inside. Because , its limit is exactly 1 less than the heat pump's across the same gap. The narrower the gap, the more heat each joule of work can remove.

Symbols
coefficient of performance (heat removed per unit of work)
heat removed from the cold side
work supplied
absolute temperature of the cold side
absolute temperature of the warm side

When it holds: Reached only by an ideal reversible refrigerator. It falls quickly as the gap grows and tends to zero as approaches absolute zero.

Example: A freezer at −18 °C in a kitchen at 20 °C: .

Glossary

Second law of thermodynamics
The law that fixes which way natural processes run: the total entropy of an isolated system never decreases, . Energy conservation allows a process and its reverse alike; the second law allows only one of them.
Clausius statement
Heat never flows by itself from a colder body to a hotter one. A refrigerator does move heat that way, but only because work is supplied.
Kelvin–Planck statement
No engine working in a cycle can take heat from a single reservoir and turn all of it into work: some heat must go to a colder body. It is equivalent to the Clausius statement.
Isolated system (thermodynamics)
A system that exchanges neither energy nor matter with anything outside. The second law forbids a decrease of entropy only for such a system, or for a system and its surroundings taken together.
Heat reservoir
A body so large that heat going in or out does not change its temperature, such as the atmosphere or the sea. Its entropy changes by whatever the process.
Reversible process
An idealised process that runs slowly, without friction and with heat crossing only vanishing temperature differences, so that a tiny change could run it backwards. It creates no entropy: .
Irreversible process
A real process that cannot be undone without leaving a change elsewhere, such as heat crossing a temperature gap, friction, mixing or free expansion. It creates entropy: .
Entropy
A function of state, in J/K, that grows by when heat is added reversibly and that counts microstates, . Often called disorder, it really measures how many microscopic arrangements fit what is seen from outside.
Microstate
A complete microscopic description of a system, for example which half of the box each of the 20 molecules is in. In equilibrium every accessible microstate is equally likely.
Macrostate
What can be observed from outside, for example only how many molecules are in each half. With 10 molecules on each side one macrostate covers 184 756 microstates; with all 20 on the left, just one.
Free expansion
Expansion of a gas into a vacuum, with no heat exchanged and no work done. For an ideal gas the temperature stays the same, yet the entropy rises by .
Arrow of time
The one-way direction of everyday processes, set by the growth of entropy. The microscopic laws work equally well backwards; the arrow comes from a low-entropy starting state.
Quantities
Entropy times the logarithm of the number of microstates, or the sum of along a reversible path. In most problems only its changes matter, such as for moles of ideal gas going from volume to (in ) at a fixed temperature.
Total entropy changeThe entropy change of everything involved in a process, taken together. It is zero for a reversible process and positive for every real one: +2 J/K for the hotplate heating water.
HeatEnergy transferred because of a temperature difference; positive when it enters the body being described, negative when it leaves. and are the heats exchanged with the hot and the cold side, as positive amounts.
Absolute temperatureTemperature counted from absolute zero: 20 °C is 293.15 K. Every and every Carnot limit needs it. and are the temperatures of the hot and the cold side.
Boltzmann constant, the gas constant per molecule, . It converts the count into thermodynamic units. Per mole it becomes the gas constant , so .
Number of microstatesHow many microscopic arrangements give the same macrostate; here it is not work. In the animation it ranges from 1 (all on the left) to 184 756 (ten and ten).
Number of molecules20 in the animation, about in a mole: the reason fluctuations vanish in everyday life.
Molecules in the left halfThe macrostate variable of the animation; the other molecules are in the right half.
Coefficient of performanceHeat moved per unit of work: for a heat pump, for a refrigerator. It can exceed 1; heating at 20 °C from air at 0 °C caps it at about 14.7.
Work inputThe work, usually electrical, that drives a heat pump or a refrigerator. Not to be confused with , the number of microstates.

Quiz

  1. Beginner A hot cup of tea is left on a table in a cool room. What happens?

    1. The tea gets even hotter by taking heat from the cooler air
    2. The tea cools down until it reaches room temperature
    3. The tea keeps its temperature, because a cup holds the heat in
    4. The room cools down while the tea warms up
    Show answer

    Answer: B. The tea cools down until it reaches room temperature

    On its own, heat flows only from hot to cold, so the tea gives heat to the room until both are at the same temperature. The reverse never happens by itself.

  2. Beginner In the animation, the wall is removed and the gas fills the whole box. Why do the molecules practically never all crowd back into the left half on their own?

    1. A force pushes them towards the right
    2. They slow down and run out of energy
    3. There are vastly more ways to be spread out than to be all on one side
    4. The left half has become too hot for them
    Show answer

    Answer: C. There are vastly more ways to be spread out than to be all on one side

    Nothing pushes the molecules: they just move at random. Spread-out arrangements vastly outnumber the single all-on-the-left one, so random motion almost never finds it. For 20 molecules the chance is about one in a million at any moment.

  3. Beginner An inventor claims a ship engine that takes heat from the sea water and turns all of it into motion, with no waste heat at all. What is wrong with the idea?

    1. Nothing: the sea holds plenty of heat, so it would work
    2. It breaks energy conservation, because heat is not a form of energy
    3. It fails only because of friction, which a cleverer design could remove
    4. Some heat must go to something colder; no engine turns all its heat into work
    Show answer

    Answer: D. Some heat must go to something colder; no engine turns all its heat into work

    Energy would be conserved, but the second law is broken: an engine turns heat into work only while heat flows from a hot place to a colder one, and some of it must end up on the cold side. With the sea as its only source, the engine cannot run.

  4. Intermediate 500 J of heat flows from a body at 500 K into a body at 250 K. What is the total change in entropy of the two bodies?

    1. 0 J/K
    2. −1 J/K
    3. +1 J/K
    4. +3 J/K
    Show answer

    Answer: C. +1 J/K

    The hot body loses 500/500 = 1 J/K and the cold one gains 500/250 = 2 J/K, so ΔS_total = 2 − 1 = +1 J/K. Adding the two terms (3 J/K) forgets that the hot body loses entropy; 0 J/K would mean entropy is conserved, which it is not.

  5. Intermediate Which statement is a correct form of the second law of thermodynamics?

    1. Energy can be neither created nor destroyed
    2. Heat cannot flow by itself from a colder body to a hotter one
    3. The entropy of every object always increases
    4. A refrigerator cannot move heat from cold to hot
    Show answer

    Answer: B. Heat cannot flow by itself from a colder body to a hotter one

    That is the Clausius statement. The first option is the first law; the entropy of one object can fall if more is produced elsewhere; and a refrigerator does move heat from cold to hot, but only because work is supplied.

  6. Intermediate A heat pump keeps a house at 20 °C while the outdoor air is at 0 °C. What is the largest possible coefficient of performance (heat delivered per unit of work)?

    1. About 14.7
    2. About 13.7
    3. At most 1, because energy is conserved
    4. About 0.07
    Show answer

    Answer: A. About 14.7

    COP_max = T_h/(T_h − T_c) = 293.15/20 ≈ 14.7. It exceeds 1 without breaking energy conservation, because the pump moves heat that already exists outdoors. 13.7 is the limit for a refrigerator, T_c/(T_h − T_c), and 0.07 is the ratio upside down.

  7. Advanced In the free expansion of the animation, the gas exchanges no heat (Q = 0). How can its entropy increase?

    1. It cannot: ΔS = Q/T = 0, so the entropy stays the same
    2. Its temperature rises, so ΔS = C·ln(T₂/T₁) > 0
    3. Removing the wall does work on the gas, which adds entropy
    4. S is a state function: a reversible path between the same states gives nR·ln(V₂/V₁)
    Show answer

    Answer: D. S is a state function: a reversible path between the same states gives nR·ln(V₂/V₁)

    ΔS = ∫δQ/T holds only for reversible processes; for an irreversible one ΔS > ∫δQ/T. A reversible isothermal expansion between the same end states gives ΔS = nR·ln 2 for a doubled volume. The temperature of an ideal gas does not change in a free expansion, and no work is done.

  8. Advanced In the S(t) graph of the animation, S/k levels off near 12.1, a little below the dashed line N·ln 2 ≈ 13.9. Why?

    1. The plateau is ln C(20, 10) ≈ N·ln 2 − ½·ln(πN/2), and the gap only matters for small N
    2. Some energy is lost in collisions with the walls, so S cannot reach N·ln 2
    3. The animation stops before the gas has had time to reach equilibrium
    4. Entropy can approach its maximum but never reach it in a finite time
    Show answer

    Answer: A. The plateau is ln C(20, 10) ≈ N·ln 2 − ½·ln(πN/2), and the gap only matters for small N

    S/k counts only the arrangements of the most likely macrostate, ln C(20, 10) = 12.1, while N·ln 2 = 13.9 counts all 2²⁰ arrangements. By Stirling's formula the difference is ½·ln(πN/2) ≈ 1.7, which is negligible next to N·ln 2 when N ≈ 10²³.