Thermodynamics and statistical mechanics / personal lessonsLesson 7 of 13
Thermodynamics · Lesson 7

Account for entropy across the boundary

Energy conservation does not determine the direction of heat flow. Entropy accounting adds the missing constraint.

By the end: calculate reservoir entropy changes and explain how an object can lose entropy without violating the second law.

Separate entropy transfer from generation

Entropy S is a state function with units joules per kelvin. For a reversible heat transfer at constant temperature, its change is heat input divided by absolute temperature. If temperature varies, divide each small reversible heat increment by its own temperature and add. This is a way to calculate a state difference; it does not require the actual process to have been reversible.

The second law says that the entropy of an isolated total does not decrease in a macroscopic thermodynamic process. Equivalently, entropy generation is nonnegative. A subsystem can lose entropy by exporting it. During a reversible process the total entropy generation is zero, although individual parts can exchange entropy. Entropy is not a conserved material like the energy in our first-law account. At fixed volume and particle number, inverse temperature measures how much equilibrium entropy increases per small added energy. A colder ordinary system gains more entropy per joule, which connects the microscopic counting picture to the direction of thermal contact.

Follow entropy through a chosen boundary

Consider two reservoirs joined by thermal contact inside an otherwise insulated, rigid enclosure. Choose the hot reservoir alone first. Heat leaves, so Q is negative and entropy falls. Choose the cold reservoir instead. The same energy gives positive Q and an entropy increase. Finally enclose both. No heat crosses that outer boundary. Internal energy stays constant, but the total entropy can increase because the internal transfer is irreversible.

The outer boundary matters to the second law as much as it did to the first. Closed means that matter cannot cross; it does not forbid energy or entropy transfer. Isolated means that neither matter nor energy crosses. Only for the isolated total can you immediately require a nonnegative entropy change without adding an external entropy account. A cooling block can be closed and still lose entropy. Calling that block the entire universe would omit the surroundings that receive its released energy.

One transfer crosses two inner boundaries

Isolated total: Q = 0, W = 0Hot reservoir, 600 KΔU = −1,000 JΔS = −1.667 J/KCold reservoir, 300 KΔU = +1,000 JΔS = +3.333 J/K1,000 JTotal ΔS = +1.667 J/K
Schematic boundaries, not scaled reservoir sizes. The combined rigid, insulated enclosure receives no heat or work. Internal energy changes cancel; entropy changes do not.

For a small reversible addition of energy at fixed volume and fixed amount, divide the added energy by absolute temperature to find the entropy increase. A 2 J addition at 200 K gives approximately 0.010 J/K; at 400 K it gives approximately 0.005 J/K. These comparisons concern the local slope of equilibrium entropy versus internal energy. They do not say that the colder body contains more entropy overall, or that its temperature measures its total energy inventory.

That slope explains the direction of ordinary thermal contact. Suppose 2 J moves from the 400 K body to the 200 K body, with temperatures changing negligibly. The hot body loses about 0.005 J/K and the cold one gains about 0.010 J/K. The combined change is positive. Reverse the same isolated transfer and the sign becomes negative. Conservation alone accepts either direction, since one energy loss equals the other gain. Entropy distinguishes the directions under these macroscopic assumptions.

The colder body's entropy rises more per added joule

Entropy increment, J/K0.0000.0050.010200 K: ΔS ≈ ΔU / 200 K400 K: ΔS ≈ ΔU / 400 K012Added internal energy, J
Local linear approximations at fixed volume and amount. Both slopes use the same axes and the same 2 J increment. Temperatures change negligibly; this is not a full entropy curve.

Entropy entering with heat and entropy generated internally have different roles. For a closed system, its entropy change equals the entropy transferred across its boundary plus nonnegative generation. At one uniform boundary temperature, a small heat input contributes that input divided by the boundary's kelvin temperature. With several contacts, account for each contact separately. A subsystem can export more entropy than it generates and therefore finish with less entropy. An insulated closed system has no heat contribution, but it can still generate entropy.

