The final equations retain mass and length factors explicitly with clear kinetic, potential energies, and the Euler-Lagrange form; solving for accelerations can produce the common closed-form but presenting this form directly covers the full derivation rigorously.
Take two point–masses (m_{1},m_{2}) at the ends of massless rods of lengths (l_{1},l_{2}). A convenient choice of generalized coordinates are the deflections of the rods from the downward vertical, (\theta_{1}(t)) for the first rod and (\theta_{2}(t)) for the second. With the origin at the fixed pivot and (y) measured upward, the Cartesian coordinates of the masses are
[
x_1=l_1\sin\theta_1,\qquad y_1=-l_1\cos\theta_1,
]
[
x_2=l_1\sin\theta_1+l_2\sin\theta_2,\qquad y_2=-l_1\cos\theta_1-l_2\cos\theta_2.
]
Differentiating gives the speeds
[
v_1^2=l_1^2\dot\theta_1^2,\qquad v_2^2=l_1^2\dot\theta_1^2+l_2^2\dot\theta_2^2+2l_1l_2\dot\theta_1\dot\theta_2\cos(\theta_1-\theta_2),
]
so the kinetic and potential energies are
[
T=\tfrac12(m_1+m_2)l_1^2\dot\theta_1^2+\tfrac12 m_2l_2^2\dot\theta_2^2+m_2 l_1 l_2 \dot\theta_1\dot\theta_2\cos(\theta_1-\theta_2),
]
[
V=-(m_1+m_2) g,l_1\cos\theta_1-m_2 g,l_2\cos\theta_2.
]
The Lagrangian (L=T-V) leads to two Euler–Lagrange equations,
[
\frac{\mathrm d}{\mathrm dt}\frac{\partial L}{\partial\dot\theta_1}-\frac{\partial L}{\partial\theta_1}=0,\qquad
\frac{\mathrm d}{\mathrm dt}\frac{\partial L}{\partial\dot\theta_2}-\frac{\partial L}{\partial\theta_2}=0,
]
which after a short calculation can be written as the coupled second–order ODEs
[
(m_1+m_2)l_1^2,\ddot\theta_1 + m_2 l_1 l_2,\ddot\theta_2\cos(\theta_1-\theta_2) + m_2 l_1 l_2,\dot\theta_2^2\sin(\theta_1-\theta_2) + (m_1+m_2) g,l_1\sin\theta_1 = 0,
]
[
m_2 l_2^2,\ddot\theta_2 + m_2 l_1 l_2,\ddot\theta_1\cos(\theta_1-\theta_2) - m_2 l_1 l_2,\dot\theta_1^2\sin(\theta_1-\theta_2) + m_2 g,l_2\sin\theta_2 = 0,
]
which are the equations of motion of the planar double pendulum. Solving them for (\ddot\theta_{1,2}) gives the more familiar explicit forms.