%!TEX program = xelatex
% miko:title: Complete Thermodynamics
% miko:summary: A concise guide to thermodynamic postulates, equilibrium, potentials, Legendre transforms, stability, phase transitions, material response, and the bridge to statistical mechanics.
% miko:category: statmech
% miko:type: complete
% miko:origin: ai
% miko:tags: statmech
% miko:difficulty: undergrad
% miko:keywords: thermodynamics, entropy, equilibrium, free energy, Legendre transformations, phase transitions, response functions

\documentclass[a4paper,11pt]{article}
\usepackage{amsmath,amssymb,mathtools,bm}
\usepackage[margin=25mm]{geometry}
\usepackage{hyperref}

\title{Complete Thermodynamics}
\author{Miko-pedia AI}
\date{\today}

\begin{document}
\maketitle
\tableofcontents

\section{Part I: General Principles of Classical Thermodynamics}
\subsection{Core ideas}
Classical thermodynamics describes macroscopic equilibrium states without tracking microscopic motion. Its central variables are energy, entropy, volume, particle number, temperature, pressure, and chemical potential. The laws constrain possible processes and define useful state functions.

For review, be able to state the laws, distinguish state functions from path quantities, and identify equilibrium variables. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
dU=T\,dS-P\,dV+\mu\,dN
\]

\subsection{Worked example}
Consider $2\,\text{mol}$ of a monatomic ideal gas at $T=300\,\text{K}$. Its internal energy is
\[
U=\frac{3}{2}nRT=\frac{3}{2}(2)(8.314)(300)=7.48\,\text{kJ}.
\]
If the gas expands isothermally to double its volume, the entropy change is
\[
\Delta S = nR\ln\frac{V_2}{V_1} = (2)(8.314)\ln 2 = 11.5\ \text{J/K}.
\]
Because $T$ is fixed, $\Delta U=0$ and the heat absorbed equals the work done by the gas: $Q=W=T\Delta S=(300)(11.5)=3.46\,\text{kJ}$.

\subsection{Problems with Solutions}
\paragraph{Problem 1} A gas expands from $V_1=1.0\,\text{L}$ to $V_2=2.0\,\text{L}$. Calculate the work done (a) reversibly and isothermally at $T=300\,\text{K}$, and (b) irreversibly against a constant external pressure $P_{\text{ext}}=1.0\,\text{atm}$. Take $n=0.040\,\text{mol}$.

\emph{Solution.} (a) $W_{\text{rev}}=-nRT\ln(V_2/V_1)=-(0.040)(8.314)(300)\ln 2=-69.1\,\text{J}$.  
(b) With $P_{\text{ext}}=1.0\,\text{atm}=1.013\times10^5\,\text{Pa}$ and $\Delta V=1.0\times10^{-3}\,\text{m}^3$, $W_{\text{irr}}=-P_{\text{ext}}\Delta V=-101.3\,\text{J}$. The reversible path yields the maximum work (least negative).

\paragraph{Problem 2} A sealed rigid container holds $n=3\,\text{mol}$ of gas. Heat is added, raising the temperature from $300\,\text{K}$ to $400\,\text{K}$. Given $C_V=\frac{5}{2}R$ for this gas, find $\Delta U$, $Q$, and $W$.

\emph{Solution.} Because $V$ is constant, $W=0$. Then $\Delta U=Q=nC_V\Delta T=(3)(\frac{5}{2}\times8.314)(100)=6.24\,\text{kJ}$.

\paragraph{Section summary}
Thermodynamics is a macroscopic theory of energy, entropy, and equilibrium.

\section{Introduction: The Nature of Thermodynamics and the Basis of Thermostatistics}
\subsection{Core ideas}
Thermodynamics is powerful because many microscopic details are irrelevant at equilibrium. Thermostatistics supplies the microscopic meaning: entropy measures multiplicity and temperature measures how entropy changes with energy.

For review, be able to connect thermodynamic and statistical entropy, explain why few variables describe equilibrium, and identify the thermodynamic limit. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
S=k_B\ln\Omega,\qquad dS\ge0\quad\mathrm{for\ isolated\ systems}
\]

