Lagrangian for 2 masses connected by a spring I've been working on this problem for a while now and I'm stuck on getting the Lagrange equations of motion from the Lagrangian. I have the Lagrangian as $L= m(x'^2 + y'^2)/2 - (k/2) (y-x-l)^2$ and I think I have the $δL/δx$ & $δL/δy $ but I can't figure out how to get $dL/dx$ and $dL/dy$ now. Qny help is much appreciated!
 A: I think you want
$$L = \frac12 m (\dot{x}^2+\dot{y}^2) - \frac12 k (x-y)^2 $$
Then 
$$\frac{\partial L}{\partial x} - \frac{d}{dt} \frac{\partial L}{\partial \dot{x}} = 0 \implies m \ddot{x}=-k (x-y) $$ 
$$\frac{\partial L}{\partial y} - \frac{d}{dt} \frac{\partial L}{\partial \dot{y}} = 0 \implies m \ddot{y}=k (x-y) $$ 
Subtracting, and defining $u=x-y$, we get
$$\ddot{u} + \frac{2 k}{m} u = 0$$
Hopefully you can take it from here.
A: With 
$$L = \frac{1}{2}m(\dot{x}^2+\dot{y}^2) - \frac{1}{2}k(y-x-l)^2$$
we have 
$$\frac{\partial L}{\partial\dot{x}} = m\dot{x},~~~~\frac{\partial L}{\partial x} = k(y-x-l)$$
$$\frac{\partial L}{\partial\dot{y}} = m\dot{y},~~~~\frac{\partial L}{\partial y} = -k(y-x-l)$$
Note that we treat $x$ and $\dot{x}$ (and $y$ and $\dot{y}$) as independent variables so $\frac{\partial x}{\partial \dot{x}} = 0 = \frac{\partial \dot{x}}{\partial x}$ and also $\frac{\partial y}{\partial x} = \frac{\partial y}{\partial \dot{x}} = 0$ etc. This gives the two Euler-Lagrange equations
$$\frac{\partial L}{\partial x} - \frac{d}{dt}\frac{\partial L}{\partial\dot{x}} = k(y-x-l) - m\ddot{x} = 0$$
$$\frac{\partial L}{\partial y} - \frac{d}{dt}\frac{\partial L}{\partial\dot{y}} = -k(y-x-l) - m\ddot{y} = 0$$
