The energy is proportional to the first derivative of the potential, Helmholtz' free energy. The corresponding variance is defined as σ2E=⟨E2⟩−⟨E⟩2=1ZM∑i=1E2ie−βEi−(1ZM∑i=1Eie−βEi)2. If we divide the latter quantity with kT2 we obtain the specific heat at constant volume CV=1kBT2(⟨E2⟩−⟨E⟩2), which again can be related to the second derivative of Helmholtz' free energy.