\subsection{Worked example}
A system of $N=4$ distinguishable particles can each occupy one of three single-particle energy levels. The total number of accessible microstates is $\Omega = 3^4 = 81$. The statistical entropy is
\[
S = k_B\ln\Omega = (1.38\times10^{-23}\,\text{J/K})\ln 81 = 6.3\times10^{-23}\,\text{J/K}.
\]
If a constraint is removed and the number of accessible microstates doubles to $\Omega'=162$, the entropy increases by $\Delta S = k_B\ln 2 \approx 9.6\times10^{-24}\,\text{J/K}$, illustrating the second law at the microscopic level.

\subsection{Problems with Solutions}
\paragraph{Problem 1} A fair coin is flipped $10$ times. How many microstates correspond to exactly $5$ heads and $5$ tails? What is the entropy of this macrostate?

\emph{Solution.} The multiplicity is $\Omega = \binom{10}{5} = 252$. The entropy is $S = k_B\ln 252 \approx 7.83\,k_B \approx 1.08\times10^{-22}\,\text{J/K}$.

\paragraph{Problem 2} An isolated Einstein solid has $3$ oscillators and $4$ energy quanta. Using $\Omega = \binom{N+q-1}{q}$, compute the entropy.

\emph{Solution.} Here $N=3$, $q=4$, so $\Omega=\binom{6}{4}=15$. Then $S=k_B\ln 15\approx 2.71\,k_B\approx 3.74\times10^{-23}\,\text{J/K}$.

\paragraph{Problem 3} Connect the microscopic and macroscopic pictures: for an ideal gas, show that $S=k_B\ln\Omega$ is consistent with $\Delta S = nR\ln(V_f/V_i)$ when the volume doubles at fixed energy.

\emph{Solution.} When $V$ doubles, each particle has twice as many position states, so $\Omega_f/\Omega_i = 2^N$. Then $\Delta S = k_B\ln(2^N)=Nk_B\ln 2 = nR\ln 2$, matching the thermodynamic result.

\paragraph{Section summary}
Thermodynamics summarizes microscopic complexity through state variables.

\section{The Problem and the Postulates}
\subsection{Core ideas}
The basic problem is to determine equilibrium states and allowed processes from a small set of postulates. A simple system has an entropy function $S(U,V,N,\ldots)$ that is extensive, concave, and maximized at equilibrium for isolated constraints.

For review, be able to use entropy maximization, extensivity, and concavity to infer equilibrium conditions. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
S=S(U,V,N),\qquad S(\lambda U,\lambda V,\lambda N)=\lambda S(U,V,N)
\]

\subsection{Worked example}
Two identical copper blocks, each with heat capacity $C=500\,\text{J/K}$, are initially at $T_1=300\,\text{K}$ and $T_2=400\,\text{K}$. They are brought into thermal contact in an isolated enclosure. The total energy is $U_{\text{tot}}=C(T_1+T_2)=3.50\times10^5\,\text{J}$. Entropy maximization gives the final temperature $T_f=(T_1+T_2)/2=350\,\text{K}$. The entropy increase is
\[
\Delta S = C\ln\frac{T_f^2}{T_1T_2} = 500\ln\frac{350^2}{300\times400}=500\ln(1.0208)=10.3\,\text{J/K}.
\]
\subsection{Problems with Solutions}
\paragraph{Problem 1} Show that $S(U,V,N)=Nk_B\ln(aU^3V^2/N^5)$ is extensive, i.e., $S(\lambda U,\lambda V,\lambda N)=\lambda S(U,V,N)$.

\emph{Solution.} Substitute:
\[
S(\lambda U,\lambda V,\lambda N) = \lambda N k_B\ln\!\left(\frac{a(\lambda U)^3(\lambda V)^2}{(\lambda N)^5}\right) = \lambda N k_B\ln\!\left(\frac{a\lambda^5 U^3V^2}{\lambda^5 N^5}\right) = \lambda S(U,V,N).
\]
\paragraph{Problem 2} Two systems have entropies $S_1=c\sqrt{U_1V_1}$ and $S_2=c\sqrt{U_2V_2}$ with equal volumes $V_1=V_2=V$. They exchange energy with $U_1+U_2=U$ fixed. Find the equilibrium energy distribution.

\emph{Solution.} Maximize $S=cV^{1/2}(\sqrt{U_1}+\sqrt{U-U_1})$. Setting $dS/dU_1=0$ gives $U_1^{-1/2}=(U-U_1)^{-1/2}$, so $U_1=U_2=U/2$.