Work also crosses boundaries, but it is not an entropy transfer of the form work divided by temperature. Friction can turn mechanical work into internal energy and generate entropy inside the chosen system. In contrast, reversible insulated compression changes a gas's energy and temperature while keeping its entropy constant. These cases prevent an energy-only shortcut. Before deciding whether entropy must rise, identify what crosses the boundary, where irreversibility occurs, and whether your chosen total includes the receiving surroundings.

Use reservoirs to make the arithmetic explicit

A thermal reservoir is an idealized body large enough that the chosen heat transfer does not appreciably change its temperature. Let 1,000 J pass directly from a 600 K reservoir to a 300 K reservoir with no work output. The hot reservoir loses about 1.667 J/K and the cold one gains about 3.333 J/K. Their total rises by about 1.667 J/K although the energy lost by one exactly equals the energy gained by the other.

The same energy carries a larger entropy change at the lower temperature. Reversing those two transfers without another change would decrease the combined entropy, so it cannot be the sole effect of an ordinary cyclic device. A refrigerator is possible because it also requires work and rejects additional heat. The animation advances cumulative transferred heat in 200 J increments. Its playback clock is not a physical conduction-rate calculation.

Compare equal energy transfers at different temperatures

Use the reservoir model to separate three quantities that often get combined. The transferred energy is measured in joules. Each reservoir's entropy change is measured in joules per kelvin. The sum of those changes is entropy generation for the isolated pair. For the 600 K and 300 K pair, every 200 J transferred removes one third of a joule per kelvin from the hot reservoir and adds two thirds to the cold reservoir. Their difference is a positive one third.

Five identical increments give the 1,000 J result because reservoir temperatures stay fixed. Doubling transferred energy doubles each entropy change, leaving entropy produced per joule unchanged. This linearity belongs to fixed-temperature reservoirs. A finite block does not have this property throughout a substantial cooling interval. Its later energy transfers occur at a different temperature, so their entropy contributions per joule differ from those of the earlier transfers.

Add equal fixed-temperature increments

Heat passedHot, 600 KCold, 300 KCombined ΔS
200 J−0.333 J/K+0.667 J/K+0.333 J/K
400 J−0.667 J/K+1.333 J/K+0.667 J/K
1,000 J−1.667 J/K+3.333 J/K+1.667 J/K
Every row obeys equal energy loss and gain. Entropy columns use the reservoir's own absolute temperature. Values are rounded only for display.

Before changing the temperature pair in the player, predict the order of entropy generation for the same 1,000 J transfer. Compare 600 K to 300 K, 400 K to 300 K, and 600 K to 500 K. The receiver's contribution stays fixed in the first two comparisons, but the 400 K donor loses more entropy per joule than the 600 K donor. The second pair should therefore generate less. The third pair has both temperatures high and their reciprocal temperatures closer together.

Select each named pair and use the step control to reach the same cumulative 1,000 J endpoint. The combined changes are about 1.667, 0.833, and 0.333 J/K respectively. For the middle pair, calculate the two terms separately: the cold reservoir gains 1,000 divided by 300, while the hot reservoir loses 1,000 divided by 400. The result is 3.333 minus 2.500 J/K. Each selection resets the sequence; compare equal transferred energies rather than equal moments on the playback clock.

Temperature difference alone does not determine entropy generation per joule. Compare a separate paper example, 800 K to 600 K, with the selectable 400 K to 300 K pair. The former has twice the temperature difference but generates only about 0.417 J/K for 1,000 J, half the latter's result. Both pairs have the same temperature ratio, yet their reciprocal-temperature differences differ. This is why the entropy balance divides by the two absolute temperatures rather than by their difference or ratio alone.

Compare the reciprocal temperatures

Compare gaps on the same reciprocal-temperature scale400 K → 300 K0.002500.00333800 K → 600 K0.001250.00167Reciprocal temperature, K⁻¹
Common horizontal scale: 180,000 SVG units per K⁻¹. Each highlighted interval is 1/Tc − 1/Th. Multiplying its numerical value by 1,000 J gives the generated entropy. These are separate paper comparisons, not extra player presets.

