Solution (source code)

= Solution

The <zeroth law of thermodynamics> states the transitivity of <thermal equilibrium>: if two systems each equilibrate thermally with a third, they equilibrate with one another. A reproducible thermometric property can therefore label their <temperature>. Its empirical numerical scale is not itself the complete thermodynamic content; reversible heat-engine relations establish an absolute <temperature> scale.

The <first law of thermodynamics> expresses <energy> conservation. For a <closed system>, $dU=\delta Q-\delta W$ when $\delta W$ is work done by the system. <internal energy> is a state function, while <heat> and work depend on the path. In reversible simple compressible motion, $\delta W=p\,dV$ and $dU=T\,dS-p\,dV$; an open system additionally needs the energies carried by transferred matter. An <ideal gas> can expand freely with $Q=W=0$ and unchanged <internal energy>. The first law alone does not decide whether the reverse spontaneous process occurs.

The <Second law of thermodynamics> introduces <entropy> and restricts direction. For a reversible path, $dS=\delta Q_{\rm rev}/T$; for an irreversible process the <entropy> balance includes nonnegative production. The <entropy> of an isolated system cannot decrease. In a cycle, the <Clausius inequality> is $\oint\delta Q/T\leq0$, using the appropriate boundary/reservoir <temperatures>. The Kelvin–Planck statement forbids a cyclic device whose sole effect is extracting <heat> from one reservoir and turning all of it into work; the Clausius statement forbids moving <heat> from cold to hot with no compensating effect. A <refrigerator> is allowed because it consumes work. A two-reservoir engine has $\eta\leq1-T_c/T_h$, with equality in the reversible limit. Work may be fully dissipated as <heat> without contradicting this one-way restriction.

The <third law of thermodynamics> constrains low-temperature <entropy>. An equilibrium perfect crystal with a nondegenerate <ground state> approaches zero <entropy> as $T\to0$, fixing the conventional absolute <entropy> reference. Degenerate <ground states> or frozen nonequilibrium disorder require care when discussing <residual entropy>. Under regular equilibrium conditions the <heat capacity> must decrease sufficiently for $\int C/T\,dT$ to remain finite; a constant positive classical <heat capacity> cannot be extrapolated to zero <temperature>. The unattainability formulation states that absolute zero cannot be reached by a finite sequence of admissible cooling operations. These statements concern the limiting thermodynamic regime, rather than predicting that every substance stays in one classical phase during cooling.

The laws work together: conservation sets a device's <energy> budget, <entropy> production restricts the attainable budget, and constitutive equations give the properties of its working material. For fixed <temperature> and <volume>, <Helmholtz free energy> decreases toward equilibrium; at fixed <temperature> and <pressure> the corresponding potential is <Gibbs free energy>. Stable equilibrium, <phase coexistence> and <Maxwell relations> follow from these potentials with appropriate constraints. Calorimetry, mechanical-work measurements, thermometry and reversible-path comparisons test different parts of this framework. None of the laws by itself supplies a particular gas <equation of state> or microscopic <heat capacity>.