The Euler-Lagrange Equations
The workhorse of analytical mechanics: choose generalized coordinates, write down the Lagrangian, and the equations of motion follow automatically — no need to resolve forces or constraint reactions.
Historical Context
Leonhard Euler first derived the equation in 1744 while working on the calculus of variations, seeking curves that extremize certain integrals. Joseph-Louis Lagrange independently obtained the same result in 1755, at just 19 years old, in a letter to Euler. Lagrange's approach was more algebraic and avoided the geometric arguments Euler had used. This led to the "analytical mechanics" that Lagrange systematized in his 1788 Mecanique Analytique, a work so elegant that it contained not a single diagram.
The power of the Euler-Lagrange approach is that it works in any coordinate system. Cartesian, polar, spherical, elliptic — the equations take the same form regardless. Constraints that would require unknown reaction forces in Newton's approach are handled automatically through the choice of generalized coordinates.
1. Generalized Coordinates
A system of \(N\) particles in 3D has \(3N\) Cartesian coordinates. If there are \(k\) independent constraints, the system has \(n = 3N - k\) degrees of freedom. We can describe the configuration with \(n\) generalized coordinates \(q_1, q_2, \ldots, q_n\) — any set of \(n\) independent parameters that uniquely specify the configuration.
Examples of Generalized Coordinates
- Simple pendulum: angle \(\theta\) (1 DOF, instead of constrained \(x, y\))
- Double pendulum: angles \(\theta_1, \theta_2\) (2 DOF)
- Bead on a wire: arc length \(s\) along the wire (1 DOF)
- Rigid body: 3 Euler angles + 3 center-of-mass coordinates (6 DOF)
The Cartesian positions are functions of the generalized coordinates and (possibly) time:
\[\mathbf{r}_\alpha = \mathbf{r}_\alpha(q_1, \ldots, q_n, t), \quad \alpha = 1, \ldots, N\]
The velocities then follow from the chain rule:
\[\dot{\mathbf{r}}_\alpha = \sum_{i=1}^{n} \frac{\partial \mathbf{r}_\alpha}{\partial q_i}\dot{q}_i + \frac{\partial \mathbf{r}_\alpha}{\partial t}\]
2. The Euler-Lagrange Equations in Full Generality
Given the Lagrangian \(L(q_1, \ldots, q_n, \dot{q}_1, \ldots, \dot{q}_n, t) = T - V\), the equations of motion are:
\[\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_i} - \frac{\partial L}{\partial q_i} = 0, \quad i = 1, \ldots, n\]
Each equation is second-order in time (since \(\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_i}\)involves \(\ddot{q}_i\)). Together, these \(n\) equations require \(2n\) initial conditions (the initial values of all \(q_i\) and \(\dot{q}_i\)).
Important Identities
The generalized momentum conjugate to \(q_i\) is:
\[p_i = \frac{\partial L}{\partial \dot{q}_i}\]
The generalized force associated with \(q_i\) is:
\[F_i = \frac{\partial L}{\partial q_i}\]
So the Euler-Lagrange equation takes the familiar Newtonian form \(\dot{p}_i = F_i\) — but now in generalized coordinates.
3. Constraints: Holonomic and Nonholonomic
Holonomic Constraints
A constraint is holonomic if it can be written as an equation relating the coordinates and time:
\[f(q_1, \ldots, q_n, t) = 0\]
Examples: a rigid rod (\(|\mathbf{r}_1 - \mathbf{r}_2|^2 = l^2\)), a bead constrained to a surface (\(g(x, y, z) = 0\)), or a pendulum (\(x^2 + y^2 = l^2\)). Holonomic constraints can always be used to eliminate variables, reducing the number of degrees of freedom.
Nonholonomic Constraints
A constraint is nonholonomic if it involves velocities and cannot be integrated to a constraint on coordinates alone:
\[\sum_i a_i(q, t)\,dq_i + a_t(q, t)\,dt = 0 \quad \text{(non-integrable)}\]
The classic example is a disk rolling without slipping: the no-slip condition \(\dot{x} = R\dot{\theta}\)involves velocities and cannot reduce the configuration space. Nonholonomic constraints require special treatment — usually via Lagrange multipliers or the Appell-Gibbs equations.
Lagrange Multipliers for Constraints
When we want to keep constraints explicit (e.g., to find constraint forces), we use Lagrange multipliers. For \(m\) holonomic constraints \(f_j(q, t) = 0\), the modified Euler-Lagrange equations are:
\[\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_i} - \frac{\partial L}{\partial q_i} = \sum_{j=1}^{m} \lambda_j \frac{\partial f_j}{\partial q_i}\]
The multiplier \(\lambda_j\) is directly related to the constraint force associated with constraint \(f_j\). This gives us \(n + m\) equations for \(n + m\) unknowns (the \(q_i\) and \(\lambda_j\)).
4. Classic Examples
Example 1: Simple Pendulum
A mass \(m\) on a rigid rod of length \(l\), swinging in a vertical plane. The single generalized coordinate is the angle \(\theta\).
Position: \(x = l\sin\theta\), \(y = -l\cos\theta\)
Kinetic energy: \(T = \frac{1}{2}ml^2\dot{\theta}^2\)
Potential energy: \(V = -mgl\cos\theta\)
Lagrangian: \(L = \frac{1}{2}ml^2\dot{\theta}^2 + mgl\cos\theta\)
Euler-Lagrange:
\[ml^2\ddot{\theta} + mgl\sin\theta = 0 \quad \Rightarrow \quad \ddot{\theta} + \frac{g}{l}\sin\theta = 0\]
This is the exact (nonlinear) pendulum equation. For small angles, \(\sin\theta \approx \theta\), giving simple harmonic motion with \(\omega = \sqrt{g/l}\).
Example 2: Bead on a Rotating Wire
A bead of mass \(m\) slides frictionlessly on a straight wire that rotates about a vertical axis with angular velocity \(\omega\). The generalized coordinate is the distance \(r\) from the axis.
Position (cylindrical): \(\rho = r\), \(\phi = \omega t\), \(z = 0\)
Kinetic energy: \(T = \frac{1}{2}m(\dot{r}^2 + r^2\omega^2)\)
Potential: \(V = 0\) (horizontal wire)
Lagrangian: \(L = \frac{1}{2}m(\dot{r}^2 + r^2\omega^2)\)
Euler-Lagrange:
\[m\ddot{r} - m\omega^2 r = 0 \quad \Rightarrow \quad \ddot{r} = \omega^2 r\]
The bead accelerates outward exponentially: \(r(t) = Ae^{\omega t} + Be^{-\omega t}\). The centrifugal "force" appears naturally from the Lagrangian — no fictitious forces needed.
Example 3: Double Pendulum
Two masses \(m_1, m_2\) connected by rigid rods of lengths \(l_1, l_2\). Generalized coordinates: \(\theta_1, \theta_2\).
Positions:
\[x_1 = l_1\sin\theta_1, \quad y_1 = -l_1\cos\theta_1\]
\[x_2 = l_1\sin\theta_1 + l_2\sin\theta_2, \quad y_2 = -l_1\cos\theta_1 - l_2\cos\theta_2\]
Lagrangian:
\[L = \frac{1}{2}(m_1 + m_2)l_1^2\dot{\theta}_1^2 + \frac{1}{2}m_2 l_2^2\dot{\theta}_2^2 + m_2 l_1 l_2 \dot{\theta}_1\dot{\theta}_2\cos(\theta_1 - \theta_2)\]
\[\quad + (m_1 + m_2)gl_1\cos\theta_1 + m_2 g l_2\cos\theta_2\]
The resulting equations of motion are coupled and nonlinear — the system is chaotic for large amplitudes. Try deriving the full Euler-Lagrange equations as an exercise.
Example 4: Atwood Machine
Two masses \(m_1\) and \(m_2\) connected by an inextensible string over a massless pulley. One generalized coordinate: the displacement \(x\) of \(m_1\).
Constraint: \(x_1 + x_2 = \text{const}\), so \(\dot{x}_2 = -\dot{x}_1 = -\dot{x}\)
Lagrangian: \(L = \frac{1}{2}(m_1 + m_2)\dot{x}^2 + (m_1 - m_2)gx\)
Euler-Lagrange:
\[(m_1 + m_2)\ddot{x} = (m_1 - m_2)g \quad \Rightarrow \quad \ddot{x} = \frac{m_1 - m_2}{m_1 + m_2}g\]
The string tension never appears! Compare this with the Newtonian approach, which requires solving two equations simultaneously to eliminate the tension.
5. The Energy Function and Conservation
Define the energy function (also called the Jacobi integral):
\[h = \sum_i \dot{q}_i \frac{\partial L}{\partial \dot{q}_i} - L\]
Using the Euler-Lagrange equations, one can show:
\[\frac{dh}{dt} = -\frac{\partial L}{\partial t}\]
Therefore: if the Lagrangian has no explicit time dependence (\(\partial L/\partial t = 0\)), then \(h\) is conserved.
When the kinetic energy is a homogeneous quadratic function of the velocities (which holds when the coordinate transformation does not depend explicitly on time), Euler's theorem on homogeneous functions gives \(\sum_i \dot{q}_i \frac{\partial T}{\partial \dot{q}_i} = 2T\), and \(h = 2T - (T - V) = T + V = E\). In this case, the energy function equals the total mechanical energy.
Python Simulation: Pendulum, Double Pendulum & Phase Portraits
This simulation solves the Euler-Lagrange equations for the simple pendulum and the double pendulum numerically, producing phase portraits and trajectory plots. The double pendulum demonstrates sensitive dependence on initial conditions (chaos).
Euler-Lagrange: Pendulum and Double Pendulum Dynamics
PythonClick Run to execute the Python code
Code will be executed with Python 3 on the server
Summary
- Generalized coordinates reduce constrained systems to their true degrees of freedom.
- The Euler-Lagrange equations are equivalent to Newton's laws but work in any coordinate system.
- Holonomic constraints reduce degrees of freedom; nonholonomic ones require multipliers.
- Lagrange multipliers give both equations of motion and constraint forces simultaneously.
- The energy function \(h\) is conserved when \(\partial L/\partial t = 0\).
- The double pendulum is a paradigmatic example of Lagrangian mechanics leading to chaos.
Practice Problems
Problem 1:Find the equation of motion for a simple pendulum of length l and mass m using the Euler-Lagrange equation.
Solution:
1. Choose the generalized coordinate $\theta$ (angle from vertical).
2. The position is $x = l\sin\theta$, $y = -l\cos\theta$. The velocity squared is $\dot{x}^2 + \dot{y}^2 = l^2\dot{\theta}^2$.
3. Kinetic energy: $T = \frac{1}{2}ml^2\dot{\theta}^2$.
4. Potential energy: $V = -mgl\cos\theta$.
5. Lagrangian: $L = \frac{1}{2}ml^2\dot{\theta}^2 + mgl\cos\theta$.
6. Apply the Euler-Lagrange equation: $\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}} - \frac{\partial L}{\partial \theta} = 0$.
7. $\frac{\partial L}{\partial \dot{\theta}} = ml^2\dot{\theta}$, so $\frac{d}{dt}(ml^2\dot{\theta}) = ml^2\ddot{\theta}$.
8. $\frac{\partial L}{\partial \theta} = -mgl\sin\theta$.
9. Equation of motion: $\ddot{\theta} + \frac{g}{l}\sin\theta = 0$.
Problem 2:A bead of mass m slides without friction on a wire bent into a parabola y = ax². The wire rotates about the y-axis with angular velocity ω. Find the Lagrangian and equation of motion.
Solution:
1. Use the radial distance $r$ from the y-axis as the generalized coordinate. The constraint gives $y = ar^2$.
2. In cylindrical coordinates: $\dot{y} = 2ar\dot{r}$, and $\dot{\phi} = \omega$.
3. Kinetic energy: $T = \frac{1}{2}m(\dot{r}^2 + r^2\omega^2 + 4a^2r^2\dot{r}^2) = \frac{1}{2}m[(1 + 4a^2r^2)\dot{r}^2 + r^2\omega^2]$.
4. Potential energy: $V = mgar^2$.
5. Lagrangian: $L = \frac{1}{2}m(1 + 4a^2r^2)\dot{r}^2 + \frac{1}{2}mr^2\omega^2 - mgar^2$.
6. The Euler-Lagrange equation yields: $m(1 + 4a^2r^2)\ddot{r} + 4ma^2r\dot{r}^2 - mr\omega^2 + 2mgar = 0$.
7. Equilibrium at $\dot{r} = \ddot{r} = 0$ gives $r_0(\omega^2 - 2ga) = 0$, so the bead is at $r_0 = 0$ or, if $\omega^2 > 2ga$, at any $r_0$ (unstable origin).
Problem 3:Derive the equations of motion for an Atwood machine (masses m₁ and m₂ connected by a massless string over a massless pulley) using the Lagrangian method.
Solution:
1. Let $x$ be the displacement of $m_1$ downward. The constraint (fixed string length) means $m_2$ moves up by $x$.
2. Kinetic energy: $T = \frac{1}{2}m_1\dot{x}^2 + \frac{1}{2}m_2\dot{x}^2 = \frac{1}{2}(m_1 + m_2)\dot{x}^2$.
3. Potential energy: $V = -m_1 gx + m_2 gx = (m_2 - m_1)gx$ (taking initial position as reference).
4. Lagrangian: $L = \frac{1}{2}(m_1 + m_2)\dot{x}^2 - (m_2 - m_1)gx$.
5. Euler-Lagrange: $(m_1 + m_2)\ddot{x} = (m_1 - m_2)g$.
6. Acceleration: $\ddot{x} = \frac{(m_1 - m_2)}{(m_1 + m_2)}g$, which matches Newton's second law result.
Problem 4:A mass m is attached to a spring (constant k) on a frictionless inclined plane of angle α. Using the Lagrangian, find the equilibrium extension and oscillation frequency.
Solution:
1. Let $x$ be the extension from the natural length, measured along the incline.
2. Kinetic energy: $T = \frac{1}{2}m\dot{x}^2$.
3. Potential energy: $V = \frac{1}{2}kx^2 - mgx\sin\alpha$ (gravity component along incline).
4. Lagrangian: $L = \frac{1}{2}m\dot{x}^2 - \frac{1}{2}kx^2 + mgx\sin\alpha$.
5. Euler-Lagrange: $m\ddot{x} = -kx + mg\sin\alpha$.
6. Equilibrium ($\ddot{x} = 0$): $x_0 = \frac{mg\sin\alpha}{k}$.
7. Substitute $x = x_0 + \xi$: $m\ddot{\xi} = -k\xi$, giving oscillation frequency $\omega = \sqrt{k/m}$ (independent of incline angle).
Problem 5:Write the Lagrangian for a double pendulum (lengths l₁, l₂ and masses m₁, m₂). Derive the linearized equations of motion for small oscillations and find the normal mode frequencies when m₁ = m₂ = m and l₁ = l₂ = l.
Solution:
1. Generalized coordinates: $\theta_1$ and $\theta_2$ (angles from vertical).
2. Full kinetic energy: $T = \frac{1}{2}(m_1 + m_2)l_1^2\dot{\theta}_1^2 + \frac{1}{2}m_2 l_2^2\dot{\theta}_2^2 + m_2 l_1 l_2\dot{\theta}_1\dot{\theta}_2\cos(\theta_1 - \theta_2)$.
3. Potential energy: $V = -(m_1 + m_2)gl_1\cos\theta_1 - m_2 gl_2\cos\theta_2$.
4. For small angles with $m_1 = m_2 = m$, $l_1 = l_2 = l$: linearize $\cos(\theta_1 - \theta_2) \approx 1$.
5. The linearized equations become: $2ml^2\ddot{\theta}_1 + ml^2\ddot{\theta}_2 = -2mgl\theta_1$ and $ml^2\ddot{\theta}_1 + ml^2\ddot{\theta}_2 = -mgl\theta_2$.
6. Assume $\theta_i = A_i e^{i\omega t}$ and solve the eigenvalue problem. The characteristic equation is $\omega^4 - 4\frac{g}{l}\omega^2 + 2\frac{g^2}{l^2} = 0$.
7. Normal mode frequencies: $\omega_{\pm}^2 = \frac{g}{l}(2 \pm \sqrt{2})$. The slow mode has both pendulums swinging in phase; the fast mode has them in antiphase.