Hi! In the Debye model lecture notes, the equation for the expectation of energy (total energy) is given, just below the equation for the dispersion relation. In the equation, however, the n_B (\hbar \omega) -term should be n_B (\beta \hbar \omega). The equation right afterwards does state the term, and so does the book on page 11.
Cheers!