To solve the problem it is necessary to apply conservation of the moment and conservation of energy.
By conservation of the moment we know that

Where
M=Heavier mass
V = Velocity of heavier mass
m = lighter mass
v = velocity of lighter mass
That equation in function of the velocity of heavier mass is

Also we have that

On the other hand we have from law of conservation of energy that

Where,
W_f = Work made by friction
KE = Kinetic Force
Applying this equation in heavier object.






Here we can apply the law of conservation of energy for light mass, then

Replacing the value of


Deleting constants,

