# MATH0043 §2: Calculus of Variations

###### Contents

## What is the Calculus of Variations?

Many problems involve finding a function that maximizes or minimizes an
integral expression.

One example is finding the curve giving the
shortest distance between two
points — a straight line, of course, in Cartesian geometry (but can you prove
it?) but less obvious if the two points lie on a curved
surface (the problem of finding geodesics.)

The mathematical techniques developed to solve this type of problem
are collectively known as the calculus of variations.

## 1 Functionals and Extrema

Typical Problem: Consider a definite integral that depends on an unknown function $y(x)$, as well as its derivative ${y}^{\prime}(x)=\frac{\mathrm{d}y}{\mathrm{d}x}$,

$$I(y)={\int}_{a}^{b}F(x,y,{y}^{\prime})dx.$$ |

A typical problem in the calculus of variations involve finding a particular function $y(x)$ to maximize or minimize the integral $I(y)$ subject to boundary conditions $y(a)=A$ and $y(b)=B$.

###### Definition 1.

The integral $I\mathit{}\mathrm{(}y\mathrm{)}$ is an example of a functional, which (more generally) is a mapping from a set of allowable functions to the reals.

We say that $I(y)$ has an extremum when $I(y)$ takes its maximum or minimum value.

## 2 The Statement of an Example Problem

Consider the problem of finding the curve $y(x)$ of shortest length that connects the two points $(0,0)$ and $(1,1)$ in the plane. Letting $\mathrm{d}s$ be an element of arc length, the arc length of a curve $y(x)$ from $x=0$ to $x=1$ is ${\int}_{0}^{1}ds$. We can use Pythagoras’ theorem to relate $\mathrm{d}s$ to $\mathrm{d}x$ and $\mathrm{d}y$: drawing a triangle with sides of length $\mathrm{d}x$ and $\mathrm{d}y$ at right angles to one another, the hypotenuse is $\approx \mathrm{d}s$ and so $\mathrm{d}{s}^{2}=\mathrm{d}{x}^{2}+\mathrm{d}{y}^{2}$ and $\mathrm{s}=\sqrt{\mathrm{d}{x}^{2}+\mathrm{d}{y}^{2}}=\sqrt{1+{\left(\frac{\mathrm{d}y}{\mathrm{d}x}\right)}^{2}}\mathrm{d}x$. This means the arc length equals ${\int}_{0}^{1}\sqrt{1+{y}^{\prime 2}}dx$.

The curve $y(x)$ we are looking for minimizes the functional

$$I(y)={\int}_{0}^{1}\mathit{d}s={\int}_{0}^{1}{(1+{({y}^{\prime})}^{2})}^{1/2}dx\mathit{\hspace{1em}\hspace{0.25em}}\text{subject to boundary conditions}y(0)=0,y(1)=1$$ |

which means that $I(y)$ has an extremum at $y(x)$. It seems obvious that the solution is $y(x)=x$, the straight line joining $(0,0)$ and $(1,1)$, but how do we prove this?

## 3 The Euler-Lagrange Equation, or Euler’s Equation

###### Definition 2.

Let ${\mathrm{C}}^{k}\mathit{}\mathrm{[}a\mathrm{,}b\mathrm{]}$ denote the set of continuous functions defined on the interval $a\mathrm{\le}x\mathrm{\le}b$ which have their first $k$-derivatives also continuous on $a\mathrm{\le}x\mathrm{\le}b$.

The proof to follow requires the integrand $F(x,y,{y}^{\prime})$ to be twice differentiable with respect to each argument. What’s more, the methods that we use in this module to solve problems in the calculus of variations will only find those solutions which are in ${C}^{2}[a,b]$. More advanced techniques (i.e. beyond MATH0043) are designed to overcome this last restriction. This isn’t just a technicality: discontinuous extremal functions are very important in optimal control problems, which arise in engineering applications.

###### Theorem 1.

If $I\mathit{}\mathrm{(}Y\mathrm{)}$ is an extremum of the functional

$$I(y)={\int}_{a}^{b}F(x,y,{y}^{\prime})dx$$ |

