Morin 4.33

Two beads on their own rails.  Choose to define one of them to be the x-axis.
When we want parameters, here is one choice:

p = {L->1,θ->π/6,ω0->1}

And here is another choice (which leads to commensurate frequencies).

p = {L->1,θ->ArcCos[3/5],ω0->1}

First job: make a drawing function, starting with the rails

endpt1 = (L {1,0} /.p);
rail1= Graphics[{Thick,Blue,Line[{-endpt1,endpt1}]}];
endpt2 = (L {Cos[θ],Sin[θ]}/.p);
rail2= Graphics[{Thick,Blue,Line[{-endpt2,endpt2}]}];

Next add point masses:

state[x_,y_] := Show[rail1,rail2,ListPlot[{x endpt1,y endpt2},PlotStyle->{PointSize[.03],Red}]]

state[.5,-.2]

And for completeness, a spring between them:

state[x_,y_] :=( pt1={x,0};pt2=(y{Cos[θ],Sin[θ]}/.p);
e1 = pt2-pt1; e2 =  {{0,1},{-1,0}}.e1/Norm[e1];
Show[rail1,rail2,
ListPlot[{x endpt1,y endpt2},PlotStyle->{PointSize[.03],Red}],
ParametricPlot[pt1+s*e1+.03*Sin[12 π s]*e2,{s,0,1},PlotStyle->Green,AspectRatio->1]
])

state[.5,.5]

And now we are ready to solve the problem.  The x-force on the particle on the x-axis depends on the
x extent of the spring, which is x-yCos[θ].  And similarly for the y-force on particle y. So...

eqx = x''[t] == - ω0^2 (x[t] - Cos[θ] y[t])
eqy = y''[t] == - ω0^2(y[t] - Cos[θ] x[t])

s = DSolve[{eqx,eqy,x'[0]==0,y'[0]==0,x[0]==L,y[0]==L/2}/.p,{x[t],y[t]},t]

q1[t_] = x[t]/.s[[1]];
q2[t_] = y[t]/.s[[1]];
Animate[state[q1[t],q2[t]],{t,0,100}]

The "nice" modes are of course when we start with x=y or x= -y.
And the relevent matrix is:

(M = ω0^2{{1,-Cos[θ]},{-Cos[θ],1}})//MatrixForm

Eigensystem[M]

So the frequencies of the modes are ω0 (Sqrt[1±Cos(θ)]), and the ratio of big to small is (Sqrt[(1+Cos(θ))/(1-Cos(θ))]).
If we want truly periodic motion, we can arrange to have this ratio be an integer:

sθ=Solve[Sqrt[(1+Cos[θ])/(1-Cos[θ])]==n,θ]

So we finally understand the parameter choice above to be the n=2 case.
Try another value!  Maybe even n=2/3, which will also be periodic.

θ/.sθ[[2]] /. n->2