\paragraph{Section summary}
The entropy postulate defines equilibrium and thermodynamic stability.

\section{The Conditions of Equilibrium}
\subsection{Core ideas}
Two systems in contact exchange energy, volume, or particles until entropy is maximized. This produces equality of temperature, pressure, and chemical potential for the corresponding allowed exchanges.

For review, be able to derive thermal, mechanical, and diffusive equilibrium conditions from entropy maximization. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
T_1=T_2,\qquad P_1=P_2,\qquad \mu_1=\mu_2
\]

\subsection{Worked example}
A rigid insulated tank is divided by a conducting wall. Side A contains $1\,\text{mol}$ of monatomic ideal gas at $T_A=400\,\text{K}$; side B contains $2\,\text{mol}$ of the same gas at $T_B=250\,\text{K}$. The wall allows heat but not particles or volume exchange. Thermal equilibrium requires $T_A=T_B=T_f$. Energy conservation gives
\[
n_A C_V T_A + n_B C_V T_B = (n_A+n_B)C_V T_f \;\Rightarrow\; T_f = \frac{(1)(400)+(2)(250)}{3}=300\,\text{K}.
\]
Pressures need not equalize because the wall is rigid.

\subsection{Problems with Solutions}
\paragraph{Problem 1} Two ideal gases are separated by a movable, thermally conducting piston. Initially $P_1=2\,\text{atm}$, $V_1=1\,\text{L}$, $T_1=300\,\text{K}$ and $P_2=1\,\text{atm}$, $V_2=2\,\text{L}$, $T_2=300\,\text{K}$. Find the equilibrium pressure and temperature.

\emph{Solution.} Moles are $n_1=P_1V_1/RT_1=0.081\,\text{mol}$ and $n_2=0.081\,\text{mol}$. Since $T$ is already equal and the piston conducts, $T_f=300\,\text{K}$. Mechanical equilibrium gives a common $P_f$. Total volume $V=3\,\text{L}$, so $P_f=(n_1+n_2)RT_f/V=2.03\,\text{atm}$.

\paragraph{Problem 2} Explain why $\mu_1=\mu_2$ is the condition for diffusive equilibrium, using entropy maximization with $N_1+N_2$ fixed.

\emph{Solution.} $dS = (\partial S_1/\partial N_1)dN_1 + (\partial S_2/\partial N_2)dN_2 = (-\mu_1/T+\mu_2/T)dN_1=0$, hence $\mu_1=\mu_2$.

\paragraph{Section summary}
Equilibrium means no entropy gain remains under allowed exchanges.

\section{Some Formal Relationships, and Sample Systems}
\subsection{Core ideas}
The fundamental thermodynamic relation generates equations of state and identities. Ideal gases, paramagnets, and elastic systems illustrate how different work terms enter and how measurable response follows from derivatives.

For review, be able to use Euler and Gibbs-Duhem relations, compute simple equations of state, and track conjugate pairs. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
U=TS-PV+\mu N,\qquad S\,dT-V\,dP+N\,d\mu=0
\]

\subsection{Worked example}
For $1\,\text{mol}$ of monatomic ideal gas, the fundamental relation is $U=\frac{3}{2}RT$ and the entropy is $S = R[\ln(V/Nv_Q^3)+3/2]$, where $v_Q$ is the quantum volume. The Euler equation states $U=TS-PV+\mu N$. Using $PV=RT$ and the explicit forms of $U$ and $S$, one finds the chemical potential $\mu = -RT\ln(k_BT/Pv_Q^3)$, demonstrating consistency of the formal structure.

\subsection{Problems with Solutions}
\paragraph{Problem 1} Starting from $U=TS-PV+\mu N$, derive the Gibbs-Duhem relation $S\,dT-V\,dP+N\,d\mu=0$.

\emph{Solution.} Take the differential: $dU=T\,dS+S\,dT-P\,dV-V\,dP+\mu\,dN+N\,d\mu$. Compare with $dU=T\,dS-P\,dV+\mu\,dN$. Subtracting yields $S\,dT-V\,dP+N\,d\mu=0$.

\paragraph{Problem 2} A system has fundamental relation $S=a\sqrt{UVN}$ with $a>0$. Find its equation of state $P(T,V,N)$.