defined on all functions $y\mathrm{\in}{C}^{\mathrm{2}}\mathit{}\mathrm{[}a\mathrm{,}b\mathrm{]}$ such that $y\mathit{}\mathrm{(}a\mathrm{)}\mathrm{=}A\mathrm{,}y\mathit{}\mathrm{(}b\mathrm{)}\mathrm{=}B$, then $Y\mathit{}\mathrm{(}x\mathrm{)}$ satisfies the second order ordinary differential equation

$$\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{\partial F}{\partial {y}^{\prime}}\right)-\frac{\partial F}{\partial y}=0.$$ | (1) |

###### Definition 3.

Equation (1) is the Euler-Lagrange equation, or sometimes just Euler’s equation.

###### Warning 1.

You might be wondering what $\frac{\mathrm{\partial}\mathit{}F}{\mathrm{\partial}\mathit{}{y}^{\mathrm{\prime}}}$ is suppose
to mean: how can we differentiate with respect to a derivative? ^{†}^{†}margin: \dbend Think
of it like this: $F$ is given to you as a function of three variables,
say $F\mathit{}\mathrm{(}u\mathrm{,}v\mathrm{,}w\mathrm{)}$, and when we evaluate the functional $I$ we plug in $x\mathrm{,}y\mathit{}\mathrm{(}x\mathrm{)}\mathrm{,}{y}^{\mathrm{\prime}}\mathit{}\mathrm{(}x\mathrm{)}$ for $u\mathrm{,}v\mathrm{,}w$ and then integrate. The derivative $\frac{\mathrm{\partial}\mathit{}F}{\mathrm{\partial}\mathit{}{y}^{\mathrm{\prime}}}$ is just the partial derivative of $F$ with respect to its second
variable $v$. In other words, to find $\frac{\mathrm{\partial}\mathit{}F}{\mathrm{\partial}\mathit{}{y}^{\mathrm{\prime}}}$,
just pretend ${y}^{\prime}$ is a variable.

Equally, there’s an important difference between $\frac{\mathrm{d}\mathit{}F}{\mathrm{d}\mathit{}x}$ and $\frac{\mathrm{\partial}\mathit{}F}{\mathrm{\partial}\mathit{}x}$. The former is the derivative of $F$ with respect to $x$, taking into account the fact that $y\mathrm{=}y\mathit{}\mathrm{(}x\mathrm{)}$ and ${y}^{\mathrm{\prime}}\mathrm{=}{y}^{\mathrm{\prime}}\mathit{}\mathrm{(}x\mathrm{)}$ are functions of $x$ too. The latter is the partial derivative of $F$ with respect to its first variable, so it’s found by differentiating $F$ with respect to $x$ and pretending that $y$ and ${y}^{\mathrm{\prime}}$ are just variables and do not depend on $x$. Hopefully the next example makes this clear:

###### Example 1.

Let $F\mathit{}\mathrm{(}x\mathrm{,}y\mathrm{,}{y}^{\mathrm{\prime}}\mathrm{)}\mathrm{=}\mathrm{2}\mathit{}x\mathrm{+}x\mathit{}y\mathit{}{y}^{\mathrm{\prime}}\mathrm{+}{y}^{\mathrm{\prime}\mathit{}\mathrm{2}}\mathrm{+}y$. Then

$\frac{\partial F}{\partial {y}^{\prime}}$ | $=xy+2{y}^{\prime}$ | ||

$\frac{\mathrm{d}}{\mathrm{d}x}}\left({\displaystyle \frac{\partial F}{\partial {y}^{\prime}}}\right)$ | $=y+x{y}^{\prime}+2y^{\prime}{}^{\prime}$ | ||

$\frac{\partial F}{\partial y}$ | $=x{y}^{\prime}+1$ | ||

$\frac{\partial F}{\partial x}$ | $=2+y{y}^{\prime}$ | ||

$\frac{\mathrm{d}F}{\mathrm{d}x}$ | $=2+y{y}^{\prime}+xy{\prime}^{2}+xyy\prime \prime +2y\prime \prime y\prime +y\prime $ |

and the Euler–Lagrange equation is

$$y+x{y}^{\prime}+2y^{\prime}{}^{\prime}=x{y}^{\prime}+1$$ |

