AB is a light rigid rod, which is rotating about a vertical axis passing through A. A spring of force constant K and natural length l is attached at A and its other end is attached to a small bead of mass m. The bead can slide without friction on the rod. At the initial moment the bead is at rest (w.r.t. the rod) and the spring is unstretched.
V2max=(mω2l+mω2(l+x)−Kx)xm
V2max=ω2lx=mω4l2mω2−K
Vmax=√mω4l2K−mω2
For maximum extension
∫xmax0mω2(l+x)dx−12Kx2max=0
Xmax=2mω2lK−mω2