Thermodynamics

Second Law of Thermodynamics

Entropy of an isolated system never decreases — heat flows from hot to cold, never the reverse

The second law of thermodynamics says entropy of an isolated system never decreases. Equivalently — heat spontaneously flows from hot to cold (not the reverse), no heat engine can be 100% efficient (Carnot limit), and time has a "direction" — the arrow of time. The deepest law in physics; tells us why eggs unbreak only in reverse and why machines need energy input.

  • Statement (Clausius)Heat doesn't spontaneously flow from cold to hot
  • Statement (Kelvin)No engine converts heat fully to work in a cycle
  • Entropy formΔS_universe ≥ 0 for any process
  • Carnot efficiency limitη ≤ 1 − T_c/T_h
  • Time's arrow2nd law gives time directionality
  • Boltzmann's SS = k_B · ln(W) (statistical mechanics)

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

Multiple equivalent statements

The second law has many equivalent formulations:

  1. Clausius: No process is possible whose sole result is the transfer of heat from a colder body to a hotter body.
  2. Kelvin: No process is possible whose sole result is the complete conversion of heat into work.
  3. Entropy form: The total entropy of an isolated system can never decrease over time. ΔS_universe ≥ 0.
  4. Time's arrow: Time has a thermodynamic direction — from low to high entropy.

These are mathematically equivalent — accepting any one implies all the others.

Entropy

Entropy S is a measure of the disorder (or number of microstates) of a system. Defined as:

dS = dQ_reversible / T  (Clausius definition)
S = k_B · ln(W)  (Boltzmann definition; W = number of microstates)

The 2nd law says ΔS_universe ≥ 0 — for any process in an isolated system, total entropy increases (or stays constant for reversible processes).

Carnot efficiency limit

For a heat engine operating between hot reservoir T_h and cold reservoir T_c:

η_max = η_Carnot = 1 − T_c / T_h

(Both temperatures in Kelvin.) Real engines always have η < η_Carnot due to irreversibilities.

SystemT_hT_cη_CarnotReal η
Steam engine~500 K~300 K40%~25%
Internal combustion (gasoline)~2200 K~600 K73%~25%
Coal power plant~800 K~310 K61%~40%
Combined-cycle gas~1750 K~310 K82%~60%
Solar thermal (high T)~700 K~310 K56%~30%
Geothermal~400 K~280 K30%~10-15%

Real-world consequences

PhenomenonWhy 2nd law explains it
Coffee cools to room temperatureEntropy increases as heat spreads from hot to cold
Egg breaks but never unbreaksBroken state is much more probable (more microstates)
Cars need fuelEngine can't be 100% efficient; some energy "wasted" as heat
Refrigerators need powerForcing heat from cold to hot requires work input
Universe expanding to "heat death"Long-term entropy increase
Stars eventually dieNuclear fuel exhausted, all energy radiated as low-T photons
Why people ageLiving systems fight local entropy decrease but lose over decades

JavaScript — entropy and Carnot calculations

// Carnot efficiency
function carnotEfficiency(T_hot, T_cold) {
  return 1 - T_cold / T_hot;  // K
}

console.log(`Steam engine (500K/300K): ${(carnotEfficiency(500, 300) * 100).toFixed(0)}%`); // 40%
console.log(`Solar (700K/310K): ${(carnotEfficiency(700, 310) * 100).toFixed(0)}%`); // 56%

// Refrigerator coefficient of performance
function carnotCOP_refrigerator(T_cold, T_hot) {
  return T_cold / (T_hot - T_cold);
}

console.log(`Fridge (277K interior, 297K outside): COP = ${carnotCOP_refrigerator(277, 297).toFixed(1)}`);  // ~14

// Entropy change for heat transfer
function entropyChange_heatTransfer(Q, T_hot, T_cold) {
  // Heat Q goes from T_hot to T_cold
  // ΔS_hot = -Q/T_hot, ΔS_cold = +Q/T_cold
  // Total ΔS = Q · (1/T_cold - 1/T_hot) ≥ 0 always
  return Q * (1/T_cold - 1/T_hot);
}

console.log(`Heat 1000 J from 500K to 300K: ΔS = ${entropyChange_heatTransfer(1000, 500, 300).toFixed(2)} J/K`);
// Always positive

// Boltzmann entropy
function boltzmannEntropy(numberOfMicrostates) {
  const k_B = 1.380649e-23;  // J/K
  return k_B * Math.log(numberOfMicrostates);
}

// Compare ordered (1 microstate) vs disordered (10^23 microstates)
console.log(`Single arrangement: S = 0`);
console.log(`10^23 arrangements: S = ${boltzmannEntropy(1e23).toExponential(2)} J/K`);

// Engine efficiency from heat in/out
function engineEfficiencyFromHeats(Q_hot, Q_cold) {
  return (Q_hot - Q_cold) / Q_hot;
}