Nothing in these comparisons predicts which contact transfers 1,000 J sooner. A thermal resistance, geometry, and a transport law would be needed for that question. The player specifies equal energy increments without calculating their physical durations. If the two reservoir temperatures became equal, direct transfer would produce zero total entropy per joule in this ideal limit, but equal temperatures would provide no thermal driving difference for a finite conductive rate. A zero entropy balance is not evidence of continuing heat flow.

Work through the mechanism

Direct transfer between fixed-temperature reservoirs
ΔStotal=QTc−QTh

Q is the positive heat passed from hot to cold. The hot reservoir loses entropy while the cold gains it; temperatures stay fixed.

A finite body with constant heat capacity
ΔS=Cln(TfTi)

C is in J/K. This endpoint formula uses a reversible reference path; actual cooling can be irreversible. No phase change or appreciable work is included.

Pass heat while tracking both reservoirs

Step 0: 0 J passed from 600 K to 300 K. Combined entropy change 0 J/K.

Hot reservoir0 J/KCold reservoir0 J/KCombined0 J/K-3-2-101234Entropy change, J/K; zero is the vertical line
Step 0 / 5
Complete heat-transfer trace
Heat passedHot ΔSCold ΔSTotal ΔS
0 J0 J/K0 J/K0 J/K
200 J-0.33 J/K0.67 J/K0.33 J/K
400 J-0.67 J/K1.33 J/K0.67 J/K
600 J-1 J/K2 J/K1 J/K
800 J-1.33 J/K2.67 J/K1.33 J/K
1000 J-1.67 J/K3.33 J/K1.67 J/K
Each step transfers another 200 J from hot to cold. Reservoir temperatures stay fixed. Bars share one signed J/K scale. A new temperature pair resets playback; speed controls only the teaching clock, not a physical heat-transfer rate. The complete trace remains available below.
Heat passed, 600 K to 300 KHot entropy changeCold entropy changeCombined
0 J000
500 J−0.833 J/K+1.667 J/K+0.833 J/K
1,000 J−1.667 J/K+3.333 J/K+1.667 J/K
Signs refer to each reservoir. Heat amounts match, but entropy changes do not cancel.

Calculate a changing body's entropy in small steps

A finite body's entropy calculation must follow its changing temperature on a reversible reference route. Imagine a body of constant whole-sample capacity 100 J/K warming from 300 K to 400 K without appreciable work or phase change. Its energy gain is 10,000 J. Divide that interval into two 50 K stages. Each stage takes 5,000 J, but the lower-temperature stage contributes more entropy because the same energy is divided by smaller temperatures. A single final-temperature denominator discards that difference.

The temperature-area diagram makes this visible without requiring calculus. Between 300 K and 350 K, the height 100 divided by temperature falls from 0.333 to 0.286 J/K². The area under that curve gives the entropy gain for the stage. Its exact value is 100 times ln of 350 divided by 300, about 15.415 J/K. Between 350 K and 400 K, the corresponding gain is about 13.353 J/K. The two areas add to about 28.768 J/K.

Entropy is the area under capacity divided by temperature

C/T, J/K²0.00.10.20.30.415.415 J/K13.353 J/K300350400Reference temperature, K
Whole-sample capacity C = 100 J/K. Horizontal scale is temperature, not time. Area units are J/K² × K = J/K. The two stage areas sum to 28.768 J/K; this is a reversible reference calculation.

Here ln means the natural logarithm, which converts multiplication of positive ratios into addition. The overall temperature ratio equals the product of the two stage ratios. Therefore adding ln of 350/300 and ln of 400/350 gives ln of 400/300. Multiplying by the capacity gives the same endpoint entropy change whether you use one interval or many. Taking successively smaller temperature steps explains the logarithm's role. It is not a material property or heat-loss correction.

You can check the result before evaluating a logarithm. Throughout warming, every joule enters on the reference route between 300 K and 400 K. Dividing all 10,000 J by 400 K gives a lower bound of 25 J/K. Dividing by 300 K gives an upper bound of about 33.333 J/K. The calculated 28.768 lies between them. This comparison also diagnoses the tempting calculation using only the final temperature. It reaches one limiting rectangle, not the area under the changing reciprocal-temperature curve.