###### Warning 2.

$Y$ satisfying the Euler–Lagrange equation is a necessary, but not
sufficient, condition for $I\mathit{}\mathrm{(}Y\mathrm{)}$ to be an extremum. ^{†}^{†}margin: \dbendIn other
words, a function $Y\mathit{}\mathrm{(}x\mathrm{)}$ may satisfy the Euler–Lagrange equation even
when $I\mathit{}\mathrm{(}Y\mathrm{)}$ is not an extremum.

###### Proof.

Consider functions ${Y}_{\u03f5}(x)$ of the form

$${Y}_{\u03f5}(x)=Y(x)+\u03f5\eta (x)$$ |

where $\eta (x)\in {C}^{2}[a,b]$ satisfies
$\eta (a)=\eta (b)=0$, so that ${Y}_{\u03f5}(a)=A$ and ${Y}_{\u03f5}(b)=B$,
i.e. ${Y}_{\u03f5}$ still
satisfies the boundary conditions. Informally, ${Y}_{\u03f5}$ is a
function which satisfies our boundary conditions and which is ‘near to’
$Y$ when $\u03f5$ is small.^{1}^{1}
1
The function $\u03f5\eta (x)$
is known as the variation in $Y$.
$I({Y}_{\u03f5})$ depends on the value of $\u03f5$, and we write
$I[\u03f5]$ for the value of $I({Y}_{\u03f5})$:

$$I[\u03f5]={\int}_{a}^{b}F(x,{Y}_{\u03f5},{Y}_{\u03f5}^{\prime})dx.$$ |

When $\u03f5=0$, the function $I[\u03f5]$ has an extremum and so

$$\frac{\mathrm{d}I}{\mathrm{d}\u03f5}=0\mathit{\hspace{1em}\hspace{0.25em}}\text{when}\mathit{\hspace{1em}\hspace{0.25em}}\u03f5=0.$$ |

We can compute the derivative $\frac{\mathrm{d}I}{\mathrm{d}\u03f5}$ by differentiating under the integral sign:

$$\frac{\mathrm{d}I}{\mathrm{d}\u03f5}=\frac{\mathrm{d}}{\mathrm{d}\u03f5}{\int}_{a}^{b}F(x,{Y}_{\u03f5},{Y}_{\u03f5}^{\prime})dx={\int}_{a}^{b}\frac{\mathrm{d}F}{\mathrm{d}\u03f5}(x,{Y}_{\u03f5},{Y}_{\u03f5}^{\prime})dx$$ |

We now use the multivariable chain rule to differentiate $F$ with respect to $\u03f5$. For a general three-variable function $F(u(\u03f5),v(\u03f5),w(\u03f5))$ whose three arguments depend on $\u03f5$, the chain rule tells us that

$$\frac{\mathrm{d}F}{\mathrm{d}\u03f5}=\frac{\partial F}{\partial u}\frac{\mathrm{d}u}{\mathrm{d}\u03f5}+\frac{\partial F}{\partial v}\frac{\mathrm{d}v}{\mathrm{d}\u03f5}+\frac{\partial F}{\partial w}\frac{\mathrm{d}w}{\mathrm{d}\u03f5}.$$ |

In our case, the first argument $x$ is independent of $\u03f5$, so $\frac{\mathrm{d}x}{\mathrm{d}\u03f5}=0$, and since ${Y}_{\u03f5}=Y+\u03f5\eta $ we have $\frac{\mathrm{d}{Y}_{\u03f5}}{\mathrm{d}\u03f5}=\eta $ and $\frac{\mathrm{d}{Y}_{\u03f5}^{\prime}}{\mathrm{d}\u03f5}={\eta}^{\prime}$. Therefore

$$\frac{\mathrm{d}F}{\mathrm{d}\u03f5}(x,{Y}_{\u03f5},{Y}_{\u03f5}^{\prime})=\frac{\partial F}{\partial y}\eta (x)+\frac{\partial F}{\partial {y}^{\prime}}{\eta}^{\prime}(x).$$ |