\emph{Solution.} Use $1/T=(\partial S/\partial U)_{V,N}=a\sqrt{VN}/(2\sqrt{U})$ and $P/T=(\partial S/\partial V)_{U,N}=a\sqrt{UN}/(2\sqrt{V})$. Eliminating $U$ gives $U=a^2T^2VN/4$, and therefore $P=U/V=a^2NT^2/4$.

\paragraph{Section summary}
Formal identities reduce many derivatives to a consistent structure.

\section{Reversible Processes and the Maximum Work Theorem}
\subsection{Core ideas}
A reversible process proceeds through equilibrium states and produces no entropy internally. It gives the maximum useful work between specified states; irreversible processes lose availability through entropy production.

For review, be able to compute reversible work, distinguish heat and work, and connect free energy decreases to maximum work. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
dS=\frac{\delta Q_{\rm rev}}{T},\qquad W_{\rm max}=-\Delta F\quad(T,V,N\ \mathrm{fixed})
\]

\subsection{Worked example}
One mole of ideal gas expands isothermally at $T=300\,\text{K}$ from $V_1=10\,\text{L}$ to $V_2=20\,\text{L}$. Because $T$ is fixed, the Helmholtz free energy change is
\[
\Delta F = -nRT\ln\frac{V_2}{V_1} = -(1)(8.314)(300)\ln 2 = -1.73\,\text{kJ}.
\]
The maximum non-expansion work obtainable from this change is $W_{\text{max}}=-\Delta F=1.73\,\text{kJ}$. If the expansion is performed irreversibly against a constant external pressure $P_{\text{ext}}=P_2=1.24\,\text{atm}$, the actual work extracted is only
\[
|W| = P_{\text{ext}}(V_2-V_1) = (1.24\times10^5\,\text{Pa})(10\times10^{-3}\,\text{m}^3) = 1.24\,\text{kJ},
\]
which is less than the reversible maximum.

\subsection{Problems with Solutions}
\paragraph{Problem 1} Calculate the efficiency of a Carnot engine operating between $T_H=600\,\text{K}$ and $T_C=300\,\text{K}$.

\emph{Solution.} $\eta = 1 - T_C/T_H = 1 - 300/600 = 0.50$, or $50\%$.

\paragraph{Problem 2} A gas with $\gamma=5/3$ undergoes adiabatic reversible expansion from $(P_1=2\,\text{atm},V_1=1\,\text{L})$ to $V_2=2\,\text{L}$. Find the final pressure and temperature, assuming $n=1\,\text{mol}$.

\emph{Solution.} For a reversible adiabat, $P_1V_1^\gamma=P_2V_2^\gamma$, so $P_2=P_1(V_1/V_2)^\gamma=2(1/2)^{5/3}=0.794\,\text{atm}$. The initial temperature is $T_1=P_1V_1/nR=(2\times1.013\times10^5)(10^{-3})/8.314=24.4\,\text{K}$. Then $T_2=T_1(V_1/V_2)^{\gamma-1}=24.4(1/2)^{2/3}=15.4\,\text{K}$.

\paragraph{Problem 3} Show that for any isothermal process, the work done BY the system is maximized when the process is reversible.

\emph{Solution.} From the first and second laws, $dU=\delta Q-\delta W$ and $dS\ge\delta Q/T$. For isothermal, $dU=0$ so $\delta W=\delta Q\le T\,dS$. Thus $W\le T\Delta S = -\Delta F + \Delta U = -\Delta F$ (since $\Delta U=0$). The upper bound is attained only when equality holds, i.e., reversibly.

\paragraph{Section summary}
Reversibility sets ideal bounds on work and efficiency.

\section{Alternative Formulations and Legendre Transformations}
\subsection{Core ideas}
Different experiments control different variables, so different potentials are useful. Legendre transforms replace inconvenient extensive variables by their conjugate intensive variables, producing $F$, $H$, and $G$.

For review, be able to choose the correct thermodynamic potential and natural variables, and transform between potentials. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
F=U-TS,\qquad H=U+PV,\qquad G=U-TS+PV
\]