Now let that same warming actually occur through direct contact with a 400 K reservoir. The body still gains 28.768 J/K because its equilibrium endpoints are unchanged. The reservoir loses 10,000 divided by 400, or 25 J/K. The isolated combination therefore generates about 3.768 J/K. The reference route would instead exchange energy with a succession of almost equal-temperature surroundings. Its heat contributions calculate the body's state difference; they are not a description of the actual single-reservoir contact history.

The actual single-reservoir contact generates entropy

PartEnergy changeEntropy change
100 J/K body, 300 → 400 K+10,000 J+28.768 J/K
400 K reservoir−10,000 J−25.000 J/K
Isolated combination0 J+3.768 J/K
A stipulated constant-capacity body warms without work or phase change. The reversible reference determines the body's endpoint entropy change; the actual reservoir loses Q/T at its fixed 400 K temperature.

Repeat the reasoning with a hypothetical body having twice the whole-sample capacity but the same initial and final temperatures. It receives twice the energy and has twice the entropy change. The logarithmic temperature factor stays fixed. If you were given specific capacity in J per kilogram per kelvin, you would first multiply by mass to obtain the whole-sample capacity. If capacity varied strongly with temperature, the area would instead lie under that varying capacity divided by temperature, and the simple constant-capacity logarithm would not apply.

Use reversible reference paths carefully

For a finite body with constant heat capacity C and negligible work, its entropy change between two equilibrium temperatures is C times ln of final temperature divided by initial temperature. Dividing its entire heat transfer by only the final temperature is generally wrong. For an ideal gas freely expanding to twice the volume at the same final temperature, entropy rises by nR ln 2 even though actual heat transfer is zero. A reversible isothermal path between the endpoints supplies the entropy calculation, not the actual work.

The microscopic picture explains why constrained states can relax toward much larger accessible sets. It does not make entropy a measure of visual disorder or imply that a crystal has no thermal entropy at any temperature. The third law fixes the zero-temperature entropy of a perfect crystal with a unique ground state in the ideal limit. Degeneracy, residual entropy, and quantum effects require care; the classical constant-capacity model is not valid all the way to zero kelvin.

Use the same endpoints without copying the transfers

Return to the ideal-gas sample and choose the entire rigid, insulated expansion enclosure as the system. Initially the gas occupies 10 L and the remaining 10 L is evacuated. After the partition is removed and equilibrium returns, the gas occupies 20 L. No heat enters and the outer boundary does no work. This ideal gas's final temperature remains 300 K because its internal energy depends only on temperature. The intermediate expansion need not have uniform pressure.

Calculate the entropy difference by replacing that actual route in thought with reversible isothermal expansion between the same gas states. At 300 K the sample has nRT equal to 1,000 J. Reversible work and heat input are each 1,000 times ln 2, about 693.147 J. Dividing the reference heat by 300 K gives about 2.310 J/K. This is also the entropy change in free expansion, but the actual free expansion receives none of that heat and delivers none of that work.

One gas entropy difference, two different routes

RouteQ into gasW outGas ΔS
Reversible isothermal reference+693.147 J+693.147 J+2.310 J/K
Insulated free expansion0 J0 J+2.310 J/K
Same ideal-gas amount and equilibrium endpoints: 10 L to 20 L at 300 K. nR = 10/3 J/K. Heat and work use the actual values on each named route, not values borrowed from the other route.

The two routes show why zero heat is not a sufficient condition for constant entropy. Actual free expansion has zero entropy transfer and positive entropy generation. Reversible insulated expansion has neither transfer nor generation, so its entropy stays constant. It also cools the monatomic ideal gas when work leaves, reaching a different endpoint temperature. Slowly moving a piston with friction would introduce still another route. Quasistatic intermediate states alone do not establish reversibility, and gas pressure cannot replace the opposing external pressure in an arbitrary work calculation.