Recall that $\frac{\mathrm{d}I}{\mathrm{d}\u03f5}=0$ when $\u03f5=0$. Since ${Y}_{0}=Y$ and ${Y}_{0}^{\prime}={Y}^{\prime}$,

$$0={\int}_{a}^{b}\frac{\partial F}{\partial y}(x,Y,{Y}^{\prime})\eta (x)+\frac{\partial F}{\partial {y}^{\prime}}(x,Y,{Y}^{\prime}){\eta}^{\prime}(x)\mathrm{d}x.$$ | (2) |

Integrating the second term in (2) by parts

$${\int}_{a}^{b}\frac{\partial F}{\partial {y}^{\prime}}{\eta}^{\prime}(x)dx={\left[\frac{\partial F}{\partial {y}^{\prime}}\eta (x)\right]}_{a}^{b}-{\int}_{a}^{b}\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{\partial F}{\partial {y}^{\prime}}\right)\eta (x)dx.$$ |

The first term on the right hand side vanishes because $\eta (a)=\eta (b)=0$. Substituting the second term into (2),

$${\int}_{a}^{b}\left(\frac{\partial F}{\partial y}-\frac{\mathrm{d}}{\mathrm{d}x}\frac{\partial F}{\partial {y}^{\prime}}\right)\eta (x)dx=0.$$ |

The equation above holds for any $\eta (x)\in {C}^{2}[a,b]$ satisfying $\eta (a)=\eta (b)=0$, so the fundamental lemma of calculus of variations (explained on the next page) tells us that $Y(x)$ satisfies

$$\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{\partial F}{\partial {y}^{\prime}}\right)-\frac{\partial F}{\partial y}=0.\mathit{\u220e}$$ |

###### Definition 4.

A solution of the Euler-Lagrange equation is called an
extremal of the functional.^{2}^{2}
2
Don’t confuse this with
‘extremum’. The terminology is
standard, e.g. Gelfand and Fomin p.15, but can be confusing.

###### Exercise 1.

Find an extremal $y\mathit{}\mathrm{(}x\mathrm{)}$ of the functional

$$I(y)={\int}_{0}^{1}{({y}^{\prime}-y)}^{2}\mathrm{d}x,y(0)=0,y(1)=2,[\mathit{\text{Answer:}}y(x)=2\frac{\mathrm{sinh}x}{\mathrm{sinh}1}].$$ |

###### Exercise 2.

By considering $y\mathrm{+}g$, where $y$ is the solution from exercise 1 and $g\mathit{}\mathrm{(}x\mathrm{)}$ is a variation in $y\mathit{}\mathrm{(}x\mathrm{)}$ satisfying $g\mathit{}\mathrm{(}\mathrm{0}\mathrm{)}\mathrm{=}g\mathit{}\mathrm{(}\mathrm{1}\mathrm{)}\mathrm{=}\mathrm{0}$, and then considering $I\mathit{}\mathrm{(}y\mathrm{+}g\mathrm{)}$, show explicitly that $y\mathit{}\mathrm{(}x\mathrm{)}$ minimizes $I\mathit{}\mathrm{(}y\mathrm{)}$ in Exercise 1 above. (Hint: use integration by parts, and the Euler–Lagrange equation satisfied by $y\mathit{}\mathrm{(}x\mathrm{)}$ to simplify the expression for $I\mathit{}\mathrm{(}y\mathrm{+}g\mathrm{)}$).

###### Exercise 3.

Prove that the straight line $y\mathrm{=}x$ is the curve giving the shortest distance between the points $\mathrm{(}\mathrm{0}\mathrm{,}\mathrm{0}\mathrm{)}$ and $\mathrm{(}\mathrm{1}\mathrm{,}\mathrm{1}\mathrm{)}$.

###### Exercise 4.

Find an extremal function of

$$I[y]={\int}_{1}^{2}{x}^{2}{({y}^{\prime})}^{2}+y\mathrm{d}x,y(1)=1,y(2)=1,[\mathit{\text{Answer:}}y(x)=\frac{1}{2}\mathrm{ln}x+\frac{\mathrm{ln}2}{x}+1-\mathrm{ln}2].$$ |

## MATH0043 Handout: Fundamental lemma of the calculus of variations

