Bodies $A$ and $B$ are moving in the same direction in a straight line with a constant velocities on a frictionless surface. The mass and the velocity of $A$ are $2 \text{kg}$ and $10 \text{m/s}$. The mass and the velocity of $B$ are $6 \text{kg}$ and $4 \text{m/s}$. A spring is connected to the back of the body $B$ and its rate is $800 \text{N/m}$.
What is the velocity of $A$ relatively to $B$ before the collision and after the collision?
(Answer: $6 \text{m/s}$ and $-6 \text{m/s}$)
What is the relative velocity between the objects when the spring achieves its maximum contraction?
(Answer: $0$)
I had no problem with the first question. We know that in elastic collision the coefficient of restitution is $1$, therefore the relative velocities before and after the collision are equal but are opposite in sign. The relatve velocity before the collision is $10-4=6\text{m/s}$ .
My trouble is with the second question. I though a lot about it and came to a contradiction in my thoughts (of course it is because I'm missing something):
On the one hand, it seems to me that when the contraction of the spring is maximal, all the kinetic energy of $A$ was transformed to a potential elastic energy and to some portion of kinetic energy of $B$ (it will move faster). So it means that $A$ has no velocity at that moment, but $B$ has, so it's impossible that their relative velocity is zero. Intuitively, it means that $A$ has some kinetic energy. So it means that $A$ will be slowed down by the spring, until its velocity is zero, and the spring can finally return to its normal state. So it seems that the spring will be contracted maximally for some relatively short period of time until the kinetic energy of $A$ becomes zero. But something tells me that I'm wrong. Anyway, I've tried to play with the law of conservation of energy and to wrap it around my thoughts, but it didn't quite work well. So what am I missing? I will appreciate any help.
Proposed solution:
Relative speed during the maximal contraction
The moment $A$ reaches the spring, the spring will push both of the bodies as a reaction to the $A$'s push. Therefore, the $A$ will start to decelerate while $B$ will start to gain more speed. Although $A$ is losing its kinetic energy, its velocity won't be zero at the moment of the maximal contraction. This is because $A$ will continue to contract the spring as long as its speed is higher than the speed of $B$ (and therefore the speed of the spring itself). The moment their velocities are the same, $A$ will no longer be "overtaking" the spring, therefore its contraction will be maximal at that point. Therefore, the relative speed is zero.
Finding the maximal contraction:
The net momentum is conserved at any point in the time, so:
$m_A v_A + m_B v_B = (m_A + m_B) V$
In this particular question, $V$ would be: $5.5 \text{m/s}$
We also know that the total mechanical energy is conserved (the collision is perfectly elastic), therefore, the mechanical energy before the collision (which only consists of kinetic energies) will be equal to the total mechanical energy during the max contract. Therefore:
$\frac{1}{2} m_A v_A^2 + \frac{1}{2} m_B v_B^2 = \frac{1}{2} (m_A + m_B) V^2 + \frac{1}{2} k (\Delta x_{max})^2$
The energy when the contraction is maximal consists of kinetic energies of $A$ and $B$ (which are moving with the same velocity) and of elastic potential energy due to the fact that the spring is contracted.
In this particular question $\Delta x_{max}$ would be:
$\Delta x_{max} = \sqrt{\frac{27}{400}} \approx 26 \text{cm}$