= Solution
The <internal energy> is the canonical mean of the <energy>:
$$
U_{\rm sys}=\sum_j\epsilon_j\,\frac{g_je^{-\beta\epsilon_j}}Z.
$$
Holding the external mechanical parameters fixed, so that the spectrum and degeneracies do not change when differentiating with respect to $\beta$, gives
$$
\frac{\partial Z}{\partial\beta}=-\sum_jg_j\epsilon_je^{-\beta\epsilon_j}.
$$
Comparison yields
$$
\boxed{U_{\rm sys}=-\frac1Z\frac{\partial Z}{\partial\beta}=-\frac{\partial\ln Z}{\partial\beta},\qquad \beta=\frac1{k_BT}.}
$$
An explicitly temperature-dependent effective Hamiltonian would require care: differentiating its partition sum would also differentiate the assigned <energy levels>. The stated result uses the fixed physical spectrum of the canonical system.
Back to article page