// Compare to Carnot
function vsCarnot(eta_real, T_hot, T_cold) {
  const eta_carnot = carnotEfficiency(T_hot, T_cold);
  return { real: eta_real, carnot: eta_carnot, efficiency_of_efficiency: eta_real / eta_carnot };
}

console.log(vsCarnot(0.30, 800, 300));  // Real 30% / Carnot 62.5% = 48% of Carnot

Where the second law shows up

  • Engineering — heat engines and refrigerators. Sets fundamental efficiency limits. Modern power plants approach Carnot; real refrigerators have known thermodynamic costs.
  • Chemistry. Reactions proceed in direction of decreased Gibbs free energy (linked to entropy + enthalpy).
  • Astrophysics. Stellar evolution, black hole thermodynamics (Bekenstein-Hawking entropy), heat death of universe.
  • Biology. Living organisms reduce local entropy at the cost of larger global entropy increase. Metabolism is essentially thermodynamic.
  • Information theory. Shannon entropy is mathematically analogous to thermodynamic entropy. Erasing information has thermodynamic cost (Landauer's principle).
  • Statistical mechanics. Boltzmann's S = k·ln(W) connects micro to macro, derives the 2nd law.
  • Computing. Reversible computation could in principle have lower energy use; Landauer's bound is ultimate physical limit.

Common mistakes

  • Misapplying "entropy always increases". Only for ISOLATED systems. Subsystems can decrease entropy at the cost of increasing it elsewhere (refrigerators, life, manufacturing).
  • Treating Carnot as an upper bound for ALL engines. It IS the upper bound for engines operating between two temperatures. Multi-temperature reservoirs (e.g., fuel cells using chemical energy directly) can have higher efficiency.
  • Calling it "anti-evolution" or "anti-life". Life isn't a violation. Earth receives low-entropy sunlight and radiates high-entropy heat — entropy budget is huge for life to thrive within.
  • Confusing entropy with disorder (loosely). Disorder is a vague metaphor. Entropy is precisely defined — number of microstates, or dQ_rev/T. Be careful with "disorder" in advanced contexts.
  • Forgetting Kelvin temperatures. Carnot efficiency uses absolute temperatures (K). Don't use Celsius — the formula breaks.
  • Treating reversibility as "easy to reverse." Thermodynamically reversible means entropy doesn't increase — extremely slow processes only. Even quasi-reversible engines have small but nonzero entropy generation.

Frequently asked questions

Why does entropy always increase?

Statistically, more disordered states are more numerous. Boltzmann showed S = k_B·ln(W), where W is the number of microscopic arrangements giving the same macroscopic state. Increases in entropy correspond to increases in W — moving from less likely (ordered) configurations to more likely (disordered) ones. The 2nd law is a statistical statement; in principle, entropy can briefly decrease (fluctuations), but for macroscopic systems, the probability is essentially zero.

How does this give time a direction?

Most physics laws are time-reversible — Newton's laws, electromagnetism, quantum mechanics. But the 2nd law is NOT — entropy increases in the forward direction. This gives a thermodynamic "arrow of time" — distinguishing past from future. Why we remember the past (low entropy) but not the future (higher entropy); why eggs break but don't unbreak; why milk diffuses in coffee.

Why can't an engine be 100% efficient?

An engine converting heat to work must reject some heat to a colder reservoir. The maximum efficiency (Carnot) is η = 1 - T_c/T_h, with T in Kelvin. To approach 100%, T_c must approach 0 K — practically impossible. Real engines also have friction, turbulence losses; usually 30-50% of Carnot.

How does the second law apply to refrigerators?

Refrigerators move heat from cold (inside) to hot (outside) — "violating" the natural direction. But this requires WORK input — the refrigerator's compressor. Energy balance: Q_hot = Q_cold + W. Coefficient of performance: COP = Q_cold / W. Best possible (Carnot) COP_refrig = T_c / (T_h - T_c). For typical fridge (T_c = 277 K, T_h = 297 K), Carnot COP = 14 — real fridges are ~3-5.

What about life seeming to violate the 2nd law?

A living organism reduces local entropy (organizes molecules into cells, metabolism). But this requires energy input AND increases overall entropy of the universe. The process produces heat, waste, and disorder elsewhere — a net entropy INCREASE. Earth as a whole receives low-entropy sunlight and radiates high-entropy heat back to space. Life is fully consistent with the 2nd law.

Can entropy decrease in part of a system?

Yes — if entropy increases more elsewhere. The 2nd law only requires the total (closed-system) entropy to increase. Any sub-system can have entropy decrease, paid for by entropy increase in its surroundings. Fridge is a classic example — interior cools (lower entropy), but exterior heats up (more entropy).

Is the universe heading to "heat death"?

Yes, in classical view. As entropy increases, energy becomes more spread out (uniform temperature, no useful work possible). The universe approaches "thermal equilibrium" — heat death. Time scale: ~10¹⁰⁰ years (after black holes evaporate). New physics (dark energy, expanding universe) complicates this picture; but the 2nd-law trend is real.