Show Lagrangian of a three-spring problem

1.9k Views Asked by At

Consider two equal masses of mass $m$. There are three springs attached horizontally to the two masses: the first mass has equilibrium at $x_1$ and is attached to the left wall (where $x=0$) by a spring with spring constant $k$. the second mass has equilibrium at $x_2$ and is attached to the first mass by a spring with spring constant $k_0$ and to the right wall by a spring with spring constant $k$. Derive the Lagrangian of this mass-spring system, which should be

$$ L = \frac{m}{2}\left(\dot{x_1}^2+\dot{x_2}^2\right)-\frac{k}{2}\left( x_1^2+x_2^2 \right) -\frac{k_0}{2} \left( x_2 -x_1 \right)^2.$$

Let $x_1$ and $x_2$ be to generalized coordinates. Then $\vec{x} = x_1\hat{x_1}+x_1\hat{x_2}$. Thus $\vec{v}=\dot{\vec{x}}=\dot{x_1}\hat{x_1}+\dot{x_2}\hat{x_2}$. So $(KE)=\frac{m}{2}\left(\dot{x_1}^2+\dot{x_2}^2\right)$. So this part is OK.

It becomes very confusing with the potential energy. $\vec{F}=\vec{\nabla}U=-kx_1\hat{x_1}+kx_2\hat{x_2}-k_0 x_2\hat{x_2}+k_0x_1\hat{x_1}$ (please correct me if I'm wrong). Now, $(PE)$ comes out to be $$ (PE) = \frac{k}{2}\left(x_2^2 - x_1^2 \right) + \frac{k_0}{2}\left( x_1^2 + x_2^2 \right), $$ which is not what I need. So something is apparently wrong.

I'd appreciate some input.