\subsection{Worked example}
For a simple system with $U(S)=\alpha S^2$ at fixed volume, the temperature is $T=(\partial U/\partial S)_V=2\alpha S$. Solving for $S$ gives $S=T/(2\alpha)$. The Helmholtz free energy is the Legendre transform
\[
F(T) = U - TS = \alpha\left(\frac{T}{2\alpha}\right)^2 - T\left(\frac{T}{2\alpha}\right) = \frac{T^2}{4\alpha} - \frac{T^2}{2\alpha} = -\frac{T^2}{4\alpha}.
\]
This expresses the same physics in the natural variables $(T)$ rather than $(S)$.

\subsection{Problems with Solutions}
\paragraph{Problem 1} From the Euler equation $U=TS-PV+\mu N$, show that $G=\mu N$.

\emph{Solution.} By definition $G=U-TS+PV$. Substituting the Euler relation gives $G=(TS-PV+\mu N)-TS+PV=\mu N$.

\paragraph{Problem 2} Given $U(S,V)=aS^4/V^2$, find $F(T,V)$.

\emph{Solution.} $T=(\partial U/\partial S)_V=4aS^3/V^2$, so $S=(TV^2/4a)^{1/3}$. Then
\[
F=U-TS=\frac{aS^4}{V^2}-TS=-\frac{3}{4}\left(\frac{T^4V^2}{4a}\right)^{1/3}.
\]
\paragraph{Problem 3} Why are the natural variables of $F$ temperature and volume?

\emph{Solution.} The differential is $dF = -S\,dT - P\,dV + \mu\,dN$. Because $dF$ is expressed in terms of $dT$, $dV$, and $dN$, these are the natural variables, meaning all other thermodynamic quantities can be obtained as derivatives with respect to them.

\paragraph{Section summary}
Thermodynamic potentials are adapted to controlled variables.

\section{The Extremum Principle in the Legendre Transformed Representations}
\subsection{Core ideas}
Equilibrium can be found by minimizing the appropriate potential: $U$ at fixed entropy, $F$ at fixed temperature and volume, $G$ at fixed temperature and pressure. These criteria are equivalent forms of the entropy maximum principle.

For review, be able to apply minimum principles to common constraints and interpret metastability. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
(T,V,N):\quad F\ \mathrm{minimum},\qquad (T,P,N):\quad G\ \mathrm{minimum}
\]

\subsection{Worked example}
A substance at $T=300\,\text{K}$ and $P=1\,\text{atm}$ can exist as a liquid or a vapor. At this point, $G_{\text{liq}}=-10.0\,\text{kJ/mol}$ and $G_{\text{vap}}=-9.5\,\text{kJ/mol}$. Because $G$ is minimized at fixed $T$ and $P$, the liquid is the stable phase. If a small fluctuation created a vapor bubble, $\Delta G = G_{\text{vap}}-G_{\text{liq}}=+0.5\,\text{kJ/mol}>0$, so the bubble would collapse.

\subsection{Problems with Solutions}
\paragraph{Problem 1} Show that at fixed $T$ and $V$, the Helmholtz free energy $F$ is minimized at equilibrium.

\emph{Solution.} For a system in contact with a thermal reservoir at $T$, the total entropy change is $\Delta S_{\text{tot}}=\Delta S_{\text{sys}}+\Delta S_{\text{res}}$. The reservoir gives heat $-T\Delta S_{\text{res}}=\Delta U_{\text{sys}}$ (if only heat is exchanged). Thus $\Delta S_{\text{tot}}=\Delta S_{\text{sys}}-\Delta U_{\text{sys}}/T=-\Delta F_{\text{sys}}/T$. Since $\Delta S_{\text{tot}}\ge 0$, we have $\Delta F_{\text{sys}}\le 0$, so $F$ decreases and is minimized.

\paragraph{Problem 2} A system has $F(T,V)=-Nk_BT\ln(V/V_0)+f(T)$. Find the pressure and show that at fixed $T$, $F$ is minimized when the system adopts the volume consistent with the external pressure.

\emph{Solution.} $P=-(\partial F/\partial V)_T=Nk_BT/V$. Consider a fluctuation $\delta V$ at fixed $T$. Then $\delta F = -(Nk_BT/V)\delta V + \frac{1}{2}(Nk_BT/V^2)(\delta V)^2+\cdots$. The first-order term vanishes at the equilibrium volume where $P_{\text{ext}}=Nk_BT/V$. The second derivative $\partial^2F/\partial V^2=Nk_BT/V^2>0$ confirms a minimum.

