# Quantum harmonic ocillator and the mean energy U(T)

The energy of a quantum harmonic oscillator is given by: $$E(n)=\hbar\omega\left(n+\frac{1}{2}\right)$$

The canonical partition function is given by: $$Z(T)=\sum_{n=o}^\infty e^{-\beta E(n)}=\sum_{n=o}^\infty e^{\frac{-\beta \hbar\omega}{2}} e^{-\beta\hbar\omega n}=\sum_{n=o}^\infty e^\frac{-\beta \hbar\omega}{2} \left(e^{-\beta\hbar\omega}\right)^n=\sum_{n=o}^\infty \frac{e^{\frac{-\beta \hbar\omega}{2}}}{1-e^{-\beta\hbar\omega}}$$

The mean energy is given by $$U(T)=\left\langle E \right\rangle=\frac{1}{Z}\sum_{n=o}^\infty E(n) e^{-\beta E(n)}$$

The professor (Solid State Physics) asked us to calculate the mean energy.

For me the $Z$ and the $e^{-\beta E(n)}$ terms cancel each other, which leaves us only with $\sum_{n=o}^\infty E(n)$ which for me is equal to: $$\sum_{n=o}^\infty E(n)= \hbar\omega\left(\frac{1}{2}+\left\langle n \right\rangle\right)$$

The professor got to the same result but he wrote on the board: $$U(T)=\frac{\hbar\omega}{2}+\frac{\hbar\omega e^{-\beta\hbar\omega}}{1-e^{-\beta\hbar\omega}}=\hbar\omega\left(\frac{1}{2}+\left\langle n \right\rangle\right)$$

I would like to know where the $\frac{e^{-\beta\hbar\omega}}{1-e^{-\beta\hbar\omega}}$ term is coming from

Thanks

• you can't cancel the exponential terms from the two sums... sub in the expression for $E(n)$ and you should be able to rewrite the energy sum as a geometric series... – danimal Apr 1 '15 at 23:51

But

$$\frac{\sum_{n=o}^\infty E(n) e^{-\beta E(n)}}{\sum_{n=o}^\infty e^{-\beta E(n)}} \ne \sum_{n=o}^\infty E(n)$$

Instead $$\frac{\sum_{n=o}^\infty E(n) e^{-\beta E(n)}}{\sum_{n=o}^\infty e^{-\beta E(n)}} = \frac{\sum_{n=o}^\infty \hbar \omega(n + \frac{1}{2}) e^{-\beta E(n)}}{\sum_{n=o}^\infty e^{-\beta E(n)}}=\hbar \omega\left(\frac{1}{2} + \frac{\sum_{n=o}^\infty n e^{-\beta E(n)}}{\sum_{n=o}^\infty e^{-\beta E(n)}}\right)$$

$$=\hbar \omega\left(\frac{1}{2} + \langle n \rangle \right)$$

Also

$$\langle n \rangle = \frac{\sum_{n=o}^\infty n e^{-\beta E(n)}}{\sum_{n=o}^\infty e^{-\beta E(n)}} = \frac{1 - e^{-\beta\hbar\omega}}{e^{-\beta\hbar\omega/2}}\sum_{n=o}^\infty n e^{-\beta E(n)} = \frac{1 - e^{-\beta\hbar\omega}}{e^{-\beta\hbar\omega/2}}\frac{e^{-\beta\hbar\omega/2}e^{-\beta\hbar\omega}}{\left(1 - e^{-\beta\hbar\omega}\right)^2}$$

$$= \frac{e^{-\beta\hbar\omega}}{1 - e^{-\beta\hbar\omega}} = \frac{1}{e^{\beta\hbar\omega} - 1}$$