This problem was taken from David Morin's Introduction to Classical Mechanics
My attempt at solving the problem:
First, I labeled all the relevant forces acting only on one of the particles of mass $m$, which were gravity and the force of the spring acting on said mass.
The forces contributing to the movement of the object along the rails were:
$$ F_{\text g}=mg\cos(\theta) \\ F_{\text{spring}}=-k(l-l_i) $$ $l$ notates the length of the spring at any given moment while $l_i$ is a constant that represents the initial length of the spring in its equilibrium. $x = 0$ at the point where the two rails meet and $x$ notates the distance along the rail to the particle $m$. Now I shall proceed to solve the differential equation for this motion. First, I would like to invoke the law of sines to relate the length of the spring and the distance $x$. Since the triangle bounded by the spring is isosceles, the two identical angles would measure $\frac{\pi}{2}-\theta$
$$ \frac{l}{\sin(2\theta)}=\frac{x}{\sin(\frac{\pi}{2}-\theta)} \\ l=\frac{2x\sin(\theta)\cos(\theta)}{\cos(\theta)} \\ l=2x\sin(\theta) $$ Now, we will move onto the differential equation. We must take the force of the spring in the direction of the rail, so we have to multiply it by cosine. $x$ is the current distance along the rail while $x_i$ is a constant that represents the initial distance of the masses from the bottom: $$ \sum F=m\ddot{x}=-mg\cos\theta - 2k\sin(\theta)(x-x_i)\cos(\frac{\pi}{2}-\theta) \\ m\ddot{x} + 2kx\sin^2(\theta) = 2kx_i\sin^2(\theta) - mg\cos(\theta) $$
Now, I don't know whether I should continue to solve it like an in-homogeneous differential equation because I feel like I'm over-complicating this just to solve for the frequency. Also, the only "variables" here are $\ddot{x}$ and $x$. Everything else are constants, including the trig functions. Any help on how to move forward on this problem or another way of solving this would be high appreciated. Thank you