At any position, let the velocities be \\\\(v_{1}\\\\) and \\\\(v_{2}\\\\) respectively.Here, \\\\(v_{1}=\\\\) velocity of \\\\(m\\\\) with respect to \\\\(M\\\\).By energy methodTotal Energy = Constant\\\\((1/2)Mv^{2}+(1/2)m(v_{1}-v_{2})^{2}+(1/2)k(x_{1}+x_{2})^{2}=\\\\) Constant ..(i)[\\\\(v_{1}-v_{2}=\\\\) Absolute velocity of mass \\\\(m\\\\) as seen from the road.]Again, from law of conservation of momentum\\\\(mx_{2}=mx_{1}\\Rightarrow x_{1}=\\dfrac{M}{m}x_{2}\\\\) \\\\(....(1)\\\\)\\\\(mv_{2}=m(v_{1}-v_{2})\\Rightarrow (v_{1}-v_{2})=\\dfrac{M}{m}v_{2}\\\\) \\\\(.....(2)\\\\)Putting the above values in equation \\\\((1)\\\\), we get\\\\(\\dfrac{1}{2}Mv_{2}^{2}+\\dfrac{1}{2}m\\dfrac{M^{2}}{m^{2}}v_{2}^{2}+\\dfrac{1}{2}kx_{2}^{2}\\left(1+\\dfrac{M}{m}\\right)^{2}=\\\\) constant\\\\(\ herefore M\\left(1+\\dfrac{M}{m}\\right)v_{2}+k\\left(1+\\dfrac{M}{m}\\right)^{2}x_{2}^{2}=\\\\) Constant.\\\\(mv_{2}^{2}+l\\left(1+\\dfrac{M}{m}\\right)x_{2}^{2}=\\\\) constantTaking derivative of both sides,\\\\(M\ imes 2v_{2}\\dfrac{dv_{2}}{dt}+k\\dfrac{(M+m)}{m}--ex_{2}^{2}\\dfrac{dx_{2}}{dt}=0\\\\)\\\\(\\Rightarrow ma_{2}+k\\left(\\dfrac{M+m}{m}\\right)x_{2}=0\\\\) [because, \\\\(c_{2}=\\dfrac{dx_{2}}{dt}\\\\)]Taking derivative of both sides,\\\\(M\ imes 2v_{2}\\dfrac{dv_{2}}{}+k\\dfrac{(M+m)}{m}-ex_{2}^{2}\\dfrac{dx_{2}}{dt}=0\\\\)\\\\(\\Rightarrow ma_{2}+k\\left(\\dfrac{M+m}{m}\\right)x_{2}=0\\\\) [because, \\\\(v_{2}=\\dfrac{dx_{2}}{dt}\\\\)]\\\\(\\Rightarrow \\dfrac{a_{2}}{x_{2}}=-\\dfrac{k(M+m)}{Mm}=\\omega^{2}\\\\)\\\\(\ herefore \\omega=\\sqrt{\\dfrac{k(M+m)}{Mm}}\\\\)So, Time period, \\\\(T=2\\pi \\sqrt{\\dfrac{Mm}{k(M+m)}}\\\\)