In the proof of the Euler-Lagrange equation, the final step invokes a lemma known as the fundamental lemma of the calculus of variations (FLCV).

###### Lemma 1.

(FLCV). Let $y\mathit{}\mathrm{(}x\mathrm{)}$ be continuous on $\mathrm{[}a\mathrm{,}b\mathrm{]}$, and suppose that for all $\eta \mathit{}\mathrm{(}x\mathrm{)}\mathrm{\in}{C}^{\mathrm{2}}\mathit{}\mathrm{[}a\mathrm{,}b\mathrm{]}$ such that $\eta \mathit{}\mathrm{(}a\mathrm{)}\mathrm{=}\eta \mathit{}\mathrm{(}b\mathrm{)}\mathrm{=}\mathrm{0}$ we have

$${\int}_{a}^{b}y(x)\eta (x)dx=0.$$ |

Then $y\mathit{}\mathrm{(}x\mathrm{)}\mathrm{=}\mathrm{0}$ for all $a\mathrm{\le}x\mathrm{\le}b$.

Here is a sketch of the proof. Suppose, for a contradiction, that for some $$ we have $y(\alpha )>0$ (the case when $\alpha =a$ or $\alpha =b$ can be done similarly, but let’s keep it simple). Because $y$ is continuous, $y(x)>0$ for all $x$ in some interval $({\alpha}_{0},{\alpha}_{1})$ containing $\alpha $.

Consider the function $\eta :[a,b]\to \mathbb{R}$ defined by

$$ |

$\eta $ is in ${C}^{2}[a,b]$ — it’s difficult to give a formal proof without using a formal definition of continuity and differentiability, but hopefully the following plot shows what is going on:

By hypothesis, ${\int}_{0}^{1}y(x)\eta (x)dx=0$. But $y(x)\eta (x)$ is continuous, zero outside $({\alpha}_{0},{\alpha}_{1})$, and strictly positive for all $x\in ({\alpha}_{0},{\alpha}_{1})$. A strictly positive continuous function on an interval like this has a strictly positive integral, so this is a contradiction. Similarly we can show $y(x)$ never takes values $$, so it is zero everywhere on $[a,b]$.

## 4 The Brachistochrone

A classic example of the calculus of variations is to find the brachistochrone, defined as that smooth curve joining two points A and B (not underneath one another) along which a particle will slide from A to B under gravity in the fastest possible time.

Using the coordinate system illustrated, we can use conservation of energy to obtain the velocity $v$ of the particle as it makes its descent

$$\frac{1}{2}m{v}^{2}=mgx$$ |

so that

$$v=\sqrt{2gx}.$$ |

Noting also that distance $s$ along the curve $s$ satisfies $d{s}^{2}=d{x}^{2}+d{y}^{2}$, we can express the time $T(y)$ taken for the particle to descend along the curve $y=y(x)$ as a functional:

$$T(y)={\int}_{A}^{B}\mathit{d}t={\int}_{A}^{B}\frac{ds}{ds/dt}={\int}_{A}^{B}\frac{ds}{v}={\int}_{0}^{h}\frac{\sqrt{1+{({y}^{\prime})}^{2}}}{\sqrt{2gx}}dx,\text{subject to}y(0)=0,y(h)=a.$$ |

The brachistochrone is an extremal of this functional, and so it satisfies the Euler-Lagrange equation

$$\frac{d}{dx}\left(\frac{{y}^{\prime}}{\sqrt{2gx(1+{({y}^{\prime})}^{2})}}\right)=0,y(0)=0,y(h)=a.$$ |

Integrating this, we get

$$\frac{{y}^{\prime}}{\sqrt{2gx(1+{({y}^{\prime})}^{2})}}=c$$ |

where $c$ is a constant, and rearranging

$${y}^{\prime}=\frac{dy}{dx}=\frac{\sqrt{x}}{\sqrt{\alpha -x}},\text{with}\alpha =\frac{1}{2g{c}^{2}}.$$ |

We can integrate this equation using the substitution $x=\alpha {\mathrm{sin}}^{2}\theta $ to obtain

