Well thanks too but I didn't too much
@Charles Link did all the job here.
The differential equations of motion for this problem would be like
for body of mass m:
$$mg-2T(t)\sin\theta_1(t)=L\frac{d^2\tan\theta_1(t)}{dt^2}$$
for body of mass M
$$2T(t)\sin\theta_2(t)-Mg=L\frac{d^2\tan\theta_2(t)}{dt^2}$$
##\theta_1(t)## is the angle made by the horizontal and the strings that are connected to body of mass m. ##\theta_2(t)## is the angle by the horizontal and the strings that are connected to body of mass M.
Need one more equation that relates ##\theta_1## and ##\theta_2## but I don't seem to find an obvious one. Also not sure if the tension T(t) is constant or time varying...