Extra energy in dual mass-spring systems Below is a Dual mass spring system placed on a smooth surface(no friction), let us assume the spring constant as $k$ in this case.

Now if we create a small extension in the spring of value $x_o$, the two masses will perform simple harmonic motion(SHM) individually with amplitudes $A_1$ and $A_2$ respectively such that $A_1$ + $A_2$ = $x_o$. Now the total energy of said system is given by $\frac{1}{2}kx_o^2$ and the energies of their individual oscillations would be $\frac{1}{2}kA_1^2$ and $\frac{1}{2}kA_2^2$. But $\frac{1}{2}kA_1^2$ + $\frac{1}{2}kA_2^2$ $\neq$ $\frac{1}{2}kx_o^2$. So what is this extra energy being used for? Clearly it isn't being used for SHM as it doesn't come under the energy of the the masses' individual oscillations. So I am unable to tell what it is being used for!
I have another question as well. Their individual maximum kinetic energies are related as follows: $\frac{1}{2}mv_1^2$ + $\frac{1}{2}Mv_2^2$ $=$ $\frac{1}{2}kx_o^2$, where $v_1$ and $v_2$ are the individual masses' maximum velocities. But maximum kinetic energy of a body performing SHM should be equal to its maximum potential energy! So $\frac{1}{2}kA_1^2$ should be equal to $\frac{1}{2}mv_1^2$ and similarly $\frac{1}{2}kA_2^2$ should be equal to $\frac{1}{2}Mv_2^2$. But this would go against our equation that $\frac{1}{2}kA_1^2$ + $\frac{1}{2}kA_2^2$ $\neq$ $\frac{1}{2}kx_o^2$! So I am quite confused about what is happening here!
So can anybody explain these to me?
 A: You have to analyse both masses together as a single SHM system - you cannot split then into two independent SHM components.
Suppose we start with the spring at its natural length and move mass $m$ to the left by a distance $x_1$ and mass $M$ to the right by a distance $x_2$. The force that the spring exerts on both masses is now $k(x_1+x_2)$. So if we move mass $m$ from $x_1=0$ to $x_1=A_1$ and we move mass $M$ from $x_2=0$ to $x_2=A_2$ then the total energy stored in the spring is
$\int_0^{A_1+A_2} ky \space dy$
where $y=x_1+x_2$, and
$ \int_0^{A_1+A_2} ky \space dy = \frac 1 2 k (A_1+A_2)^2 = \frac 1 2 k x_0^2$
so there is no "extra energy".
When we release the masses the equation of motion of mass $m$ is
$m \frac {d^2x_1}{dt^2} = -k(x_1+x_2)$
and for mass $M$ it is
$M \frac {d^2x_2}{dt^2} = -k(x_1+x_2)$
Adding these together we get
$\frac {d^2y}{dt^2} = -k'y$
where $k' = k(\frac 1 m + \frac 1 M)$, and $y(0) = x_0$, $\frac{dy}{dt}(0) = 0$. So
$y = x_0 \cos (\sqrt{k'}t) \\ \Rightarrow \frac {d^2x_1}{dt^2} = -\frac k m y = -\frac {kx_0}{m} \cos (\sqrt{k'}t) \\ \Rightarrow  v_1 = \frac  {dx_1}{dt} =  -\frac {kx_0}{m\sqrt{k'}} \sin (\sqrt{k'}t)$
Similarly
$v_2 = \frac {dx_2}{dt} =  -\frac {kx_0}{M\sqrt{k'}} \sin (\sqrt{k'}t)$
When the spring returns to its natural length, $y=0$ and $\cos \sqrt{k'}t = 0$ so $\sin \sqrt{k'}t = 1$. So the kinetic energy of the system is
$\frac 1 2 m v_1^2 + \frac 1 2 M v_2^2 = \frac {k^2 x_0^2}{2k'} \left( \frac 1 m + \frac 1 M \right) = \frac {kk'x_0^2}{2k'} = \frac 1 2 k x_0^2$
In other words, all of the potential energy stored in the spring has been converted into kinetic energy, as expected.
A: Let $x$ be the magnitude of the maximum displacement from its equilibrium position of mass $m$ and $X$ be the magnitude of the maximum displacement from its equilibrium position of mass $M$.
Conservation of momentum for the system requires $m\dot x = M\dot X \Rightarrow mx=MX$.
For this system the natural frequency of oscillation is given by $\omega^2 = \dfrac{k(m+M)}{mM}$.
The maximum kinetic energy of the system is $\dfrac 12 m \omega^2 x^2 +\dfrac 12 m \omega^2 X^2$.
Putting in the value of $\omega^2$ and multiplying out gives the kinetic energy as
$\dfrac 12 kx^2+\dfrac 12 k \left(\dfrac mM \right)x\, x +\dfrac 12 k \left(\dfrac Mm \right)X\, X+\dfrac 12 kX^2 = \dfrac 12 kx^2+\dfrac 12 k\, X\, x +\dfrac 12 k\, x\, X+\dfrac 12 kX^2=\dfrac 12 k(x+X)^2 = \text{elastic potential energy at the start}$.
It is possible to do a more general analysis to show that the total energy of the system is constant.
