We start by assuming motion to the right, such that the small disk m_{2} rotates clockwise as shown below. So the k_{2} spring is stretched by amount a\theta which come due to pure rotation, and it also stretch by r\theta due to disk translation to the right at same time, therefore the spring k_{1} will stretch by amount \left ( a+r\right ) \theta and the k_{1} spring will be compressed by amount x.
Based on the above, the following is the free body diagram for m_{2} and m_{1} and the corresponding kinematic diagrams. This assumes small angle \theta and that springs remain straight.
Since cable is inextensible, then the constraint is that x=r\theta . Starting from the FBD for m_{1}\begin{align} \sum F_{x} & =m_{1}\ddot{x}\nonumber \\ -T-k_{1}x & =m_{1}\ddot{x}\nonumber \\ m_{1}\ddot{x}+k_{1}x & =-T\tag{1} \end{align}
We do not need to resolve forces in vertical direction, since no motion is in that direction. To find T, which is the tension in cable, we go back to m_{2} and find T.
We can do this part in two ways, either by taking moments around the instantaneous center of zero velocity which is point D at bottom of the small cylinder shown in the diagram, or we can take moments around the C.M. of the disk and then use another equation to solve for the friction F. We will show both methods, and that they give the same result.
Method one, using instantaneous center of zero velocity
Take moments around point D as shown in figure in order to not have to account for the friction force F and the N_{2} force on m_{2} and using positive as anti-clockwise gives\begin{align*} \sum M_{D} & =-I_{D}\ddot{\theta }\\ k_{2}\left ( a+r\right ) \theta \left ( a+r\right ) -Tr & =-\overset{\text{parallel axes}}{\overbrace{\left ( I_{o}+m_{2}r^{2}\right ) }}\ddot{\theta }\\ T & =\frac{k_{2}\left ( a+r\right ) ^{2}\theta +\left ( I_{o}+m_{2}r^{2}\right ) \ddot{\theta }}{r} \end{align*}
But due to constraint, then \theta =\frac{x}{r},\ddot{\theta }=\frac{\ddot{x}}{r}. Hence the above can be written as\begin{align} T & =\frac{k_{2}\frac{x}{r}\left ( a+r\right ) ^{2}+\left ( I_{o}+m_{2}r^{2}\right ) \frac{\ddot{x}}{r}}{r}\nonumber \\ & =\frac{xk_{2}\left ( a+r\right ) ^{2}}{r^{2}}+\frac{\left ( I_{o}+m_{2}r^{2}\right ) \ddot{x}}{r^{2}}\tag{2} \end{align}
Substituting (2) into (1) gives\begin{align*} m_{1}\ddot{x}+k_{1}x & =-\left ( \frac{xk_{2}\left ( a+r\right ) ^{2}}{r^{2}}+\frac{\left ( I_{o}+m_{2}r^{2}\right ) \ddot{x}}{r^{2}}\right ) \\ m_{1}\ddot{x}+\frac{\left ( I_{o}+m_{2}r^{2}\right ) \ddot{x}}{r^{2}}+k_{1}x+\frac{xk_{2}\left ( a+r\right ) ^{2}}{r^{2}} & =0\\ \ddot{x}\left ( m_{1}+\frac{\left ( I_{o}+m_{2}r^{2}\right ) }{r^{2}}\right ) +x\left ( k_{1}+\frac{k_{2}\left ( a+r\right ) ^{2}}{r^{2}}\right ) & =0\\ \ddot{x}\left ( \frac{m_{1}r^{2}+\left ( I_{o}+m_{2}r^{2}\right ) }{r^{2}}\right ) +x\left ( \frac{k_{1}r^{2}+k_{2}\left ( a+r\right ) ^{2}}{r^{2}}\right ) & =0 \end{align*}
Hence \ddot{x}\left ( m_{1}r^{2}+\left ( I_{o}+m_{2}r^{2}\right ) \right ) +x\left ( k_{1}r^{2}+k_{2}\left ( a+r\right ) ^{2}\right ) =0 In standard form\begin{equation} \ddot{x}+x\frac{k_{1}r^{2}+k_{2}\left ( a+r\right ) ^{2}}{r^{2}\left ( m_{1}+m_{2}\right ) +I_{o}}=0\tag{3} \end{equation} Or \ddot{x}+\omega _{n}^{2}x=0 Where \omega _{n}^{2}=\frac{r^{2}k_{1}+k_{2}\left ( a+r\right ) ^{2}}{r^{2}\left ( m_{1}+m_{2}\right ) +I_{o}} Method two, moments around center of mass
Using this method. We start by taking moments around the center of mass of the disk m_{2} and using positive as anti-clockwise gives\begin{align} \sum M_{o} & =-I_{o}\ddot{\theta }\nonumber \\ \left ( k_{2}\left ( a+r\right ) \theta \right ) a-Fr & =-I_{o}\ddot{\theta }\nonumber \\ F & =\frac{1}{r}\left ( I_{o}\ddot{\theta }+\left ( k_{2}\left ( a+r\right ) \theta \right ) a\right ) \tag{4} \end{align}
Now resolving forces in the x direction for m_{2}, gives (with positive to the right)\begin{align} \sum F_{x} & =m_{2}r\ddot{\theta }\nonumber \\ T-k_{2}\left ( a+r\right ) \theta -F & =m_{2}r\ddot{\theta }\tag{5} \end{align}
Plugging (4) into (5) gives T T-k_{2}\left ( a+r\right ) \theta -\frac{1}{r}\left ( I_{o}\ddot{\theta }+\left ( k_{2}\left ( a+r\right ) \theta \right ) a\right ) =m_{2}r\ddot{\theta } Solving for T gives T=m_{2}r\ddot{\theta }+\frac{1}{r}\left ( I_{o}\ddot{\theta }+\left ( k_{2}\left ( a+r\right ) \theta \right ) a\right ) +k_{2}\left ( a+r\right ) \theta We now use the constraint that x=r\theta to write everything in x. Hence \theta =\frac{x}{r},\ddot{\theta }=\frac{\ddot{x}}{r} and the above now becomes\begin{align*} T & =m_{2}r\frac{\ddot{x}}{r}+\frac{1}{r}\left ( I_{o}\frac{\ddot{x}}{r}+\left ( k_{2}\left ( a+r\right ) \frac{x}{r}\right ) a\right ) +k_{2}\left ( a+r\right ) \frac{x}{r}\\ & =m_{2}\ddot{x}+\frac{1}{r^{2}}\left ( I_{o}\ddot{x}+\left ( k_{2}\left ( a+r\right ) x\right ) a\right ) +k_{2}\left ( a+r\right ) \frac{x}{r} \end{align*}
Now that we found T, we go back to the equation of motion for m_{1} in (1) and substitute the above into it, the result becomes\begin{align*} m_{1}\ddot{x}+k_{1}x & =-T\\ & =-\left ( m_{2}\ddot{x}+\frac{1}{r^{2}}\left ( I_{o}\ddot{x}+\left ( k_{2}\left ( a+r\right ) x\right ) a\right ) +k_{2}\left ( a+r\right ) \frac{x}{r}\right ) \end{align*}
Collecting terms\begin{align*} \ddot{x}\left ( m_{1}+m_{2}+\frac{I_{o}}{r^{2}}\right ) +k_{1}x+\frac{1}{r^{2}}\left ( \left ( k_{2}\left ( a+r\right ) x\right ) a\right ) +k_{2}\left ( a+r\right ) \frac{x}{r} & =0\\ \ddot{x}\left ( m_{1}+m_{2}+\frac{I_{o}}{r^{2}}\right ) +x\left ( k_{1}+\frac{1}{r^{2}}\left ( k_{2}\left ( a+r\right ) a\right ) +k_{2}\left ( a+r\right ) \frac{1}{r}\right ) & =0\\ \ddot{x}\left ( m_{1}+m_{2}+\frac{I_{o}}{r^{2}}\right ) +x\left ( k_{1}+\frac{k_{2}}{r^{2}}\left [ \left ( a+r\right ) a+r\left ( a+r\right ) \right ] \right ) & =0\\ \ddot{x}\left ( m_{1}+m_{2}+\frac{I_{o}}{r^{2}}\right ) +x\left ( k_{1}+\frac{k_{2}}{r^{2}}\left [ a^{2}+ra+ar+r^{2}\right ] \right ) & =0\\ \ddot{x}\left ( m_{1}+m_{2}+\frac{I_{o}}{r^{2}}\right ) +x\left ( k_{1}+\frac{k_{2}}{r^{2}}\left [ a^{2}+2ar+r^{2}\right ] \right ) & =0\\ \ddot{x}\left ( m_{1}+m_{2}+\frac{I_{o}}{r^{2}}\right ) +x\left ( k_{1}+\frac{k_{2}}{r^{2}}\left ( a+r\right ) ^{2}\right ) & =0 \end{align*}
Or\begin{align*} \ddot{x}\left ( r^{2}\left ( m_{1}+m_{2}\right ) +I_{o}\right ) +x\left ( r^{2}k_{1}+k_{2}\left ( a+r\right ) ^{2}\right ) & =0\\ \ddot{x}+x\frac{r^{2}k_{1}+k_{2}\left ( a+r\right ) ^{2}}{r^{2}\left ( m_{1}+m_{2}\right ) +I_{o}} & =0 \end{align*}
Which is the same equation of motion found in the first method.
In Rayleigh energy method, we ignore any friction, and assume motion is simple harmonic motion (which is valid, since there is no damping).
The Kinetic energy T of the system is (since disk rolls with no slip) T=\overset{\text{disk}}{\overbrace{\frac{1}{2}I_{o}\dot{\theta }^{2}+\frac{1}{2}m_{2}v_{cg}^{2}}}+\overset{\text{cart}}{\overbrace{\frac{1}{2}m_{1}\dot{x}^{2}}} But v_{cg}=r\dot{\theta }, hence the above becomes T=\frac{1}{2}I_{o}\dot{\theta }^{2}+\frac{1}{2}m_{2}\left ( r\dot{\theta }\right ) ^{2}+\frac{1}{2}m_{1}\dot{x}^{2} But due to constraint, then \theta =\frac{x}{r}, then \dot{\theta }=\frac{\dot{x}}{r} and the above becomes\begin{align} T & =\frac{1}{2}I_{o}\left ( \frac{\dot{x}}{r}\right ) ^{2}+\frac{1}{2}m_{2}\left ( r\frac{\dot{x}}{r}\right ) ^{2}+\frac{1}{2}m_{1}\dot{x}^{2}\nonumber \\ & =\frac{1}{2}I_{o}\frac{\dot{x}^{2}}{r^{2}}+\frac{1}{2}m_{2}\dot{x}^{2}+\frac{1}{2}m_{1}\dot{x}^{2}\nonumber \\ & =\frac{1}{2}\dot{x}^{2}\left ( \frac{I_{o}}{r^{2}}+m_{2}+m_{1}\right ) \tag{1} \end{align}
The potential energy is\begin{align} U & =\frac{1}{2}k_{2}\left ( \left ( a+r\right ) \theta \right ) ^{2}+\frac{1}{2}k_{1}x^{2}\nonumber \\ & =\frac{1}{2}k_{2}\left ( \left ( a+r\right ) \frac{x}{r}\right ) ^{2}+\frac{1}{2}k_{1}x^{2}\nonumber \\ & =\frac{1}{2}k_{2}\left ( a+r\right ) ^{2}\frac{x^{2}}{r^{2}}+\frac{1}{2}k_{1}x^{2}\tag{2} \end{align}
To find T_{\max } and U_{\max }, we now assume m_{1} undergoes simple harmonic motion given by x\left ( t\right ) =X_{\max }\sin \left ( \omega _{n}t\right ) . Hence \dot{x}=X_{\max }\omega _{n}\cos \omega _{n}t. Therefore\begin{align*} \dot{x}_{\max } & =X_{\max }\omega _{n}\\ x_{\max } & =X_{\max } \end{align*}
Therefore using these into (1) and (2) gives\begin{align*} T_{\max } & =\frac{1}{2}\left ( \dot{x}_{\max }\right ) ^{2}\left ( \frac{I_{o}}{r^{2}}+m_{2}+m_{1}\right ) \\ U_{\max } & =\frac{1}{2}k_{2}\left ( a+r\right ) ^{2}\frac{x_{\max }^{2}}{r^{2}}+\frac{1}{2}k_{1}x_{\max }^{2} \end{align*}
Or\begin{align*} T_{\max } & =\frac{1}{2}\left ( X_{\max }\omega _{n}\right ) ^{2}\left ( \frac{I_{o}}{r^{2}}+m_{2}+m_{1}\right ) \\ U_{\max } & =\frac{1}{2}X_{\max }^{2}\left ( \frac{k_{2}\left ( a+r\right ) ^{2}}{r^{2}}+k_{1}\right ) \end{align*}
Hence\begin{align*} T_{\max } & =U_{\max }\\ \frac{1}{2}\left ( X_{\max }\omega _{n}\right ) ^{2}\left ( \frac{I_{o}}{r^{2}}+m_{2}+m_{1}\right ) & =\frac{1}{2}X_{\max }^{2}\left ( \frac{k_{2}\left ( a+r\right ) ^{2}}{r^{2}}+k_{1}\right ) \\ \omega _{n}^{2}\left ( \frac{I_{o}}{r^{2}}+m_{2}+m_{1}\right ) & =\frac{k_{2}\left ( a+r\right ) ^{2}+r^{2}k_{1}}{r^{2}} \end{align*}
Solving for \omega _{n}^{2} \omega _{n}^{2}=\frac{k_{2}\left ( a+r\right ) ^{2}+r^{2}k_{1}}{I_{o}+r^{2}\left ( m_{2}+m_{1}\right ) } Therefore the equation of motion for m_{2} is\begin{align*} \ddot{x}+\omega _{n}^{2}x & =0\\ \ddot{x}+\frac{k_{2}\left ( a+r\right ) ^{2}+r^{2}k_{1}}{I_{o}+r^{2}\left ( m_{2}+m_{1}\right ) }x & =0 \end{align*}
Comparing this to the solution found in first problem, we see they are the same. The Rayleigh energy method was much simpler in this case. But we have to ignore any friction, and assume motion is harmonic, which is reasonable, since this is single degree of freedom system.