Exercises — Average energy from partition function
Prerequisites you may want open: Partition function (canonical ensemble), Boltzmann distribution, Helmholtz free energy F = -kT ln Z, Equipartition theorem, Heat capacity and energy fluctuations, Quantum harmonic oscillator — thermal, Two-level system / Schottky anomaly.
Level 1 — Recognition
These check that you can read a and reach for the right operation — no long algebra.
Recall Solution L1.1
What: take the logarithm of , differentiate with respect to , flip the sign: Why each piece:
- folds the "divide by " into the derivative, because .
- acting on manufactures a factor — exactly the energy we want to average.
- the minus sign cancels that , leaving a positive energy when all . Mnemonic: "Log it, slope it, flip it."
Recall Solution L1.2
What: (the constant dies under the derivative). So: What it means: any is one quadratic degree of freedom — the equipartition result . You never needed the details of the system.
Level 2 — Application
Now grind a real through the machine.
Recall Solution L2.1
Setup: , and the standard result is Plug : So . The system sits mostly in the ground state (energy ) because is a bit bigger than the thermal scale .
Recall Solution L2.2
Setup: gives (see Quantum harmonic oscillator — thermal) Plug : So . (This uses the convention ; with the true ground state you would add .)
Recall Solution L2.3
What: three microstates, so Differentiate: , so
=\frac{\varepsilon e^{-\beta\varepsilon}+2\varepsilon e^{-2\beta\varepsilon}} {1+e^{-\beta\varepsilon}+e^{-2\beta\varepsilon}}.$$ **At $\beta\varepsilon=1$:** with $e^{-1}=0.36788$, $e^{-2}=0.13534$: $$\frac{\langle E\rangle}{\varepsilon}=\frac{0.36788+2(0.13534)}{1+0.36788+0.13534} =\frac{0.63856}{1.50322}=0.4248.$$ So $\langle E\rangle\approx 0.425\,\varepsilon$.Level 3 — Analysis
Here you reason about limits, signs and shapes, not just numbers.
Recall Solution L3.1
Cold, : , so . The system is frozen in the ground state — no thermal energy available to climb to . Hot, : , so Both states are now equally likely, and the mean of is . The full curve rises monotonically from to — see the figure.

Recall Solution L3.2
measures how fast changes when you warm the system.
- Cold (): everything sits in the ground state; a tiny warming can't lift anything over the gap , so barely moves ⟹ .
- Hot (): has already saturated at ; warming further does nothing ⟹ .
- In between (): thermal energy is just enough to start promoting spins across the gap, so changes fastest — a maximum in . A function that is at both ends and positive in the middle must have a peak. This bump is the Schottky anomaly (see Two-level system / Schottky anomaly).

Recall Solution L3.3
What tool and why: when , the quantity is small, so we expand the exponential with its Taylor series — the right tool because it turns a hard function into a leading power we can read off. Do it: for small . Hence What it means: the discrete quantum ladder blurs into a continuum and you recover the classical oscillator's — that's two quadratic modes (kinetic + potential), each contributing , exactly equipartition.
Level 4 — Synthesis
Combine the average-energy machine with fluctuations, free energy and multiple modes.
Recall Solution L4.1
Direct route (cross-check): with probabilities and , and energies : Derivative route: gives the same . They agree — as the fluctuation identity guarantees. At : , , so
Recall Solution L4.2
What: . With and (so ): So per spin at this temperature — on the rising flank of the Schottky bump of L3.2.
Recall Solution L4.3
Key fact: of a product is a sum: . Apply the machine: the derivative is linear, so
=\langle E\rangle_{\text{spin}}+\langle E\rangle_{\text{mode}}.$$ **Result:** $\langle E\rangle=\dfrac{\varepsilon}{e^{\beta\varepsilon}+1}+\dfrac{1}{2}k_BT$. Independent subsystems ⟹ multiply $Z$ ⟹ add energies. This is *why* the log form is so powerful: factorization becomes addition.Level 5 — Mastery
Open-ended reasoning and a degenerate/limiting case.
Recall Solution L5.1
What: each of the excited microstates carries the same weight , so Differentiate: , hence
=\frac{\varepsilon}{\tfrac1g e^{\beta\varepsilon}+1}.$$ **High-$T$ limit ($\beta\to0$):** $e^{\beta\varepsilon}\to1$, so $$\langle E\rangle\to\frac{g\varepsilon}{1+g}.$$ **Interpretation:** at infinite $T$ all $1+g$ microstates are equally likely; the fraction in the excited band is $g/(1+g)$, and each of those carries energy $\varepsilon$. Setting $g=1$ recovers the ordinary two-level answer $\varepsilon/2$. Degeneracy tilts the high-$T$ average toward $\varepsilon$.Recall Solution L5.2
The reasoning: is a weighted average with weights summing to . A weighted average of numbers can never be smaller than the smallest of them nor larger than the largest: Consequences: as all weight moves to so ; as all become equal so the plain arithmetic mean of the levels (weighted by degeneracy). The derivative machine must always land inside this window — a useful sanity check on any answer.
Recall Master checklist
Take ::: turns division by into a clean derivative and factorization into addition. Slope in ::: pulls a factor out of every weight . Flip the sign ::: cancels the , giving positive energy for . Second slope ::: , and . Always sanity-check ::: for finite spectra.