Correct Answer - B
The centre of mass of the system (two blocks+spring) moves with an acceleration `a=(F)/(m+M)`. Let us solve the problem in a frame of reference fixed to the centre of mass of the system. As this frame is accelerated with respect to the ground, we have to apply a pseudo force `ma` towards left on the block of mass m and `Ma` towards left on the block of mass M. The net external force on m is
`F_1=ma=(mF)/(m+M)` (towards left)
and the net external force on M is
`F_2=F-Ma=F-(MF)/(m+M)=(mF)/(m+M)` (towards right)
As the centre of mass is at rest in this frame, the blocks move in opposite directions and come to instantaneous rest at some instant. The extension of the spring will be maximum at this instant. Suppose, the left block is displaced through a distance `x_1` and the right block through a distance `x_2` from the initial positions. The total work done by the external force `F_1` and `F_2` in this period are
`W=F_1x_1+F_2x_2=(mF)/(m+M)(x_1+x_2)`
This should be equal to the increase in the potential energy of the spring, as there is no change in the kinetic energy. Thus,
`(mF)/(m+M)(x_1+x_2)=1/2k(x_1+x_2)^2` or `x_1+x_2=(2mF)/(k(m+M))`
This is the maximum extension of the spring.