Two masses m1 and m2 are connected
by a spring of spring constant k and are placed on a frictionless horizontal surface. Initially the spring is stretched through a distance x0 when the system is released from rest. Find the distance moved by the two masses before they again come to rest.

Mass of the two blocks is m1 and m2 respectively,


Initially the spring is stretched by x= x0,


Let k is the spring constant.


For the blocks to come to rest again, let the distance travelled by two blocks of mass m1 and m2 is x1 and x2 respectively.


As zero external force acts in horizontal direction,


_____ (1)


By the law of conservation of energy



Thus,




Then,


Putting valve in equation (1) we get






Similarly,


1