Imagine a linear (1dimensional) inelastic collision on a frictionless horizontal table, where and are the masses of the two colliding objects.
Script by Dr. Mohamed S. Kariapper using Physlets from 
Note that the total momentum (p1+p2) remains the same before and after the collision, whereas the total kinetic energy (K1+K2) changes (is lost) upon collision. Because the total linear momentum is conserved we have
Change the values of masses and initial velocities in the simulation and see what happens.
Now set the collision as Completely Inelastic (the two colliding bodies stick together after the collision) and play the simulation. The total momentum is still conserved although more kinetic energy is lost than in the case of just inelastic collision.
In this case, conservation of total linear momentum gives
The velocity after the collision is
In case where the second object of mass is at rest before collision ( ) then the above equation reduces to
This is just the velocity of the center of mass of the system.
