Equilibrium

The equilibrium state of a system maximizes its entropy.

Consider two gasses initially separated, then allowed to exchange energy and volume. What is necessary to maximize the entropy of the system? We use Lagrange multipliers to determine this.

F=SA+SB+λ(UUAUB)+δ(VVAVB)=kNA[lnVANA+32lnUANA+CA]+kNB[lnVBNB+32lnUBNB+CB]+λ(UUAUB)+δ(VVAVB) \begin{align*} F &= S_A + S_B + \lambda(U - U_A - U_B) + \delta(V - V_A - V_B) \\ &= k N_A \left[ \ln \frac{V_A}{N_A} + \frac 32 \ln \frac{U_A}{N_A} + C_A \right] + k N_B \left[ \ln \frac{V_B}{N_B} + \frac 32 \ln \frac{U_B}{N_B} + C_B \right] \\ &+ \lambda(U - U_A - U_B) + \delta(V - V_A - V_B) \end{align*}

Differentiate to find

FUA=32kN1UAλ=0    λ=SAUA=3kNA2UAFUB=32kN1UBλ=0    λ=SBUB=3kNB2UBFVA=kN1VAδ=0    δ=SAVA=kNAVAFVB=kN1VBδ=0    δ=SBVB=kNBVB \begin{align*} \frac{\partial F}{\partial U_A} &= \frac 32 k N \frac{1}{U_A} - \lambda = 0 \quad &\implies\quad \lambda &= \frac{\partial S_A}{\partial U_A} = \frac{3 k N_A}{2U_A} \\ \frac{\partial F}{\partial U_B} &= \frac 32 k N \frac{1}{U_B} - \lambda = 0 \quad &\implies\quad \lambda &= \frac{\partial S_B}{\partial U_B} = \frac{3 k N_B}{2U_B} \\ \frac{\partial F}{\partial V_A} &= k N \frac{1}{V_A} - \delta = 0 \quad &\implies\quad \delta &= \frac{\partial S_A}{\partial V_A} = \frac{k N_A}{V_A} \\ \frac{\partial F}{\partial V_B} &= k N \frac{1}{V_B} - \delta = 0 \quad &\implies\quad \delta &= \frac{\partial S_B}{\partial V_B} = \frac{k N_B}{V_B} \end{align*}

We see that for energy and volume to equilibrate means that S/U\partial S/\partial U and S/V\partial S/\partial V equalize as well. For an ideal gas, we see

SU=3kN2U=1T,SV=kNV=PT. \begin{align*} \frac{\partial S}{\partial U} = \frac{3kN}{2U} = \frac 1T,\quad \quad\frac{\partial S}{\partial V} = \frac{kN}{V} = \frac PT. \end{align*}

Temperature and pressure are equal.

Now consider the energy of this isolated system at equilibrium. Because it is isolated,  ⁣dU= ⁣dUA+ ⁣dUB=0\d U = \d U_A + \d U_B = 0, and because it is at equilibrium,  ⁣dS= ⁣dSA+ ⁣dSB=0\d S = \d S_A + \d S_B = 0. We can equivalently write the derivative as

SAUA ⁣dUA+SBUB ⁣dUB=0. \frac{\partial S_A}{\partial U_A} \d U_A + \frac{\partial S_B}{\partial U_B} \d U_B = 0.

We then take advantage of the fact that  ⁣dUA= ⁣dUB\d U_A = - \d U_B to say that for an isolated system at equilibrium,

SAUA=SBUB=:1T. \frac{\partial S_A}{\partial U_A} = \frac{\partial S_B}{\partial U_B} =: \frac 1T.

This gives us the thermodynamic definition of temperature.