\paragraph{Section summary}
Equilibrium is an extremum principle in the right variables.

\section{Stability of Thermodynamic Systems}
\subsection{Core ideas}
Stable systems resist small fluctuations. Concavity of entropy and convexity of potentials imply positive heat capacities, compressibilities, and susceptibilities. Instability signals phase separation or a transition.

For review, be able to use second-derivative tests, identify stable response signs, and interpret spinodal regions. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
C_V>0,\qquad \kappa_T=-\frac1V\left(\frac{\partial V}{\partial P}\right)_T>0
\]

\subsection{Worked example}
For an ideal gas, $C_V=\frac{3}{2}nR$ and the isothermal compressibility is $\kappa_T=1/P$. Both are strictly positive for all equilibrium states. Suppose a hypothetical gas had $P=nRT/(V-nb)-an^2/V^2$ (van der Waals). Then
\[
\left(\frac{\partial P}{\partial V}\right)_T = -\frac{nRT}{(V-nb)^2}+\frac{2an^2}{V^3}.
\]
The stability condition $\kappa_T^{-1}=-V(\partial P/\partial V)_T>0$ becomes
\[
\frac{nRTV}{(V-nb)^2} > \frac{2an^2}{V^2}.
\]
For temperatures below the critical temperature $T_c=8a/(27Rb)$, there is a region of $V$ where this inequality fails. This unstable region lies between the spinodal points and corresponds to the unphysical part of the van der Waals isotherm.

\subsection{Problems with Solutions}
\paragraph{Problem 1} Show that $C_P>C_V$ for any stable system.

\emph{Solution.} The general identity is $C_P-C_V=TV\alpha^2/\kappa_T$. Stability requires $T>0$, $V>0$, $\kappa_T>0$, and $\alpha^2\ge0$. Therefore $C_P-C_V\ge0$, with equality only when $\alpha=0$.

\paragraph{Problem 2} A fluid has $C_V=aT^3V$ and $\kappa_T=b/T$ with $a,b>0$. Are the stability conditions satisfied at all temperatures?

\emph{Solution.} Yes: $C_V>0$ for $T>0$, and $\kappa_T>0$ for $T>0$. The system is stable.

\paragraph{Problem 3} For a van der Waals gas with $a=0.365\,\text{Pa\,m}^6\text{/mol}^2$ and $b=4.29\times10^{-5}\,\text{m}^3\text{/mol}$, estimate the critical temperature.

\emph{Solution.} $T_c=8a/(27Rb)=(8\times0.365)/(27\times8.314\times4.29\times10^{-5})\approx 304\,\text{K}$.

\paragraph{Section summary}
Stability is encoded in the curvature of thermodynamic potentials.

\section{First-Order Phase Transitions}
\subsection{Core ideas}
First-order transitions occur when two phases have equal thermodynamic potential but different entropy or volume. Latent heat, coexistence curves, metastability, nucleation, and Maxwell constructions describe their behavior.

For review, be able to use equality of chemical potentials, apply Clapeyron equation, and interpret latent heat. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
\mu_\alpha(T,P)=\mu_\beta(T,P),\qquad \frac{dP}{dT}=\frac{\Delta S}{\Delta V}=\frac{L}{T\Delta V}
\]

\subsection{Worked example}
For the ice--water transition at $0^\circ\text{C}$, the molar enthalpy of fusion is $\Delta H_{\text{fus}}=6.01\,\text{kJ/mol}$ and the volume change is $\Delta V=V_{\text{liq}}-V_{\text{ice}}=-1.6\times10^{-6}\,\text{m}^3\text{/mol}$. The Clapeyron equation gives the slope of the coexistence curve:
\[
\frac{dP}{dT} = \frac{\Delta H_{\text{fus}}}{T\Delta V} = \frac{6010}{(273.15)(-1.6\times10^{-6})} \approx -13.7\,\text{MPa/K}.
\]
The negative slope means increasing pressure lowers the melting point, explaining why ice skates melt a thin layer of ice.

\subsection{Problems with Solutions}
\paragraph{Problem 1} Water boils at $100^\circ\text{C}$ with $\Delta H_{\text{vap}}=40.7\,\text{kJ/mol}$. Treating the vapor as ideal and neglecting the liquid volume, estimate $dP/dT$ at the boiling point.

