In an ideal (undamped) mass–spring oscillator, mechanical energy is conserved and continually swaps between
spring potential energy and kinetic energy. The motion is simple harmonic when the restoring force is linear:
\(F=-kx\). With Newton’s second law \(mx''=F\), the equation of motion becomes
\[
x''+\frac{k}{m}x=0,
\]
whose solutions are sinusoidal. A common form is
\[
x(t)=A\cos(\omega t+\phi),
\]
where \(A\) is the amplitude and \(\phi\) is the phase constant. The angular frequency is fixed by the system parameters,
\[
\omega=\sqrt{\frac{k}{m}},
\]
so the period and frequency are
\[
T=\frac{2\pi}{\omega}=2\pi\sqrt{\frac{m}{k}}, \qquad f=\frac{1}{T}.
\]
Energy definitions. The spring stores potential energy
\[
U=\tfrac12kx^2,
\]
while the moving mass has kinetic energy
\[
K=\tfrac12mv^2,
\]
where \(v=\frac{dx}{dt}\) is the velocity. For SHM, differentiating \(x(t)\) gives
\[
v(t)=-A\omega\sin(\omega t+\phi).
\]
In the ideal model, the total mechanical energy is conserved:
\[
E=K+U=\text{constant}.
\]
Evaluating at a turning point (where \(|x|=A\) and \(v=0\)) shows the constant value:
\[
E=\tfrac12kA^2.
\]
This is why amplitude is directly tied to the energy stored in the oscillator: larger \(A\) means more energy.
Energy exchange and conservation check. As the mass moves, \(x\) and \(v\) change, so \(U\) and \(K\) change too.
Near the equilibrium position \(x\approx 0\), potential energy \(U\) is small, speed is largest, and kinetic energy \(K\) is near its maximum.
Near the turning points \(x=\pm A\), the speed goes to zero and the energy is entirely potential. In an ideal oscillator,
any state should satisfy \(K+U=E=\tfrac12kA^2\). In practice, you can use the difference
\[
(K+U)-E
\]
as a consistency/conservation check. If you supply \(x\) and \(v\) that don’t belong to the same ideal oscillator (or if damping is present),
the check will not be zero.
Finding speed from displacement. A common use of conservation is to compute speed at a given displacement without solving time explicitly.
Starting from \(K=E-U\),
\[
\tfrac12mv^2 = E - \tfrac12kx^2,
\]
so the speed magnitude is
\[
v=\sqrt{\frac{2(E-U)}{m}}=\sqrt{\frac{k}{m}(A^2-x^2)}.
\]
This requires \(|x|\le A\); otherwise the expression inside the square root is negative, indicating that the position is unreachable
for the given amplitude in undamped SHM.
Beyond the ideal model. In damped oscillations, energy gradually decreases because nonconservative forces (like friction or drag)
remove mechanical energy, usually converting it into thermal energy. The energy swap between \(K\) and \(U\) still occurs,
but the total \(E\) is no longer constant. University-level extensions include modeling energy loss per cycle, quality factor \(Q\),
and driven oscillations where external forcing injects energy back into the system.