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$.