$$y=\int \frac{\sqrt{x}}{\sqrt{\alpha -x}}dx=\int \frac{\mathrm{sin}\theta}{\mathrm{cos}\theta}\mathrm{\hspace{0.33em}2}\alpha \mathrm{sin}\theta \mathrm{cos}\theta d\theta =\int \alpha (1-\mathrm{cos}2\theta )\mathit{d}\theta =\frac{\alpha}{2}(2\theta -\mathrm{sin}2\theta )+k.$$ |

Substituting back for $x$, and using $y(0)=0$ to set $k=0$, we obtain

$$y(x)=\alpha {\mathrm{sin}}^{-1}\left(\sqrt{\frac{x}{\alpha}}\right)-\sqrt{x}\sqrt{\alpha -x}.$$ |

###### Definition 5.

This curve is called a cycloid.

The constant $\alpha $ is determined implicitly by the remaining boundary condition $y(h)=a$. The equation of the cycloid is often given in the following parametric form (which can be obtained from the substitution in the integral)

$x(\theta )$ | $=$ | $\frac{\alpha}{2}}(1-\mathrm{cos}2\theta )$ | ||

$y(\theta )$ | $=$ | $\frac{\alpha}{2}}(2\theta -\mathrm{sin}2\theta )$ |

and can be constructed by following the locus of the initial point of contact when a circle of radius $\alpha /2$ is rolled (an angle $2\theta $) along a straight line.

## 5 Functionals leading to special cases

When the integrand $F$ of the functional in our typical calculus of variations problem does not depend explicitly on $x$, for example if

$$I(y)={\int}_{0}^{1}{({y}^{\prime}-y)}^{2}dx,$$ |

extremals satisfy an equation called the Beltrami identity which can be easier to solve than the Euler–Lagrange equation.

###### Theorem 2.

If $I\mathit{}\mathrm{(}Y\mathrm{)}$ is an extremum of the functional

$$I={\int}_{a}^{b}F(y,{y}^{\prime})dx$$ |

defined on all functions $y\mathrm{\in}{C}^{\mathrm{2}}\mathit{}\mathrm{[}a\mathrm{,}b\mathrm{]}$ such that $y\mathit{}\mathrm{(}a\mathrm{)}\mathrm{=}A\mathrm{,}y\mathit{}\mathrm{(}b\mathrm{)}\mathrm{=}B$ then $Y\mathit{}\mathrm{(}x\mathrm{)}$ satisfies

$$F-{y}^{\prime}\frac{\partial F}{\partial {y}^{\prime}}=C$$ | (3) |

for some constant $C$.

###### Definition 6.

(3) is called the Beltrami identity or Beltrami equation.

###### Proof.

Consider

$$\frac{\mathrm{d}}{\mathrm{d}x}\left(F-{y}^{\prime}\frac{\partial F}{\partial {y}^{\prime}}\right)=\frac{\mathrm{d}F}{\mathrm{d}x}-y^{\prime}{}^{\prime}\frac{\partial F}{\partial {y}^{\prime}}-{y}^{\prime}\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{\partial F}{\partial {y}^{\prime}}\right).$$ | (4) |

Using the chain rule to find the $x$-derivative of $F(y(x),{y}^{\prime}(x))$ gives

$$\frac{\mathrm{d}F}{\mathrm{d}x}={y}^{\prime}\frac{\partial F}{\partial y}+y^{\prime}{}^{\prime}\frac{\partial F}{\partial {y}^{\prime}}$$ |

so that (4) is equal to

$${y}^{\prime}\frac{\partial F}{\partial y}+y\prime \prime \frac{\partial F}{\partial {y}^{\prime}}-{y}^{\prime \prime}\frac{\partial F}{\partial {y}^{\prime}}-{y}^{\prime}\frac{\mathrm{d}}{\mathrm{d}x}\frac{\partial F}{\partial {y}^{\prime}}={y}^{\prime}(\frac{\partial F}{\partial y}-\frac{\mathrm{d}}{\mathrm{d}x}\frac{\partial F}{\partial {y}^{\prime}})$$ |

