Substituting $n_B$ into, the expression for the oscillator energy, obtain the expectation value of the energy stored in the oscillator at temperature $T$—the *thermal energy*:
Substituting $n_B$ into, the expression for the oscillator energy, we obtain the expectation value of the energy stored in the oscillator at temperature $T$—the *thermal energy*:
$$
\begin{align}
\langle E \rangle &= \frac{1}{2}\hbar\omega_0+\hbar\omega_0 \langle n \rangle \\