This is from Hobson, Riley, Bence Mathematical Methods problem 9.1
If someone could just help me understand the physics part, I can try to do the calculations alone. What exactly is shown in this image? Are these hanging masses attached by springs if so why is the motion perpendicular to each other and not towards each other? What are these formulas above representing? I see a Force on the left but I don't recognize the right side. Why is no equation of energy represented like $\frac{mgx_1^2}{2l}+\frac{mgx_2^2}{2l}+\frac{1}{2}k(x_2-x_1)^2$
I found the answer to my problem and it turns out this is a harder problem to understand than to solve. The equation comes from the Lagrangian of the formula for kinetic and potential energy treating the variables and derivatives as independent of time. The derivation of the formula can be found here.
.