Since $Y$ is an extremal, it is a solution of the Euler–Lagrange equation and so this is zero for $y=Y$. If something has zero derivative it is a constant, so $Y$ is a solution of

$$F-{y}^{\prime}\frac{\partial F}{\partial {y}^{\prime}}=C$$ |

for some constant $C$. ∎

###### Exercise 5.

(Exercise 1 revisited): Use the Beltrami identity to find an extremal of

$$I(y)={\int}_{0}^{1}{({y}^{\prime}-y)}^{2}dx,y(0)=0,y(1)=2,$$ |

Answer:

$$y=f(x)=2\frac{\mathrm{sinh}x}{\mathrm{sinh}1}$$ |

(again).

## 6 Isoperimetric Problems

So far we have dealt with boundary conditions of the form
$y(a)=A,y(b)=B$ or $y(a)=A,{y}^{\prime}(b)=B$. For some problems the natural
boundary conditions are expressed using an integral. The standard
example is
Dido’s
problem^{3}^{3}
3
See
Blåsjö
- The
Isoperimetric Problem for the history.: if you have a piece of rope with a
fixed length, what shape should you make with it in order to enclose the
largest possible area? Here we are trying to choose a function $y$
to maximise an integral $I(y)$ giving the area enclosed by $y$, but the
fixed length constraint is also expressed in terms of an integral
involving $y$. This kind of problem, where we seek an extremal of some
function subject to ‘ordinary’ boundary conditions and also an integral
constraint, is called an isoperimetric problem.

A typical isoperimetric problem is to find an extremum of

$$I(y)={\int}_{a}^{b}F(x,y,{y}^{\prime})dx,\text{subject to}y(a)=A,y(b)=B,J(y)={\int}_{a}^{b}G(x,y,{y}^{\prime})dx=L.$$ |

The condition $J(y)=L$ is called the integral constraint.

###### Theorem 3.

In the notation above, if $I\mathit{}\mathrm{(}Y\mathrm{)}$ is an extremum of $I$ subject to $J\mathit{}\mathrm{(}y\mathrm{)}\mathrm{=}L$, then $Y$ is an extremal of

$$K(y)={\int}_{a}^{b}F(x,y,{y}^{\prime})+\lambda G(x,y,{y}^{\prime})\mathrm{d}x$$ |

for some constant $\lambda $.

You will need to know about Lagrange multipliers to understand this proof: see the handout on moodle (the constant $\lambda $ will turn out to be a Lagrange multiplier).

###### Proof.

Suppose $I(Y)$ is a maximum or minimum subject to $J(y)=L$, and consider the two-parameter family of functions given by

$$Y(x)+\u03f5\eta (x)+\delta \zeta (x)$$ |

where $\u03f5$ and $\delta $ are constants and $\eta (x)$ and $\zeta (x)$ are twice differentiable functions such that $\eta (a)=\zeta (a)=\eta (b)=\zeta (b)=0$, with $\zeta $ chosen so that $Y+\u03f5\eta +\delta \zeta $ obeys the integral constraint.

Consider the functions of two variables

$$I[\u03f5,\delta ]={\int}_{a}^{b}F(x,Y+\u03f5\eta +\delta \zeta ,{Y}^{\prime}+\u03f5{\eta}^{\prime}+\delta {\zeta}^{\prime})dx,J[\u03f5,\delta ]={\int}_{a}^{b}G(x,Y+\u03f5\eta +\delta \zeta ,{Y}^{\prime}+\u03f5{\eta}^{\prime}+\delta {\zeta}^{\prime})dx.$$ |

Because $I$ has a maximum or minimum at $Y(x)$ subject to $J=L$, at the point $(\u03f5,\delta )$=$(0,0)$ our function $I[\u03f5,\delta ]$ takes an extreme value subject to $J[\u03f5,\delta ]=L$.

It follows from the theory of Lagrange multipliers that a necessary condition for a function $I[\u03f5,\delta ]$ of two variables subject to a constraint $J[\u03f5,\delta ]=L$ to take an extreme value at $(0,0)$ is that there is a constant $\lambda $ (called the Lagrange multiplier) such that

