12 Euler Lagrange equation
The Euler Lagrange equation is the generalization of the minimum action principle that’s used in physics.
12.1 Pendulum example
Considering as a practical example the motion of a pendulum of a mass m that’s free to oscillate in respect to a pivot point using a rope of length l, the kinetic energy T and the potential term V of the system can be expressed as
T = \frac 1 2 m v^2, \qquad V = mgy.
Considering \theta as the angle that the rope determines with the vertical axis, then the we can rewrite the energies as functions of the angular position \theta and velocity \dot \theta as
T(\theta,\dot \theta) = \frac 1 2 m l^2 \dot\theta^2, \qquad V(\theta) = - m gl\sin\theta.
To solve the dynamic equation \theta(t) of the mechanism we can compute the lagrangian L of the system defined as
L(\theta,\dot\theta) = T(\theta,\dot\theta)-V(\theta) = \frac m 2 l^2\dot\theta^2 + lmg\cos\theta
As law that’s analyzed in mechanics physics we can state that the solution of the dynamics of the system is the one the function that minimize the action \mathcal{A} of the system defined as
A(\theta) = \int_{t_0}^{t_1} L (\theta,\dot\theta)\, \mathrm{d}t \tag{12.1}
where the values \theta(t_0)= \theta_0 and \theta(t_1)=\theta_1 are known parameters.
In practice to determine the required solution we can use analytical tool to find the trajectory that can then be demonstrated to be the minimum of the action \mathcal{A} (that’s indeed a functional).
However we can also try to analytically determine the function \theta^\star(t) that minimize the functional \mathcal{A}(\cdot) by computing the directional derivatives.
Let now consider the function \theta^\star(t) and a direction \delta\theta(t) that satisfy
\delta\theta(t_0)=\delta\theta(t_1) = 0
we can then use the fundamental lemma of the calculus of variation to determine the minimal function (considering that the expression Equation 12.1 of the action is comparable to equation Equation 11.1 of the lemma).
To determine the minimum point we have in fact to determine the function \theta^\star whose first variation of the action \mathcal{A} is zero for each direction of approach \delta\theta to the point, and so in this example we need to compute
\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}\alpha} \mathcal{A} \big(\theta^\star + \alpha\, \delta\theta\big) & = \frac{\mathrm{d}}{\mathrm{d}\alpha} \int_{t_0}^{t_1} L\big( \theta ^\star + \alpha\, \delta\theta, \dot\theta^\star + \alpha\, \delta\dot\theta \big) \,\mathrm{d}t \\ & = \int_{t_0}^{t_1} \left[\frac{\partial L}{\partial\theta} \frac{\mathrm{d}}{\mathrm{d}\alpha} \big(\theta^\star + \alpha \,\delta\theta\big) + \frac{\partial L}{\partial\dot\theta} \frac{\mathrm{d}}{\mathrm{d}\alpha} \big(\dot \theta^\star + \alpha \,\dot \delta\theta\big) \right] \, \mathrm{d}t \\ & = \int_{t_1}^{t_2} \big(-lmg\sin(\theta^\star + \alpha\, \delta\theta)\big)\delta\theta + ml^2\big( \dot\theta^\star + \alpha \, \delta\dot\theta \big)\, \delta\dot\theta \, \mathrm{d}t \end{aligned}
Note that from in the first step we made the implicit assumption that
\frac{\mathrm{d}}{\mathrm{d}\alpha} \int = \int\frac{\mathrm{d}}{\mathrm{d}\alpha}
while however this is not always possible. Evaluating the previous expression for \alpha = 0 gives the first variation of the action \mathcal{A} that’s
\begin{aligned} \delta \mathcal{A}(\theta^\star;\delta\theta) & = \frac{\mathrm{d}}{\mathrm{d}\alpha} \mathcal{A}\big(\theta^\star + \alpha\, \delta\theta\big) \Big|_{\alpha = 0}\\ & = \int_{t_0}^{t_1} \big(-lmg \sin\theta^\star\delta\theta + ml^2\dot\theta^\star \delta\dot\theta \big) \, \mathrm{d}t = 0 \qquad \end{aligned}
for all \delta\theta. Performing an integration by part allows to remove the term \delta\dot\theta that’s hard to determine, and in fact
\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}t}\big( ml^2\dot\theta^\star \, \delta\theta\big) & = \frac{\mathrm{d}}{\mathrm{d}t}\big(ml^2\dot\theta^\star\big)\,\delta\theta + ml^2\dot\theta^\star \delta\dot\theta \\ & \Downarrow \\ ml^2\dot\theta^\star \delta\dot\theta &= \frac{\mathrm{d}}{\mathrm{d}t}\big( ml^2\dot\theta^\star \, \delta\theta\big) - \frac{\mathrm{d}}{\mathrm{d}t}\big(ml^2\dot\theta^\star\big)\,\delta\theta \end{aligned}
Performing the substitution of the integration by parts determines the result
\begin{aligned} \mathcal{A} \big(\theta^\star;\delta\theta\big) & = \int_{t_0}^{t_1} \left[ - lmg\sin\theta^\star - \frac{\mathrm{d}}{\mathrm{d}t}\big(ml^2\theta^\star\big)^2 \right]\delta\theta\, \mathrm{d}t + \cancel{\big[ ml^2 \dot\theta^\star \delta\theta \big]\Big|_{t_0}^{t_1} } \\ & = \int_{t_0}^{t_1} \underbrace{\left[ -lmg \sin\theta^\star - \frac{\mathrm{d}}{\mathrm{d}t}\big(ml^2 \dot\theta^\star\big) \right]}_{f(t)} \delta\theta\, \mathrm{d}t = 0 \end{aligned}
We can now see in this formulation that the marked expression represent the function f(x) of the fundamental lemma considering that the relation must be true for all approaching direction \delta\theta, and so it must be
-lmg \sin\theta^\star - \frac{\mathrm{d}}{\mathrm{d}t}\big(ml^2 \dot\theta^\star\big) = 0
The problem now to complete the analyses of the pendulum motion is determining the function \theta^\star(t) that satisfy this expression and also match the boundary conditions \theta(t_0) = \theta_0 and \theta(t_1)=\theta_1.
12.2 General formulation
Given a generic functional of the form
\mathcal{A}(x) = \int_a^b L \big(x(t),x'(t),t\big)\, \mathrm{d}t
the problem is to minimize the functional \mathcal{A}(x) for a function x \in\Bbb{V} subject to the boundary conditions x(a) = x_a and x(b) = x_b in the function space \Bbb{V} defined as
\Bbb{V} = \big\{ x \ | \ x\in C^2([a,b]) \textrm{ with } x(a) = x_a,x(b) = x_b \big\}
Let \Bbb{D} the function space of all the feasible directions of derivatives defined as
\Bbb{D} = \big\{ \delta x \ | \ \delta x \in C^{\infty}([a,b]) \textrm{ with } \delta x(a) = \delta x(b) = 0 \big\}
the function x(t) that minimize the functional is the one whose first variation is zero for any admissible perturbation, and so such that
\delta \mathcal{A}(x;\delta x) = \frac{\mathrm{d}}{\mathrm{d}\alpha} \mathcal{A}(x+\alpha\, \delta x) \Big|_{\alpha = 0} = 0 \qquad \textrm{for all} \;\delta x \in\Bbb{D}
Assuming the possibility to correctly apply the rule
\frac{\mathrm{d}}{\mathrm{d}\alpha} \int = \int \frac{\mathrm{d}}{\mathrm{d}\alpha}
we can express the directional derivative of the functional \mathcal{A}(x) evaluated in x+ \alpha\, \delta x as
\begin{aligned} \frac{\mathrm{d}\mathcal{A}(x+\alpha\delta x)}{\mathrm{d}\alpha} & = \frac{\mathrm{d}}{\mathrm{d}\alpha} \int_a^b L \big( x + \alpha\, \delta x ,x' + \alpha\, \delta x', t\big)\, \mathrm{d}t \\ & = \int_a^b \left( \frac{\partial L}{\partial x}\delta x + \frac{\partial L}{\partial x'}\delta x'\right)\, \mathrm{d}t \\ \frac{\mathrm{d}\mathcal{A}}{\mathrm{d}\alpha}\Big|_{\alpha = 0} & = \int_a^b \left( \frac{\partial L}{\partial x}(x,x',t)\delta x + \frac{\partial L}{\partial x'}(x,x',t)\delta x' \right)\, \mathrm{d}t \end{aligned}
By performing the integration by part it’s possible do reconvert the term associated do \delta x' into pieces depending on \delta x one of which, when evaluated, becomes zero due to the fact that \delta x(a) = \delta x(b) = 0:
\begin{aligned} \frac{\mathrm{d}\mathcal{A}}{\mathrm{d}\alpha} \Big|_{\alpha = 0} & = \int_a^b \left[ \frac{\partial L}{\partial x}(x,x',t) - \frac{\mathrm{d}}{\mathrm{d}t} \left(\frac{\partial L}{\partial x'}(x,x',t) \right) \right] \delta x\, \mathrm{d}t \\ & + \int_a^b\frac{\mathrm{d}}{\mathrm{d}t} \left(\frac{\partial L}{\partial x'}(x,x',t)\delta x \right) \, \mathrm{d}t \\ & = \int_a^b \left[ \frac{\partial L}{\partial x}(x,x',t) - \frac{\mathrm{d}}{\mathrm{d}t} \left(\frac{\partial L}{\partial x'}(x,x',t) \right) \right] \delta x\, \mathrm{d}t \\ &+ \cancel{\left[ \frac{\partial L}{\partial x'}(x,x',t)\delta x \right]_{t=a}^{t=b}} \end{aligned}
In this case the substitution by part has been obtained by performing the operation
\frac{\mathrm{d}}{\mathrm{d}t} \left( \frac{\partial L}{\partial x'}(x,x',t)\delta x \right) = \frac{\mathrm{d}}{\mathrm{d}t} \left( \frac{\partial L}{\partial x'}(x,x',t) \right) \delta x + \frac{\partial L}{\partial x'}(x,x',t)\delta x'
If we in fact explicit the term containing \delta x' we have
\frac{\partial L}{\partial x'}(x,x',t)\delta x' = \underbrace{\frac{\mathrm{d}}{\mathrm{d}t} \left(\frac{\partial L}{\partial x'}(x,x',t)\delta x \right)}_\textrm{term \#1} - \underbrace{\frac{\mathrm{d}}{\mathrm{d}t} \left(\frac{\partial L}{\partial x'}(x,x',t)\right) \delta x}_\textrm{term \#2}
The second term still remains in the variation of the functional \mathcal{A}, while the first term is eliminated because it’s evaluation becomes
\begin{aligned} \int_a^b\frac{\mathrm{d}}{\mathrm{d}t} \left(\frac{\partial L}{\partial x'}\delta x \right) \,\mathrm{d}t &= \left[ \frac{\partial L}{\partial x'}(x(t),x'(t),t) \delta x(t) \right]_a^b \\ &= \frac{\partial L}{\partial x'}(x(b),x'(b),b) \delta x(b) - \frac{\partial L}{\partial x'}(x(a),x'(a),a) \delta x(t) \end{aligned}
Looking at the function space \Bbb{D}, we see that \delta x(a)=\delta x(b)=0; hence the boundary term vanishes.
We can now see that the condition to have a minimum for the functional \mathcal{A}, by using the fundamental lemma of calculus of variation, is requiring that the function f(t) defined as follows is identically null:
\frac{\mathrm{d}\mathcal{A}(x+\alpha\, \delta x)}{\mathrm{d}\alpha} \Big|_{\alpha = 0} = \int_a^b \underbrace{\left( \frac{\partial L}{\partial x} - \frac{\mathrm{d}}{\mathrm{d}t} \frac{\partial L}{\partial x'}\right)}_{=f(t)} \delta x \, \mathrm{d}t = 0 \tag{12.2}
This in general means that the function that minimise the functional \mathcal A must solve the following second order ordinary differential equation:
\begin{cases} \dfrac{\mathrm{d}}{\mathrm{d}t} \dfrac{\partial L }{\partial x'} - \dfrac {\partial L }{\partial x} = 0 \\[0.5em] x(a) = x_a \\ x(b) = x_b \end{cases}
Example 12.1 (computation of the first variation) Given the generic functional defined as
\mathcal{F}(x) = \int_a^b G(x,x',t)\, \mathrm{d}t + x(a)x(b)
in order to compute it’s first variation we can use the standard approach by evaluating the perturbation of the functional respect to a function x:
\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}\alpha} \mathcal{F} \big(x+\alpha\, \delta x\big) &= \frac{\mathrm{d}}{\mathrm{d}\alpha} \int_a^b G\big(x+\alpha\, \delta x, x' + \alpha\, \delta x',t\big)\, \mathrm{d}t \\[1em] & +\frac{\mathrm{d}}{\mathrm{d}\alpha} \Big( \big(x(a) + \alpha \delta x(a)\big)\big(x(b) + \alpha\, \delta x(b)\big)\Big) \\[1em] &= \int_a^b \left( \frac{\partial G}{\partial x} x \, \delta x + \frac{\partial G}{\partial x'} \delta x' \right) \, \mathrm{d}t \\[1em] & + \delta x(a) \big(x(b) + \alpha\, \delta x(b)\big) + \big( x(a) + \alpha\,\delta x(a) \big)\delta x(b) \\[1em] &\downarrow\quad\alpha=0 \\[1em] &=\int_a^b \left( \frac{\partial G}{\partial x} \delta x + \frac{\partial G}{\partial x'}\delta x' \right) \, \mathrm{d}t + \delta x(a)x(b) + x(a)\delta x(b) \end{aligned}
This redundant formulation can be simplified by using the Gateaux derivative notation \delta that allows to express the first variation as
\begin{aligned} \delta \mathcal{F}(x) & = \delta \left(\int_a^b G(x,x',t)\, \mathrm{d}t + x(a)x(b)\right) \\[1em] &= \int_a^b \delta G(x,x',t)\, \mathrm{d}t + \delta\big(x(a)x(b)\big)\\[1em] &= \int_a^b \left( \frac{\partial G}{\partial x}(x,x',t)\delta x + \frac{\partial G}{\partial x'}(x,x',t)\delta x' \right)\, \mathrm{d}t \\[1em] & + \delta x(a) x(b) + x(a)\delta x(b) \end{aligned}
using integration by part
\dfrac{\mathrm{d}}{\mathrm{d}t} \left(\frac{\partial G}{\partial x'}(x,x',t)\delta x\right) = \dfrac{\mathrm{d}}{\mathrm{d}t}\frac{\partial G}{\partial x'}(x,x',t)\delta x + \frac{\partial G}{\partial x'}(x,x',t)\delta x'
and substituting
\begin{aligned} \delta \mathcal{F}(x) &= \int_a^b \underbrace{\left(\frac{\partial G}{\partial x}(x,x',t) -\dfrac{\mathrm{d}}{\mathrm{d}t}\frac{\partial G}{\partial x'}(x,x',t)\right) }_{(A)} \delta x\, \mathrm{d}t \\[1em] & + \underbrace{\left[ x(a)+\frac{\partial G}{\partial x'}(x(b),x'(b),b)\right] }_{(B)}\delta x(b) \\ & + \underbrace{\left[ x(b)-\frac{\partial G}{\partial x'}(x(a),x'(a),a)\right] }_{(C)}\delta x(a) \end{aligned}
using foundamental lemma of calculus of variations (A)=0 and then using variation differents from zero on th eborder it follows that (B)=(C)=0 and the stationary points of the functional F(x) satrisfy the BVP
\left\{\begin{aligned} \frac{\partial G}{\partial x}(x,x',t) -\dfrac{\mathrm{d}}{\mathrm{d}t}\frac{\partial G}{\partial x'}(x,x',t) &=0 \\ x(a)+\frac{\partial G}{\partial x'}(x(b),x'(b),b) &=0 \\ x(b)-\frac{\partial G}{\partial x'}(x(a),x'(a),a) &=0 \end{aligned}\right.
12.3 Application to the brachistochrone problem
As saw at the introduction, functional minimization can be used to solve real problem. As example the brachistochrone problem wants to determine the path that minimize the time T to reach point B from a point A for a mass m subjected only to the force of gravity: this means minimizing the function
T = \int_A^B \frac 1 v \, \mathrm{d}s
where v is the velocity of the point over the arc length \mathrm{d}s. In order to describe the problem we consider x as the horizontal axis and y the vertical one (with positive direction the one facing upwards);
the point A is described by the coordinates (x_a,x_b) = (0,0) (so it’s in the center of the reference system)
the point B = (x_b,y_b) is placed anywhere in the lower semi-plane (in fact we must require that y_b<0 in order to have a free fall of the object).
Considering that at the initial position A both the kinetic and potential energy are zero, due to the conservation of energy we can derive that
0 = mgy + \frac 1 2 m v^2 \quad \implies \quad v = \sqrt{-2gy}
We so have the velocity v as depending from the vertical coordinate y of the point, and so the next step is to relate the arc length \mathrm{d}s with the horizontal variation \mathrm{d}x: we can see that
\mathrm{d}s = \sqrt{\mathrm{d}x^2 + \mathrm{d}y^2} = \sqrt{\mathrm{d}x^2 + y'^2(x)\mathrm{d}x^2} = \sqrt{1 + y'^2} \mathrm{d}x
The initial brachistochrone problem can so be states as the following functional minimization problem:
\begin{aligned} \textrm{minimize:} \qquad & \mathcal{F}(y) = \int_{x_a}^{x_b} L(y,y')\, \mathrm{d}x \\ \textrm{subject to:} \qquad & y\big(x_a\big) = y_a = 0 \qquad y\big(x_b\big) = y_b < 0 \end{aligned}
where the independent variable is the x coordinate, and
L(y,y') = \sqrt{\frac{1+y'^2}{-2gy}}
the integral part of the target function to be minimized can be computed starting from
\begin{aligned} \frac{\partial L}{\partial y} - \frac{\mathrm{d}}{\mathrm{d}x} \frac{\partial L}{\partial y'} &= -\frac{1+3 y'^2 + 2y'^4 - 2 y \, y''} {2\sqrt 2 g^2 y^3 \sqrt{\left(- \dfrac{1 + y'^2}{gy}\right)^3}} \\ &= \frac{1+3 y'^2 + 2y'^4 - 2 y \, y''} {2\sqrt{2} g y^2 (1 + (y')^2)} \sqrt{-\dfrac{gy}{1 + y'^2}} \end{aligned}
and the functional minimization is equivalent to the following boundary value problem:
\left\{ \begin{aligned} 1+3\,y'(x)^2 + 2\,y'(x)^4 - 2\,y(x)y''(x) &= 0 \\[0.5em] y(0) &= 0 \\[0.5em] y(x_b) &= y_b \end{aligned} \right.
Even if it’s not clear at first sight, it can be proven that the solution of the differential equation is a cycloid described by the equations
x(\theta) = \frac{1}{2} k^2 \big(\theta-\sin\theta\big), \qquad y(\theta) = \frac{1}{2} k^2 \big(1-\cos\theta \big)
where the constant k and the range of the new angle \theta of the parametrization can be found by using the boundary conditions.
In particular, the initial condition on points A allows to state that \theta_a = 0 (in fact x(0) = \frac{1}{2} k^ 2 0 = 0 and also y(0) = 0), while considering the final conditions we can determine both \theta_b and k solving this system of non-linear equation in such variables:
\begin{cases} x_b = \dfrac{1}{2} k^2 \big(\theta_b - \sin\theta_b\big) \\[1em] y_b = \dfrac{1}{2} k^2 \big(1-\cos\theta_b\big) \end{cases}