# The Euler-Lagrange equation

In this article, I’ll prove the *Euler-Lagrange equation* and give some examples of applications. I’ll use some other theorems without proof: Fermat’s theorem, the fundamental lemma of the calculus of variations, the multivariate chain rule, and integrations by parts.

**Theorem**: *Consider the functional $I$ defined by*

*If $f$ is a differentiable function for which this functional has a local extremum, then it must satisfy the Euler-Lagrange equation:*

**Proof**: Define a mapping $h$ that maps a real number to a function as

where $η$ is any differentiable function with $η(a)=η(b)=0$. Suppose that $f$ is a differential function for which $I$ has a local extremum. Then, by Fermat’s theorem, we have that $dαd I(h(α))∣_{α=0}=0$ when $f$ is a local extremum of $I$.

Working out $dαd I(h(α))$ gives

$dαd I(h(α))=dαd ∫_{a}L(h,h_{′},x)dx=∫_{a}dαd L(h,h_{′},x)dx$Technically, I have to show that switching the order of integration and differentiation is allowed, but I’ll omit this step for now.

Using the multivariate chain rule, we see this last expression equals $∫_{a}∂h∂L dαdh +∂h_{′}∂L dαdh_{′} dx$, so we have

$dαd I(h(α))=∫_{a}∂h∂L dαdh +∂h_{′}∂L dαdh_{′} dx$Note that the term $∂x∂L dαdx $ does not occur since $dαdx =0$. Now we use that $dαdh =η$ and $dαdh_{′} =η_{′}$, and obtain

$dαd I(h(α))=∫_{a}∂h∂L η(x)+∂h_{′}∂L η_{′}(x)dx$Now, consider the integral over only the second term. By using integration by parts, we see

$∫_{a}∂h_{′}∂L η_{′}(x)dx=∂h_{′}∂L η(b)−∂h_{′}∂L η(a)−∫_{a}dxd ∂h_{′}∂L η(x)dx$Using that $η(a)=η(b)=0$, this simplifies to just

$∫_{a}∂h_{′}∂L η_{′}(x)dx=−∫_{a}dxd ∂h_{′}∂L η(x)dx$Substituting this back in the equation for $dαd I(h(α))$ yields

$dαd I(h(α))=∫_{a}(∂h∂L −dxd ∂h_{′}∂L )η(x)dx$We have $h(0)=f$, so evaluating the whole thing at $α=0$, we get

$dαd I(h(α))=∫_{a}(∂f∂L −dxd ∂f_{′}∂L )η(x)dx$Remembering that $dαd I(h(α))=0$ by Fermat’s theorem, we have

$∫_{a}(∂f∂L −dxd ∂f_{′}∂L )η(x)dx=0$for any differentiable $η$ with $η(a)=η(b)=0$. By the fundamental lemma of the calculus of variations, it follows that $∂f∂L −dxd ∂f_{′}∂L =0$, which yields

$∂f∂L =dxd ∂f_{′}∂L $when rearranged. $□$

If the integrand $L(f,f_{′},x)$ does not depend on $f$ or on $x$, the Euler-Lagrange equation can be simplified. Let’s first consider the case where the integrand does not depend on $f$:

**Corollary**: *Consider the functional $I$ defined by*

*If $f$ is a differentiable function for which this functional has a local extremum, then*

*is constant.*

**Proof**: Note that this is a special case of the Euler-Lagrange equation where we have $∂f∂L =0$. Substituting this in the Euler-Lagrange equation, we get $dxd ∂f_{′}∂L =0$. It follows that $∂f_{′}∂L $ is constant. $□$

The case where $L$ does not depend on $x$ is similar, but less straightforward to prove.

**Corollary**: *Consider the functional*

*If $f$ is a differentiable function for which this functional has a local extremum, then*

*is constant.*

**Proof**: By the multivariate chain rule, we have

Substituting the Euler-Lagrange equation $∂f∂L =dxd ∂f_{′}∂L $ in this expression yields

$dxdL =(dxd ∂f_{′}∂L )dxdf +∂f_{′}∂L dxdf_{′} $Writing $f_{′}$ for $dxdf $, we can use the product rule:

$(dxd ∂f_{′}∂L )f_{′}+∂f_{′}∂L (dxd f_{′})=dxd (∂f_{′}∂L f_{′})$Substituting this, we obtain

$dxdL =dxd (∂f_{′}∂L f_{′})$After subtracting $dxdL $ from both sides we have

