Hello. I've placed the problem here in the Advanced Applied Math forum, but actually I'm only having a small problem which relates to basic geometry, I assume.
I've attached a JPEG. The picture shows a double pendulum, and the purpose of the exercise is to derive the equation of motion, starting from the principle of the conservation of energy. The only energy in the system is the kinetic energy and the potential energy.
The working is shown, but I don't fully understand where the heights have come from in calculating the potential energy. You will see what I mean in the JPEG, I have indicated where the problem lies.