Vibrational heat capacity of a diatomic gas (source code)

= Vibrational heat capacity of a diatomic gas
{title2=$C_{V,\mathrm{vib}}=Nk_Bx^2e^x/(e^x-1)^2$}

In the independent harmonic approximation, each <diatomic molecule> has one bond-stretching <quantum harmonic oscillator> with energies $(n+1/2)\hbar\omega$. Write $x=\hbar\omega/(k_BT)$. Its <canonical partition function> is $z=e^{-x/2}/(1-e^{-x})$, and differentiating its logarithm gives
$$
U_{\mathrm{vib}}=N\hbar\omega\left(\frac12+\frac1{e^x-1}\right),\qquad C_{V,\mathrm{vib}}=Nk_B\frac{x^2e^x}{(e^x-1)^2}.
$$
For $T\ll\hbar\omega/k_B$, excitation is exponentially suppressed and the heat capacity tends to zero. At high temperature it tends to $Nk_B$, one $k_B/2$ contribution from each quadratic kinetic and potential term. The zero-point energy does not contribute to the derivative with temperature. For a dilute gas whose rotations are already active, adding translation and rotation gives molar $C_V\simeq5R/2$ before vibration is activated and $7R/2$ afterwards, provided dissociation and electronic excitations are negligible.