# Energy of harmonic oscillators

I've calculated the energy of a classical harmonic oscillator (HO) as:

\begin{align*} \overline E = \overline{E_K} + \overline{E_P} = \frac{\overline{p^2}}{2m} + \frac{k\overline{x^2}}{2} = \frac{k_B T}{2} + \frac{k_B T}{2} = k_B T \end{align*}

And the energy of a classical 3-dimensional HO as:

$$3 k_B T$$

My reasoning was that a 3-dimensional HO is simply 3 orthogonal 1D HOs, so you just sum the energy, but I've been told that my reasoning is wrong (yet my answer is correct).

How do you define a 3D HO and calculate its energy?

Also, why does: $$\frac{\overline{p^2}}{m} = k_B T = k \overline{x^2} \\$$

I can see by dimensional analysis that they have the same units, and I can see that this is the same as the quantum-mechanical prediction for $$T \gg 0$$, but I'm struggling to understand the intuition behind it. Surely the energy of an oscillator must depend on its momentum?

Even without statistical mechanics, it is a results of classical mechanics (virial theorem) that for each cartesian component of position and momentum of a harmonic oscillator $$\left=\left$$ if the average $$< ... >$$ is interpreted as time average over a period of oscillation $$\tau$$.

The simplest way to see is by starting with $$=\frac{1}{\tau}\int_0^{\tau}x(t)F_x(t)dt=\frac{m}{\tau}\int_0^{\tau}x(t)\ddot x(t)dt= \frac{m}{\tau}\left[ x(\tau)\dot x(\tau)-x(0)\dot x(0) \right] -\frac{m}{\tau}\int_0^{\tau}\dot x^2(t)dt=-\frac{m}{\tau}\int_0^{\tau}\dot x^2(t)dt = -2$$ where the square bracket vanishes for the periodicity of the motion. Moreover $$ = - = - 2 ,$$ and we get the results.

Once one adds statistical mechanics, the connection with $$k_BT/2$$ for each term appears. However, I do not see anything wrong with your argument connecting 3D HO with 3 1D HO. It is a valid and well founded argument since the energy of a 3D HO can always be written as $$E = \frac{1}{2m}(p^2_x+p^2_y+p^2_z) + \frac{k}{2}(x^2+y^2+z^2)$$

The Hamiltonian for an harmonic oscillator is \begin{align} \mathscr{H}=\frac{p^2}{2m}+\frac{1}{2}m\omega^2x^2 \end{align} If we're interested in the thermodynamic properties of a set of oscillators, let's say there are $$N$$ of them, then we're interested in the partition function \begin{align} \mathscr{Z}=\int\Pi_i dx_i dp_i\exp\left(-\beta\sum_i\frac{p_i^2}{2m}+\frac{1}{2}m\omega^2x_i^2\right) \end{align} But these are just Gaussian integrals and we can do them exactly. If we have $$N$$ oscillators, then we have $$2N$$ Gaussian integrals ($$N$$ position integrals and $$N$$ momentum integrals). Each momentum integral is \begin{align} \int dp_i\exp\left(-\beta \frac{p_i^2}{2m}\right)=\sqrt{\frac{4\pi m}{\beta}} \end{align} Each position integral equals \begin{align} \int dx_i\exp\left(-\beta \frac{1}{2}m\omega^2x_i^2\right)=\sqrt{\frac{4\pi}{\beta m\omega^2}} \end{align} So each pair of momentum-position integrals evaluates to \begin{align} \frac{4\pi}{\beta \omega} \end{align} and so if we have $$N$$ oscillators the partition function is then \begin{align} \mathscr{Z}=\left(\frac{4\pi}{\beta \omega}\right)^N \end{align}

Okay. Now, for a single oscillator in three dimensions, the Hamiltonian is the sum of three one dimensional oscillators: one for $$x$$ one for $$y$$ one for $$z$$. So the partition function is \begin{align} \mathscr{Z}=\left(\frac{4\pi}{\beta \omega}\right)^3 \end{align} To find the expectation value of the energy, we use $$\bar{E}=-\partial_\beta\log\mathscr{Z}=3/\beta=3kT$$.

If you want the expectation value of $$p^2$$ or $$x^2$$ separately, then put $$x^2$$ or $$p^2$$ in the above Gaussian integrals and run through the same calculation but some of your integrals will be of the form $$\int x^2e^{-x^2}$$, which is also a straightforward integral.

The $$3kT$$ thing is the equipartition theorem: each degree of freedom comes with $$kT/2$$ energy; a "degree of freedom" might be thought of as a quadratic thing in the Hamiltonian, of which we have six (three positions three momenta).