# Why are there two different averages for the kinetic energy in a harmonic oscillator?

Question:

A particle of mass m executes simple harmonic motion with amplitude a and frequency v. The average kinetic energy during its motion from the position of equilibrium to the end is?

Problem:

For trying to find the answer I used integration to find the average value of the velocity as time dependent function

$$\frac{1}{2}mv^2=\frac{1}{2}mA^2\omega^2\cos^2{\omega t},$$

from $$0$$ to $$\frac{\pi}{2\omega}$$, I am getting $$\pi^2ma^2\nu^2$$, which is correct.

However when using velocity as a function of position

$$\frac{1}{2}mv^2=\frac{1}{2}mw^2(A^2-x^2)$$

from $$0$$ to $$A$$ I am getting a different answer, $$\frac{1}{3}\pi^2ma^2\nu^2$$.

Why is that the case?

• The answers above are both wrong, by the way, but you can easily check them and correct them. This doesn't have any impact on my answer below, though. – user197851 Oct 2 '18 at 14:25
• I have reopened this question since it asks a conceptual question which I tried to make clearer by editing the title. – ACuriousMind Oct 2 '18 at 16:27

The time-average of $$\frac{1}{2}mv^2$$ is indeed different from the position-average of the same quantity. There's a different weighting. Actually, any mean value might be defined to include a weighting function, but unless it is specified explicitly, we usually assume an unweighted mean. However, for continuous functions of some variable, the formula for the mean involves integrating with respect to that variable, which implies you have made some choice about the weight.
In your case, you have two obvious candidates. Imagine sampling $$N$$ discrete values of the kinetic energy at regular intervals of time, and averaging them by adding them up and dividing by $$N$$. Now imagine that you sample the $$N$$ values at regularly spaced positions, and again average them in the same way. You would not expect to get the same result: the particle is moving much faster through the position $$x=0$$, so it spends far less time around that position than around the extremities of the oscillation. The time average will emphasize the lower speeds, compared with the position average.
Explicitly we can write \begin{align*} \langle \tfrac{1}{2}mv^2 \rangle_x &= \frac{\int_0^A \left(\tfrac{1}{2}mv(x)^2\right) dx }{\int_0^A dx} \\ \text{and}\quad \langle \tfrac{1}{2}mv^2 \rangle_t &= \frac{\int_0^{\pi/2\omega} \left(\tfrac{1}{2}mv(t)^2\right) dt }{\int_0^{\pi/2\omega} dt} \end{align*} If we change variables in the first equation, using $$dx = v\, dt$$, we can see the weight appear explicitly $$\langle \tfrac{1}{2}mv^2 \rangle_x = \frac{\int_0^{\pi/2\omega} v(t)\, \left(\tfrac{1}{2}mv(t)^2\right) dt }{\int_0^{\pi/2\omega} v(t)\, dt}$$ The time average is given by a similar expression, but without the $$v$$ weighting in the numerator and denominator. The position average has given more weight to the higher velocities. (Incidentally, if we integrate over a full period, we need to take a little more care with the sign of the weighting factor)