# Is “Total Energy = Kinetic + Potential” always true in a harmonic oscillator?

Consider a object executing simple harmonic motion in one dimensions due to a variable external force (like a spring maybe).
I like to think that at any point in it's motion at any time the mechanical energy of the entire system remains conserved. That is, the sum of the kinetic energy of the object and the potential energy stored in the spring(or something else) remains the same constant value throughout it's motion.

But I recently got acquainted to the following question that made me doubt my concepts. I've tried to generalize the question so that it follows the homework policy on this site.

A linear harmonic oscillator of force constant $K$ and amplitude $A$ has a total mechanical energy of $J$ joules. Find the maximum kinetic energy and the maximum potential energy.
(Assume $J > \frac 12 KA^2)$

At the extreme position of the object, the potential energy is maximum and kinetic energy is zero. Since the potential energy stored is given by $\frac 12 Kx^2$ (x is displacement from mean), I would expect it to equal $\frac 12 KA^2$ at the extrema with no kinetic energy. Why isn't the total mechanical energy $J$ equal to $\frac 12 KA^2$? (Since Total= Kinetic(0) + Potential($\frac 12 KA^2$))
The kinetic energy must be maximum at the mean position and equal to the total mechanical energy $J$ and also equal to $\frac 12 KA^2$ .

I indeed did a little research and found a similar question somewhere else and here, but that doesn't explain my point above. The first link just assumes that $J$ = Maximum potential energy but not equal to $\frac 12 KA^2$ and doesn't explain anything in detail. The second link provides a different answer where $\frac 12 KA^2$ = Maximum potential energy but not equal to $J$.

• "Consider a object executing simple harmonic motion in one dimensions due to a variable external force (like a spring maybe)." - The energy of a harmonic oscillator (even one with no damping) won't in general be conserved if you're coupling in energy to it with a "variable external force". – Samuel Weir Apr 16 '18 at 19:36
• If this is just a harmonic oscillator, the total energy should indeed be $k A^2 / 2$. There might be a mistake in the question; you should post the details (though sadly this may make the question off topic). – Javier Apr 16 '18 at 19:41
• @SamuelWeir But I've read everywhere that the total energy remains constant even if a spring is attached. – user190199 Apr 16 '18 at 19:58
• And yet the question as asked does not make sense, so either there is a mistake or we're missing something. – Javier Apr 16 '18 at 20:01
• The question makes sense if the center of mass of the system is moving. Then, even at the maximum extension, there will still be some kinetic energy from the motion of the center of mass. This means the maximum potential energy is $\frac{1}{2}KA^2$ and the maximum kinetic energy is $J$ (with the minimum kinetic energy being $J-\frac{1}{2}KA^2$). – probably_someone Apr 16 '18 at 20:52

A way of analysing a vertical spring-mass system is shown in the diagram below where $A$ is the amplitude of motion of the mass $m$.

With the mass in position $\mathbf 1$ assume that the spring potential energy (spe), the gravitational potential energy of the mass (gpe) and the kinetic energy of the mass (ke) are all zero.
So the total mechanical energy of the spring-mass system is zero.

At position $\mathbf2$ which is the static equilibrium position where the net force on the mass is zero with $mg-KA=0$

$\rm{gpe} = - mgA = -KA^2$, $\rm{spe} = \frac 12 KA^2$, $\rm{ke} = \frac 12KA^2$ with the total mechanical energy still zero.

At position $\mathbf 3$

$\rm{gpe} = - 2mgA = -2KA^2$, $\rm{spe} = 2KA^2$, $\rm{ke} = 0$ with the total mechanical energy still zero.

Since the question states that the total mechanical energy is $J$ all one needs to do is to change the zero of the gpe so that the gpe at position $\mathbf 1$ is $J$.

Thus at position $\mathbf 2$, $\rm{gpe} = -KA^2 +J$ and at position $\mathbf 3$, $\rm{gpe} = -2KA^2 +J$.