# Potential energy of a spring

I have a little problem with the potential energy of a spring... I hope you can help me!

I have two coupled pendula, given by two masses $m$ fixed to two rigid bars (that haven't any mass) and with length $L$ and $2L$. The two bars are at the distance $d$. The masses are connected each other with a spring of elastic costant $k$ and initial length $d$. The bar keeps the horizontal position in every istant of the motion. I consider as coordinates $\theta_1$ (that is the angle formed by the first bar with the $z$ axes) and $\theta_2$ (that is the angle that the second bar forms with $z$ axes).

Why the potential energy of the spring is given by $$U=\frac {1}{2}kL^2 (\sin \theta_1-\cos \theta_1 \tan \theta_2)$$ and not by $$U=\frac{1}{2}kL^2(2 \sin\theta_2-\sin \theta_1)^2$$?

I have used the formula $$U=\frac{1}{2}k (\Delta x^2)$$ where $\Delta x$ is the variation of length of the spring, but I can't understand why in U there is $\tan \theta_2$... where am I wrong?

-
The geometry of the setup is very unclear to me –  zhermes Jan 15 '13 at 21:38
Your description of the problem is a bit hard to follow, maybe you should draw a picture. Perhaps the most puzzling part is this: The bar keeps the horizontal position in every istant of the motion Which bar? The horizontal position of what? Also, which axis is the z axis? The vertical? –  jkej Jan 15 '13 at 21:38
I second (or third) the request for a picture to demonstrate this setup... I can't imagine it. –  tpg2114 Jan 17 '13 at 4:51
@zhermes Ehm.. I'm the first one that thinks this setup is too hard to follow, also because I haven't any picture and I have to understand the problem without any picture... Anyway, I have solved the problem.. Thank you for your helpfulness! :) –  sunrise Jan 17 '13 at 9:21
@jkej I'm sorry, when I was typing I have commetted a mistake, it was the spring that kept horizontal position... And yes, the z-axes is the vertical.. But see above and thank you! –  sunrise Jan 17 '13 at 9:22