$dxd (∂f_{′}∂L −L)=0$This implies that

$∂f_{′}∂L −L$is constant. $□$

## Examples

The Euler-Lagrange equation is a helpful tool, but it usually requires some work to arrive at a solution. Here, I show some well-known applications of the Euler-Lagrange equation.

### The shortest path between two points is a straight line

This intuitively obvious statement is not trivial to prove. I’ll give a proof using the Euler-Lagrange equation. I’ll take as a given that the length of a curve $y(x)$ from $x=a$ to $x=b$ is given by

$∫_{a}1+(dxdy )_{2} dx$An intuitive idea for why this holds can be obtained by considering that the length of a linear line segment is $Δx_{2}+Δy_{2} $, where $Δx$ and $Δy$ are the differences in the x-coordinate and y-coordinate. Letting $Δx→0$, we get $dx_{2}+dy_{2} $, and integrating yields the expression

$∫_{a}dx_{2}+dy_{2} =∫_{a}1+(dxdy )_{2} dx$for the length of the differentiable curve $y$ from $(a,y(a)$ to $(b,y(b))$.

Setting $I(f)=∫_{a}1+(dxdy )_{2} dx$, the Euler-Lagrange equation now gives

$dxd ∂y∂ 1+(y_{′})_{2} =0$Working out the derivatives gives

$dxd ∂y∂ 1+(y_{′})_{2} =dxd 1+(y_{′})_{2} y_{′} =1+(y_{′})_{2} _{3}y_{′′} =0$Since the denominator is always positive, it follows that $y_{′′}=0$, and $y$ must be of the form

$y(x)=ax+b$### Brachistochrone

A *brachistochrone curve* through two points $A$ and $B$ on a plane is defined as the curve that minimizes the time that it takes from a point to slide from $A$ to $B$ from a standstill, neglecting friction. Of course, this assumes that the height of $B$ is less than the height of $A$.

Tackling this problem requires some physics. The potential energy, which is the energy that the particle gets from its height is $mgh$, where $m$ is the mass of the particle, $g$ is some gravitational constant, and $h$ is the height of the particle. The kinetic energy, that the particle gets from its speed, is $21 mv_{2}$. Since we pretend there’s no friction and ignore other types of energy, the sum of these two energies is constant by the law of conservation of energy. If we assume that the mass of the particle $m$ is constant as well, we find

$21 v_{2}+gh=c$for some constant $c$.

Re-arranging, we find $v=2g d−h $ with $d=gb $. Since $g$ is a constant, the speed depends only on the height $h$ of the ball, which is an interesting result in itself. It is particularly convenient to assume that the height $A$ is zero, so that $y=d−h$. Note that the $y$ axis points downwards in this case. In this case, we obtain:

$v=2gy $Now, as we used before, the length of an infinitesimal curve segment is $1+(y_{′})_{2} dx$. The speed at $y$ is $2gy $. The time that is takes a ball to roll over the line segment is simply the length of the segment divided by its speed. So we can express the time it takes to roll from $A$ to $B$ as

$∫_{x_{A}}2gy1+(y_{′})_{2} dx$With this we finally have the integral to minimize, and we can use the Euler-Lagrange equation with $L=2gy1+(y_{′})_{2} $. In fact, the integrand does not depend on $x$, so we can use a simplified version. From this, we gather that

$∂y_{′}∂L y_{′}−L=C$for some constant $C$. Now, first, compute $∂y_{′}∂L $:

$∂y_{′}∂L =2gy 1 1+(y_{′})_{2} y_{′} $Substituting this in the previous equation yields

$2gy 1 (1+(y_{′})_{2} (y_{′})_{2} −1+(y_{′})_{2} )=C$Simplifying gives

$2gy 1 1+(y_{′})_{2} −1 =C$ $y(1+(y_{′})_{2}) =−2g C1 $ $y(1+(y_{′})_{2})=r_{2}$with $r=2g C1 $. Now, write $y_{′}=dxdy $. We can then rewrite to

$y(dx_{2}+dy_{2})=r_{2}dx_{2}$Now, we want to write $x$ and $y$ as a function of a parameter $t$. Divide both sides by $dt_{2}$ to get

$y((dtdx )_{2}+(dtdy )_{2})=r_{2}(dtdx )_{2}$Then it can be checked that

$x(t)=2r_{2} (t−sin(t))$ $y(t)=2r_{2} (1−cos(t))$is a solution to this differential equation.