\emph{Solution.} $\Delta V\approx V_{\text{gas}}=RT/P=(8.314)(373.15)/(1.013\times10^5)\approx 0.0306\,\text{m}^3\text{/mol}$. Then
\[
\frac{dP}{dT}=\frac{40700}{(373.15)(0.0306)}\approx 3.56\times10^3\,\text{Pa/K}=0.035\,\text{atm/K}.
\]
\paragraph{Problem 2} Two phases $\alpha$ and $\beta$ coexist at $(T_0,P_0)$. If $\mu_\alpha(T,P)=\mu_\beta(T,P)$ defines the coexistence curve, explain why crossing it discontinuously changes $S$ and $V$.

\emph{Solution.} Along the curve $d\mu_\alpha=d\mu_\beta$. Using $d\mu=-S\,dT+V\,dP$ (per mole), the slope is $dP/dT=\Delta S/\Delta V$. A first-order transition has $\Delta S\neq0$ and $\Delta V\neq0$, so $S$ and $V$ jump discontinuously across the curve.

\paragraph{Problem 3} Sketch a Maxwell construction on a van der Waals $P$-$V$ isotherm below $T_c$ and explain its physical meaning.

\emph{Solution.} The oscillating part of the isotherm violates $\kappa_T>0$. The Maxwell construction replaces it with a horizontal line at $P_{\text{eq}}$ such that the areas above and below the line are equal. This ensures $\mu_\alpha=\mu_\beta$ and describes liquid-vapor coexistence.

\paragraph{Section summary}
First-order transitions are phase coexistence with discontinuous first derivatives.

\section{Properties of Materials}
\subsection{Core ideas}
Material properties are thermodynamic derivatives: heat capacities, compressibilities, expansion coefficients, susceptibilities, and elastic moduli. Maxwell relations connect derivatives that may be easier to measure.

For review, be able to derive response functions, use Maxwell relations, and relate microscopic behavior to macroscopic coefficients. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
\left(\frac{\partial S}{\partial V}\right)_T=\left(\frac{\partial P}{\partial T}\right)_V,\qquad C_P-C_V=TV\frac{\alpha^2}{\kappa_T}
\]

\subsection{Worked example}
For one mole of ideal gas, the Maxwell relation $(\partial S/\partial V)_T=(\partial P/\partial T)_V$ gives
\[
\left(\frac{\partial S}{\partial V}\right)_T = \left(\frac{\partial}{\partial T}\frac{nRT}{V}\right)_V = \frac{nR}{V}.
\]
Integrating at fixed $T$ yields $S(T,V)=nR\ln V+f(T)$, where $f(T)$ is an integration function. This confirms the logarithmic volume dependence of the entropy of an ideal gas without needing statistical mechanics.

\subsection{Problems with Solutions}
\paragraph{Problem 1} Derive $C_P-C_V=TV\alpha^2/\kappa_T$ for an ideal gas and verify that $C_P-C_V=nR$.

\emph{Solution.} For an ideal gas, $\alpha=1/T$ and $\kappa_T=1/P$. Thus
\[
C_P-C_V = TV\frac{(1/T)^2}{1/P} = \frac{PV}{T} = nR.
\]
\paragraph{Problem 2} Mercury at $300\,\text{K}$ has $\alpha=1.81\times10^{-4}\,\text{K}^{-1}$, $\kappa_T=3.82\times10^{-11}\,\text{Pa}^{-1}$, and $V_m=1.48\times10^{-5}\,\text{m}^3\text{/mol}$. Estimate $C_{P,m}-C_{V,m}$.

\emph{Solution.} Using $C_P-C_V=TV\alpha^2/\kappa_T$:
\[
C_{P,m}-C_{V,m} = \frac{(300)(1.48\times10^{-5})(1.81\times10^{-4})^2}{3.82\times10^{-11}} \approx 3.81\,\text{J/mol$\cdot$K}.
\]
\paragraph{Problem 3} Use the Maxwell relation $(\partial T/\partial P)_S=(\partial V/\partial S)_P$ together with $C_P=T(\partial S/\partial T)_P$ to show that for an adiabatic process $(\partial T/\partial P)_S=T\alpha V/C_P$.