The microscopic interpretation concerns newly accessible states under specified constraints. In the coarse labeled-particle picture, restricting every particle to the left half permits one left/right assignment. Removing that restriction permits two choices for each particle. Four particles then have sixteen assignments, with equal weights only under the independent equal-half assumption. The logarithm of that accessible-set expansion is four times ln 2. This is not the logarithm of the six assignments in the exactly balanced category, which describes a different question about the final occupancy.

For a classical dilute gas, the more detailed position-space volume similarly gains a factor of two for each particle when the available volume doubles. Momentum contributions cancel at these equal-temperature endpoints, giving particle count times kB times ln 2, equivalent to nR ln 2. The argument does not identify sixteen assignments with complete molecular phase space. Nor does it imply that exact balance becomes certain: a near-half occupancy band and one exactly half occupancy are distinct probability events.

Accessible assignments are not the exactly balanced category

All four confined left12341 accessible assignment0Constraint removed123416 accessible assignments
A coarse four-labeled-particle model. Dots on the right each denote one complete left/right assignment, not a molecule. The outlined six are exactly balanced; all sixteen are accessible after the constraint is removed. Equal probabilities require independent equal-half sampling.

Use these cases as a prediction check. If an insulated system's temperature stays fixed, can its entropy still increase? Free expansion answers yes because constraints on accessible positions changed. If a reversible insulated system's temperature changes, must its entropy change? Compression answers no. Temperature, energy, and entropy describe different state relationships. These examples do not establish entropy at zero kelvin. Quantum energy spacings and ground-state structure must replace classical constant-capacity extrapolations there.

Exercises

Cool a finite body

A body with constant capacity 100 J/K cools from 400 K to 300 K. Find its entropy change. Is a negative result itself a violation?

Hint

Use C ln of the temperature ratio, then ask where the heat goes.

Worked answer
PartEntropy change
Cooling body100 ln(0.75) ≈ −28.77 J/K
300 K reservoir10,000 / 300 ≈ +33.33 J/K
CombinedAbout +4.57 J/K
A reversible reference computes the body’s state difference; the real contact generates entropy.

Its entropy change is 100 ln(300/400) ≈ −28.77 J/K. A negative subsystem change is allowed. If it releases its 10,000 J to a 300 K reservoir, that reservoir gains about 33.33 J/K, so the combined change is about +4.57 J/K. Dividing −10,000 J by 300 K would incorrectly treat the cooling body as a constant-temperature reservoir.

Finite body's entropy change
ΔSbody=100ln(300400) J/K≈−28.768 J/K

The temperature ratio is dimensionless. The body is not a constant-temperature reservoir.

Reservoir's entropy change
ΔSreservoir=10000 J300 K≈33.333 J/K

Adding the unrounded changes gives about +4.57 J/K in total. Rounding each part to two decimal places before adding can shift the last displayed digit.

Explain zero heat with increasing entropy

For the insulated free expansion from 10 L to 20 L, the sample has nR = 10/3 J/K. Find the gas entropy change despite Q = 0.

Hint

Use an imagined reversible isothermal route between the same endpoints.

Worked answer
Route between the same endpointsActual QΔS
Reversible isothermal reference693.15 J2.31 J/K
Insulated free expansion0 J2.31 J/K
Entropy is a state function; heat is path-dependent.

The entropy change is nR ln 2, about 2.31 J/K. On the reversible reference route, heat input would be about 693.15 J at 300 K. Actual free expansion has no heat input and no work output. Entropy generation, not entropy entering with heat, accounts for the positive gas entropy change.

Sources and further reading

These optional references support the stated laws and model assumptions. The numerical examples and diagrams are authored teaching models, not experimental measurements or engineering specifications. Selected relevant passages were reviewed, not entire textbooks or a comprehensive research literature.

  • OpenStax: Entropy

    Selected reservoir, finite-body, and reversible-reference-path calculations. The actual process need not be reversible.

  • OpenStax: Entropy on a microscopic scale

    Selected free-expansion entropy calculation and third-law discussion. This section uses qualitative disorder language; our counting model is instead supported by the separate Chemistry entropy section and explicit enumeration.

  • OpenStax: First law of thermodynamics

    Selected energy accounts using positive work done by the system. A system can receive energy as work without heat transfer.