\(\def \u#1{\,\mathrm{#1}}\) \(\def \abs#1{\left|#1\right|}\) \(\def \ast{*}\) \(\def \deg{^{\circ}}\) \(\def \redcancel#1{{\color{red}\cancel{#1}}}\) \(\def \BLUE#1{{\color{blue} #1}}\) \(\def \RED#1{{\color{red} #1}}\) \(\def \PURPLE#1{{\color{purple} #1}}\) \(\def \th#1,#2{#1,\!#2}\) \(\def \lshift#1#2{\underset{\Leftarrow\atop{#2}}#1}}\) \(\def \rshift#1#2{\underset{\Rightarrow\atop{#2}}#1}}\) \(\def \dotspot{{\color{lightgray}{\circ}}}\)
Chapter 9: Oscillations
8.

Energy of a Block on a Spring

For an undamped block-spring oscillator, the total energy remains constant throughout and is equal to $$E_{tot}=\frac12kA^2+\frac12mv_{\max}^2$$ This energy moves back and forth between the kinetic and spring potential energies: $$\begin{align} E_{tot} &= E_k + E_s\\ &= \frac12 m(v(t))^2 + \frac12k(y(t))^2\\ \end{align}$$ where $y(t)$ is the displacement of the block, and $v(t)$ the velocity, at a given time $t$.