Partition Function Problems: A Two-Level System With Limits
Solve a two-level system with the partition function: probabilities, average energy, heat capacity and entropy, with limits and numeric checks at several temperatures.
Professor Eric Editorial · Nov 29, 2026 · 7 min read
In this article
- What are the conditions of this problem?
- How do you build and use the partition function?
- What do the numbers look like?
- How do you find the heat capacity?
- How do you test the limits?
- How do you extend the method?
- What assignments does this help with, and what help is allowed?
- Partition function checklist
- Frequently asked questions
- Try your own system
The partition function is the central object of equilibrium statistical mechanics. Once you know it, the average energy, entropy and heat capacity follow by derivatives. The two-level system is the best first example, because every step can be done by hand and every result checked against intuition.
What are the conditions of this problem?
A single system with two non-degenerate energy levels, 0 and ε (ε > 0), in thermal equilibrium with a heat bath at temperature T. This is the canonical ensemble. Write β = 1/(kT), where k is Boltzmann's constant, 8.617 × 10⁻⁵ eV/K. The system is distinguishable and independent of others, and the levels don't change with T. Courses that use this are calculus-based modern physics, thermal physics or statistical mechanics, and physical chemistry. It isn't part of AP Physics. AP is a trademark of the College Board, which isn't affiliated with Professor Eric.
How do you build and use the partition function?
Definition: Z = Σ e^(−βEᵢ), summed over all states i. For levels 0 and ε:
Z = 1 + e^(−βε)
The probability of a state is its Boltzmann factor divided by Z. So the probability of the upper level is
p₁ = e^(−βε) / (1 + e^(−βε)) = 1 / (e^(βε) + 1)
and p₀ = 1 − p₁. The average energy is ⟨E⟩ = −∂(ln Z)/∂β, which gives
⟨E⟩ = ε / (e^(βε) + 1) = ε p₁
This is the same as summing energy times probability directly, which is the check: ε × p₁ + 0 × p₀.
What do the numbers look like?
At 300 K, kT = 8.617 × 10⁻⁵ × 300 = 0.02585 eV, so βε = 0.100 / 0.02585 = 3.868. Then:
- Z = 1 + e^(−3.868) = 1.0209
- p₁ = 1 / (e^3.868 + 1) = 0.0205, so about 2% of such systems are in the upper level
- ⟨E⟩ = 0.100 × 0.0205 = 2.05 × 10⁻³ eV
Check the derivative numerically. Differentiating ln Z numerically to get ⟨E⟩ = kT² ∂(ln Z)/∂T reproduced the closed-form result for three parameter sets: ε = 0.100 eV at 300 K, ε = 0.050 eV at 150 K and ε = 0.100 eV at 1000 K. At 1000 K, for example, the closed form gives 0.02386 eV, and the derivative gave the same value to seven digits.
How do you find the heat capacity?
The heat capacity at fixed level spacing is C = d⟨E⟩/dT. Doing the derivative:
C = k (ε/kT)² e^(ε/kT) / (1 + e^(ε/kT))²
At 300 K for ε = 0.100 eV, C = 0.300 k. At 1000 K, it is 0.2446 k. A numerical derivative of ⟨E⟩ matched both. The two sets with βε = 3.868 (ε = 0.100 eV at 300 K and ε = 0.050 eV at 150 K) give the same C/k, which confirms that C/k depends only on the combination ε/kT.
This function has a maximum, the Schottky anomaly. Searching numerically, the peak value is C = 0.439 k at kT = 0.417 ε. For ε = 0.100 eV that is T ≈ 483 K. The peak appears because heat capacity is large when the temperature allows the upper level to become populated. At lower T the upper level is frozen out, and at higher T it is about half-full and can't absorb more energy.
How do you test the limits?
- T → 0 (βε → ∞): p₁ → 0 and ⟨E⟩ → 0. At 3 K, ⟨E⟩ is below 10⁻¹⁶⁸ eV, so effectively zero. The system sits in its ground state. C → 0 as well, as the third law requires.
- T → ∞ (βε → 0): p₁ → 1/2 and ⟨E⟩ → ε/2. At T = 10⁶ K, ⟨E⟩ = 0.04997 eV, close to ε/2 = 0.05 eV. Both levels are equally likely, since with only two states the energy can't rise further. C → 0 as T → ∞, falling as 1/T².
- Units: βε is dimensionless, as the exponent of an exponential must be.
Entropy. From S = k (ln Z + β⟨E⟩), S = 0.0999 k at 300 K for our example, and S → k ln 2 = 0.693 k at high T (0.693147 k at 10⁶ K, compared with ln 2 = 0.693147). Using S = −k Σ p ln p gave exactly the same value at 300 K, 0.0999 k, which is a second method. At low T, S → 0 because only one state is occupied, and at high T there are two equally likely states, so S = k ln 2.
How do you extend the method?
For N independent, distinguishable two-level systems, the total partition function is Z multiplied by itself N times, and ⟨E⟩ and C are N times larger. For identical indistinguishable particles, extra care is needed with counting. Many courses then move to the quantum harmonic oscillator, the rotor and the ideal gas, using the same steps: write the states, sum the Boltzmann factors, take derivatives.
What assignments does this help with, and what help is allowed?
Partition-function problems appear on thermal physics problem sets, exams and in computational projects. Allowed help can include a model solution to a similar problem, such as a three-level system, feedback on your own derivation and tutoring on sums, derivatives and limits.
Follow your school's honor code and your instructor's rules on outside help, and submit only your own work. We don't do graded online homework, quizzes, labs or exams. See our physics assignment help page.
Partition function checklist
Your checklist
0 of 7 done
Frequently asked questions
Why is the Boltzmann factor e^(−E/kT)?
It comes from maximizing the number of ways the system and its bath can share a fixed total energy. The system is more likely to be in a state when the bath has more ways to hold the remaining energy.
Why does the heat capacity go back down at high temperature?
A two-level system has a maximum energy of ε. Once both levels are about equally occupied, raising the temperature further can't store more energy.
What does the partition function physically mean?
It is a count of the states that are thermally accessible. At low T, Z is near 1 because only the ground state counts. At high T, Z approaches the number of states.
Does the zero of energy matter?
Not for probabilities or heat capacity. Shifting all energies by a constant multiplies Z by a constant factor and shifts ⟨E⟩ by that constant.
Try your own system
Add a third level at 2ε and predict, before calculating, where the heat capacity peak moves and what the high-temperature entropy becomes. For feedback on your working, a tutor or a model solution to a similar problem can help.