In order to demonstrate the usefulness of the partition function, let us calculate the thermodynamic value of the total energy. This is simply the expected value, or ensemble average for the energy, which is the sum of the microstate energies weighted by their probabilities: ⟨ ⟨ E ⟩ ⟩ = ∑ ∑ s E s P s = 1 Z ∑ ∑ s E s e − − β β E s = − − 1 Z ∂ ∂ ∂ ∂ β β Z ( β β , E 1 , E 2 , ⋯ ⋯ ) = − − ∂ ∂ ln ⁡ ⁡ Z ∂ ∂ β β or, equivalently, ⟨ ⟨ E ⟩ ⟩ = k B T 2 ∂ ∂ ln ⁡ ⁡ Z ∂ ∂ T .