when a bullet is fired from a gun, the gun recoils, i.e., moves in a direction opposite to the direction of motion of the bullet. the recoil velocity of the gun can be calculated from the principle of conservation of linear momentum.
suppose, m1 = mass of bullet
m2 = mass of the gun
v1 = velocity of bullet
v2 = velocity of recoil of gun.
before firing, the gun and the bullet both are at rest. therefore, linear momentum before firing equal to zero. the sum of linear momenta on firing equal to m1 v1 + m2 v2.
according to the principle of conservation of linear momentum, total linear momentum after firing should also be equal to zero.
therefore, m1 v1 + m2 v2 = 0
or v2 = − m1 v1/m2