Initially the spring is undeformed. Now the force ′F′ is applied to ′B′ as shown in the figure. When the displacement of ′B′ w.r.t. ′A′ is ′x′ towards right in some time, then the relative acceleration of ′B′ w.r.t ′A′ at that moment is: