L=\frac{1}{2}(m_1+m_2)\dot{x}_1^2+(m_1-m_2)gx_1+m_2gl