The masses are subjected to centrifugal forces when the shaft is rotating. Two conditions must be satisfied if the shaft is not to vibrate as it rotates:
a) There must be no out of balance centrifugal force trying to deflect the shaft.
b) There must be no out of balance moment or couple trying to twist the axis of the shaft.
If these conditions are not fulfilled, the shaft is not dynamically balanced.
F1 = F2
The centrifugal force is mrw2
Therefore:
m1r1w2 = m2r2w2
Since the angular velocity, w, is common to both sides then for dynamic balance
m1r1 = m2r2