I am currently practicing for my PHYS 101 major test and encountered this question:
In Figure 11, block 1 (mass 2.50 kg) is moving rightward at 10.0 m/s and block 2 (mass 6.20 kg) is moving rightward at 3.00 m/s. The horizontal surface is frictionless, and a spring with a spring constant of 960 N/m is fixed to block 2. When the blocks collide, the compression of the spring is maximum at the instant the blocks have the same velocity. Find the velocity of blocks when the spring compression is maximum. (Neglect the mass of spring)
A) 5.01 m/s
B) 3.50 m/s
C) 5.85 m/s
D) 4.50 m/s
E) 2.08 m/s
The solution provided uses conservation of momentum to find $v_f$ $$m_1v_1+m_2v_2=(m_1+m_2)v_f$$ where solving for $v_f$ and plugging in the numbers yields $v_f=5.01\text{m/s}$
However my attempted solution goes as follows:
First write down equation of energy conservation for the instant where the two blocks have the same velocity. $$ \frac{1}{2}m_1v_1^2 + \frac{1}{2}m_2v_2^2 = \frac{1}{2}kx^2 + \frac{1}{2}(m_1+m_2)v_f^2$$ We're missing one piece of information to solve for $v_f$ and that's $x$. However if we use block 2 as our reference frame, then we could use conservation of energy again to find $x$ and then plug in in our original equation to solve for $v_f$.
Using energy conservation for block 2 as our frame of reference, we get: $$\frac{1}{2}m_1v_{1,2}^2=\frac{1}{2}kx^2$$ where $v_{1,2}^2=v_1-v_2=7 \text{m/s}$
Now substituting $\frac{1}{2}m_1v_{1,2}^2$ for $\frac{1}{2}kx^2$ in our original equation yields $$ \frac{1}{2}m_1v_1^2 + \frac{1}{2}m_2v_2^2 = \frac{1}{2}m_1v_{1,2}^2 + \frac{1}{2}(m_1+m_2)v_f^2$$
Where solving for $v_f$ and plugging in yields $v_f=4.59\text{m/s}$ which, obviously, is not the right answer. However, I fail to see where my approach fails. I suspect that it has to do with the velocity of block 2 changing while the spring is being contracted, but I fail to fully grasp why that would be the case.