$\frac{\partial I}{\partial \u03f5}}+\lambda {\displaystyle \frac{\partial J}{\partial \u03f5}$ | $=0$ | ||

$\frac{\partial I}{\partial \delta}}+\lambda {\displaystyle \frac{\partial J}{\partial \delta}$ | $=0$ |

at the point $\u03f5=\delta =0$. Calculating the $\u03f5$ derivative,

$\frac{\partial I}{\partial \u03f5}}[\u03f5,\delta ]+\lambda {\displaystyle \frac{\partial J}{\partial \u03f5}}[\u03f5,\delta ]$ | $=$ | ${\int}_{a}^{b}}{\displaystyle \frac{\partial}{\partial \u03f5}}\left(F(x,Y+\u03f5\eta +\delta \zeta ,{Y}^{\prime}+\u03f5{\eta}^{\prime}+\delta {\zeta}^{\prime})+\lambda G(x,Y+\u03f5\eta +\delta \zeta ,{Y}^{\prime}+\u03f5{\eta}^{\prime}+\delta {\zeta}^{\prime})\right)dx$ | ||

$=$ | ${\int}_{a}^{b}}\eta {\displaystyle \frac{\partial}{\partial y}}\left(F+\lambda G\right)+{\eta}^{\prime}{\displaystyle \frac{\partial}{\partial {y}^{\prime}}}\left(F+\lambda G\right)\mathrm{d}x\mathit{\hspace{1em}\hspace{1em}\hspace{1em}\hspace{1em}\hspace{0.5em}\hspace{1em}}\text{(chain rule)$ | |||

$=$ | ${\int}_{a}^{b}}\eta \left({\displaystyle \frac{\partial}{\partial y}}\left(F+\lambda G\right)-{\displaystyle \frac{\mathrm{d}}{\mathrm{d}x}}\left({\displaystyle \frac{\partial}{\partial {y}^{\prime}}}\left(F+\lambda G\right)\right)\right)dx\mathit{\hspace{1em}\hspace{0.25em}}\text{(integration by parts)$ | |||

$=$ | $0\mathit{\hspace{1em}\hspace{0.5em}}\text{when}\u03f5=\delta =0\text{, no matter what}\eta \text{is.}$ |

Since this holds for any $\eta $, by the FLCV (Lemma 1) we get

$$({F}_{y}+\lambda {G}_{y})(x,Y,{Y}^{\prime})+\frac{\mathrm{d}}{\mathrm{d}x}({F}_{{y}^{\prime}}+\lambda {G}_{{y}^{\prime}})(x,Y,{Y}^{\prime})=0$$ |

which says that $Y$ is a solution of the Euler–Lagrange equation for $K$, as required. ∎

Note that to complete the solution of the problem, the initially unknown multiplier $\lambda $ must be determined at the end using the constraint $J(y)=L$.

###### Exercise 6.

Find an extremal of the functional

$$I(y)={\int}_{0}^{1}{({y}^{\prime})}^{2}dx,y(0)=y(1)=1,$$ |

subject to the constraint that

$$J(y)={\int}_{0}^{1}y\mathrm{d}x=2.\mathit{\hspace{1em}\hspace{0.25em}}[\mathit{\text{Answer:}}y=f(x)=-6{(x-\frac{1}{2})}^{2}+\frac{5}{2}.]$$ |

###### Exercise 7.

(Sheep pen design problem): A fence of length $l$ must be attached to a straight wall at points A and B (a distance $a$ apart, where $$) to form an enclosure. Show that the shape of the fence that maximizes the area enclosed is the arc of a circle, and write down (but do not try to solve) the equations that determine the circle’s radius and the location of its centre in terms of $a$ and $l$.

## Suggested reading

There are many introductory textbooks on the calculus of variations, but most of them go into far more mathematical detail that is required for MATH0043. If you’d like to know more of the theory, Gelfand and Fomin’s Calculus of Variations is available in the library. A less technical source is chapter 9 of Boas Mathematical Methods in the Physical Sciences. There are many short introductions to calculus of variations on the web, e.g.

- •
- •
- •

although all go into far more detail than we need in MATH0043. Lastly, as well as the moodle handout you may find

- •

useful as a refresher on Lagrange multipliers.