The energy contribution of a frequency at finite temperature This is from a paper I'm reading:

Since each frequency contributes $\hbar \omega/2$ of energy (or at finite temperature, $\hbar \omega /2 \coth(\hbar\omega/2kT)$), we can find the energies for the isolated clusters ...

I'm not familiar with the latter expression, I did not find it in my textbooks, and Google isn't exactly handy when searching for an equation. So could someone explain where the $\coth$ term comes in?
 A: In statistical mechanics, at least when you can ignore the spin of the particles you're dealing with, the occupation number of a quantum state (that is, the number of particles in the state, or probability of a particle being found in the state) is proportional to $e^{-E/kT}$, where $E$ is the energy of the state. If you have a harmonic oscillator at temperature $T$, which has states with energies $(n+\frac{1}{2})\hbar\omega$, that means the average energy stored in the oscillator is
$$\begin{align}
\langle E\rangle &= \sum_n P(n) E_n \\
&= \frac{1}{Z}\sum_n e^{-(n + 1/2)\hbar\omega/kT}\biggl(n + \frac{1}{2}\biggr)\hbar\omega \\
&= \frac{1}{Z}\frac{\hbar\omega}{2}e^{\hbar\omega/2kT}\frac{e^{\hbar\omega/kT} + 1}{e^{\hbar\omega/kT} - 1}
\end{align}$$
The partition function $Z$ is just a normalization factor to satisfy the requirement that $\sum_n P(n) = 1$; it works out to
$$Z = \sum_n e^{-(n+1/2)\hbar\omega/kT} = \frac{e^{\hbar\omega/2kT}}{e^{\hbar\omega/kT} - 1}$$
and if you plug that in to the expression for $\langle E\rangle$, you find that
$$\langle E\rangle = \frac{\hbar\omega}{2}\coth\frac{\hbar\omega}{2kT}$$
Physically the $\coth$ factor comes from the fact that, in a population of harmonic oscillators at nonzero temperature (note that in the paper they use "finite" to mean "nonzero"), some of them will be excited to higher energy states than their ground state, and will thus have more than the baseline $\frac{\hbar\omega}{2}$ of energy.