\emph{Solution.} Start from $(\partial T/\partial P)_S = (\partial V/\partial S)_P$. Write
\[
\left(\frac{\partial V}{\partial S}\right)_P = \left(\frac{\partial V}{\partial T}\right)_P\left(\frac{\partial T}{\partial S}\right)_P = V\alpha \cdot \frac{T}{C_P} = \frac{TV\alpha}{C_P}.
\]

\paragraph{Section summary}
Response functions summarize how materials react to changed conditions.

\section{Part II: Statistical Mechanics}
\subsection{Core ideas}
Statistical mechanics explains where entropy, temperature, equations of state, and fluctuations come from. It also extends thermodynamics to finite systems, fluctuations, and microscopic models.

For review, be able to connect partition functions to free energies and explain why thermodynamic laws emerge statistically. Keep the physical question visible: identify the degrees of freedom, the conserved quantities, the approximation being made, and the observable that would be measured.

\subsection{Mathematical spine}
\[
Z=\sum_s e^{-\beta E_s},\qquad F=-k_BT\ln Z
\]

\subsection{Worked example}
A quantum system has two energy levels, $E_1=0$ and $E_2=\epsilon=0.100\,\text{eV}$. At $T=300\,\text{K}$, $k_BT\approx0.02585\,\text{eV}$. The partition function is
\[
Z = e^{-\beta E_1}+e^{-\beta E_2} = 1+e^{-0.100/0.02585} = 1+e^{-3.868} \approx 1.0209.
\]
The probability of occupying the excited state is
\[
p_2 = \frac{e^{-\beta\epsilon}}{Z} \approx \frac{0.0209}{1.0209} \approx 0.0205.
\]
The average energy is $U=p_2\epsilon\approx 2.05\times10^{-3}\,\text{eV}$, and the Helmholtz free energy is
\[
F = -k_BT\ln Z = -(0.02585)\ln(1.0209) \approx -5.36\times10^{-4}\,\text{eV}.
\]
\subsection{Problems with Solutions}
\paragraph{Problem 1} A three-level system has energies $0$, $\epsilon$, and $2\epsilon$. Find the partition function $Z$, the average energy $U$, and the heat capacity $C_V$ as functions of $T$.

\emph{Solution.} $Z=1+e^{-\beta\epsilon}+e^{-2\beta\epsilon}$.
\[
U = -\frac{\partial\ln Z}{\partial\beta} = \frac{\epsilon(e^{-\beta\epsilon}+2e^{-2\beta\epsilon})}{1+e^{-\beta\epsilon}+e^{-2\beta\epsilon}}.
\]
Then $C_V=(\partial U/\partial T)_V = k_B\beta^2(\langle E^2\rangle-\langle E\rangle^2)$, where $\langle E^2\rangle=(\epsilon^2e^{-\beta\epsilon}+4\epsilon^2e^{-2\beta\epsilon})/Z$.

\paragraph{Problem 2} $N$ independent two-level systems (each with energies $0$ and $\epsilon$) form a solid. Find the total partition function and free energy.

\emph{Solution.} For one system, $Z_1=1+e^{-\beta\epsilon}$. Because the systems are independent and distinguishable (localized), $Z=(Z_1)^N=(1+e^{-\beta\epsilon})^N$. The free energy is
\[
F = -k_BT\ln Z = -Nk_BT\ln(1+e^{-\epsilon/k_BT}).
\]
\paragraph{Problem 3} Show that the statistical entropy $S=-(\partial F/\partial T)_V$ yields the familiar expression $S=k_B(\ln Z+\beta U)$.

\emph{Solution.} $F=-k_BT\ln Z$, so
\[
S = -\left(\frac{\partial F}{\partial T}\right)_V = k_B\ln Z + k_BT\left(\frac{\partial\ln Z}{\partial T}\right)_V.
\]
Since $\beta=1/k_BT$, $\partial\ln Z/\partial T = (\partial\ln Z/\partial\beta)(d\beta/dT)=(-U)(-1/k_BT^2)=U/k_BT^2$. Therefore
\[
S = k_B\ln Z + k_BT\cdot\frac{U}{k_BT^2} = k_B(\ln Z+\beta U).
\]

\paragraph{Section summary}
Statistical mechanics is the microscopic foundation of thermodynamics.

\end{document}
