As net external force acting on the system is zero `("net" F_(ext)=0)`
`therefore`Applying conservation of momentum in horizontal direction
`P_(f)=P_(i)`
`MV_(2)-mv_(1)=0`…(i)
applying conservation of mechanical energy (as no work is done)
`(1)/(2)kx^(2)=(1)/(2)mv_(1)^(2)+(1)/(2)MV_(2)^(2)`.....(ii)
`v_(1)=sqrt((MK)/(m(m+M))),v_(2)=sqrt((mK)/(M(m+M)))`