Questions Regarding this system -- 2 blocks and a spring on a frictionless surface

It's not a homework/coursework question but I did get the system from my textbook.
http://puu.sh/o03h7/32cdf7cffb.jpg [Broken]

I solved the question by analyzing the system at different stages. Initially both objects are moving with a velocity and having some mass so their kinetic energies are the total energy of the system.
Eventually the spring is compressed fully and the masses are combined moving at some velocity ##v_f##. The system now has a kinetic energy as well as a potential energy due to the spring. By using the conservation of momentum, one can find the velocity ##v_f## of the system when the spring is completely compressed.

My first question is, how would the system be described at different points of compression? I gave it a go with energy conservation and got $$\frac{1}{2}m_1{v_{1_i}}^2 + \frac{1}{2}m_2v_{2_i} = \frac{1}{2}m_1{v_{1_f}}^2 + \frac{1}{2}m_2v_{2_f} + \frac{1}{2}kx^2$$ the velocities for ##v_{1_f}## and ##v_{2_f}## can be solved by relating the acceleration experienced by each mass to the compression by $$a = v\frac{dv}{dx} = \frac{kx}{m}$$ $$\int v dv = \int \frac{kxdx}{m}$$ $$v = x(\frac{k}{m})^{\frac{1}{2}}$$ I'm guessing ##v_{1_f}## and ##v_{2_f}## can't be found by using conservation of momentum, right? Since we're not considering there to be any collision between the spring and the masses.
Are these equations/way of looking at this correct?

My second question is, if the 2nd object's mass included the spring, how would momentum/energy be described at different points of compression? I can't imagine Newtonian mechanics being able to describe this without violating some conservation laws or by utilizing other concepts aside from conservation of energy + momentum. The second mass can't be described as a point-like particle in equations $$\sum \vec P_i = \sum \vec P_f$$ $$m_1v_{1_i} + m_2v_{2_i} = (m_1+m_2)v_f$$ I don't expect an in-depth analysis of this new system but I would like some insight in how it would be analyzed (using what concepts, equations, etc.) I guess another way to look at it would be that the second mass is capable of deforming by some distance ##x## producing a potential energy, where the first mass cannot be deformed.

Last edited by a moderator: