At equilibrium,
Force = Spring constant x extension = kx
Weight = (m1+m2)g
At equilibrium Spring force is equal to weight of masses
kx1=(m1+m2)g
x1=(m1+m2)gk
If mass m2 is removed, then at equilibrium extension of spring become.
x2=m1gk
but, if m2 cut out suddenly then, Amplitude of oscillation is the difference in extension
x1−x2=(m1+m2)gk−m1gk=m2gk
Amplitude of oscillation m2gk