You are on page 1of 7

Calculus of Variations

Lagrangian formalism is the main tool of theoretical classical mechanics. Calculus of Variations is a
part of Mathematics which Lagrangian formalism is based on. In this section, we discuss the basics
of the Calculus of Variations and, in particular, consider some simple applications. This will provide
us with the mathematical language necessary for formulating the Lagrangian Mechanics.
The key object of the Calculus of Variations is a functional, a real-valued function dened on some
class of functions. That is the argument of a functional is a function of one or many variables. The
functional assigns a real value to a function of the given class. Typically, one deals with functionals
of the form
F[f] =
_
x
b
x
a
g(f, f
x
, x) dx , (1)
where f(x) is any function of a given class, f
x
f

(x) is its derivative, and g is a given function of


three variables. Apart from being dierentiable, the functions of the given class can be subject to
some constraint. Say,
f(x
a
) = y
a
, f(x
b
) = y
b
. (2)
The denition of functional is straightforwardly generalized to the cases of more than one function f,
more than one variable x, and higher-order (partial) derivatives.
Example 1. Length of a line in a plane. Suppose we have a smooth line in the xy-plane passing through
the two given points (x
a
, y
a
) and (x
b
, y
b
). The line is supposed to be specied by the equation
y = f(x) . (3)
The length of the line is a functional of f. Let us make sure that it can be represented in the form
(1). We have
l[f] =
_
dl =
_
_
(dx)
2
+ (dy)
2
=
_
_
(dx)
2
+ (f
x
dx)
2
=
_
x
b
x
a
_
1 + (f
x
)
2
dx . (4)
We see that l[f] has the form (1) with
g(f, f
x
, x) =
_
1 + (f
x
)
2
. (5)
Note that in this example the function g does not depend explicitly on f and x.
Example 2. Potential energy of a exible cable suspended from two xed points. The cable is supposed
to be at rest. Choose the y axis perpendicular to the surface of the Earth, the cable being represented
by a curve (9) the xy plane, with the constraint (2). Then its potential energy is given by (we do not
care about the units, and thus neglect the dimensional proportionality coecient)
U[f] =
_
y dl =
_
x
b
xa
f
_
1 + (f
x
)
2
dx . (6)
(The potential energy of the element dl is proportional to its hight y and its length dl.) We see that
l[f] has the form (1) with
g(f, f
x
, x) = f
_
1 + (f
x
)
2
. (7)
Here the function g explicitly depends on f and f
x
, but not on x.
1
Example 3. Length of a line in a surface. Suppose we have a smooth line L in the surface S, passing
through the two given points (x
a
, y
a
, z
a
) and (x
b
, y
b
, z
b
). Let the surface S and the line L be specied
by the equations
z = s(x, y) , (8)
y = f(x) , z = s(x, f(x)) , (9)
respectively. Let us show that the length of the line is a functional of the form (1). First we introduce
convenient notation
s
x
=
s(x, y)
x
, s
y
=
s(x, y)
y
, (10)
and note that
dy = f
x
dx , dz = s
x
dx + s
y
dy = s
x
dx + s
y
f
x
dx . (11)
Then,
l[f] =
_
dl =
_
_
(dx)
2
+ (dy)
2
+ (dz)
2
=
_
x
b
xa
g(f, f
x
, x) dx , (12)
where
g(f, f
x
, x) =
_
1 + f
2
x
+ (s
x
(x, f) + s
y
(x, f) f
x
)
2
. (13)
A typical problem which arises in connection with a functional F[f] is the problem of nding such
a function f that minimizes the functional. In the context of above examples, this problem comes
from natural questions like: What is the shortest distance between two points in a given surface?
What is the shape of the suspended cable (corresponding to the minimum of the potential energy at a
given length)? Calculus of Variations provides mathematical tools for solving the problem. Suppose
the function f is a (local) minimum/maximum of the functional F. Then, for any small variation
of the function f variation of the functional is supposed to be sign-denite. Let us see what are the
implications of this fact. We introduce the symbol f(x) for an innitesimal variation of the function
f and the symbol F for corresponding variation of the functional F. That is
F = F[f + f] F[f] . (14)
With a simple observation that
f f + f f
x
f
x
+ (f)

(15)
we write
F =
_
x
b
xa
g( f + f, f
x
+ (f)

, x) dx
_
x
b
xa
g(f, f
x
, x) dx . (16)
Then we take into account the smallness of f:
g( f + f, f
x
+ (f)

, x) g(f, f
x
, x) +
g
f
f +
g
f
x
(f)

. (17)
F =
_
x
b
x
a
g
f
f dx +
_
x
b
x
a
g
f
x
(f)

dx . (18)
Doing by parts the second integral, with Eq. (2) taken into account [meaning f(x
a
) = f(x
b
) = 0 ],
we have
_
x
b
xa
g
f
x
(f)

dx =
_
x
b
xa
dx(f)
d
dx
g
f
x
. (19)
That is
F =
_
x
b
xa
A(x) f dx , (20)
2
where
A(x) =
g
f

d
dx
g
f
x
. (21)
We see that the variation F is a linear functional of f. The linearity means that the sign of F
changes if f f. On the other hand, the condition of minimum/maximum requires that the
sign of variation do not change. This is only possible if A(x) 0, and we arrive at the celebrated
Eulers equation, the fundamental equation of the Calculus of Variations:
g
f

d
dx
g
f
x
= 0 . (22)
As an easy example, let us make sure that the shortest distance between two points is a straight line.
Applying Eq. (22) to the function g of the Example 1, see Eq. (5), we readily get
f

(x) = 0 f(x) = C
1
x + C
2
, (23)
where C
1
and C
2
are some constants. And this is the equation of a straight line. The constants are
xed by the boundary conditions (2).
Alternate form of Eulers equation
If f
x
= 0, then Euler equation is equivalent to
g
x

d
dx
_
g f
x
g
f
x
_
= 0 . (24)
Indeed, by the chain rule we have
dg
dx
=
g
f
f
x
+
g
f
x
f
xx
+
g
x
. (25)
Taking into account that
d
dx
f
x
g
f
x
= f
xx
g
f
x
+ f
x
d
dx
g
f
x
, (26)
we then get
d
dx
_
g f
x
g
f
x
_
=
g
x
+ f
x
_
g
f

d
dx
g
f
x
_
. (27)
This means that Eq. (24) is equivalent to
f
x
_
g
f

d
dx
g
f
x
_
= 0 , (28)
which, in its turn, is equivalent to the original Eulers equation (22) if f
x
= 0. To put it dierent, any
solution of Eq. (22) is simultaneously a solution of Eq. (24), but, in contrast to Eq. (22), equation
(24) has also a trivial solution f = const.
Now if g = g(f, f
x
), that is g does not depend explicitly on x, Eq. (24) simplies to
d
dx
_
g f
x
g
f
x
_
= 0 , (29)
and immediately yields the rst integral
g f
x
g
f
x
= const . (30)
3
Soap lm. The equilibrium shape of a soap lm corresponds to a (local) minimum of its surface
energy. The latter is just proportional to the surface area. Hence, to nd the equilibrium shape of
a soap lm one has to nd the (local) minimum of the surface area under the appropriate boundary
conditions. Consider simplest example when the lm is axially symmetric being stretched between
two parallel coaxial wire circles. Let the center of the rst circle be at x = 0 and the center of the
second circle be at x = h; the two radii being R
a
and R
b
, respectively; x being the symmetry axis.
The surface is parameterized by the radius r at a given x:
r = f(x) , f(0) = R
a
, f(h) = R
b
. (31)
The surface area, A, is then a functional of f:
A[f] =
_
2r dl =
_
2r
_
(dx)
2
+ (dr)
2
= 2
_
h
0
f
_
1 + f
2
x
dx . (32)
We see that
g = 2 f
_
1 + f
2
x
(33)
does not depend explicitly on x and we can use the Euler equation in the form of its rst integral
(30). This yields
f
_
1 + f
2
x

ff
2
x
_
1 + f
2
x
= C
0
, (34)
where C
0
is a constant. A simple algebra then leads to
f = C
0
_
1 + f
2
x
f
2
= C
2
0
(1 + f
2
x
) f
x
=
_
(f/C
0
)
2
1 . (35)
We get a simple dierential equation and easily solve it:
df
dx
=
_
(f/C
0
)
2
1 . (36)
_
df
_
(f/C
0
)
2
1
=
_
dx . (37)
C
0
cosh
1
(f/C
0
) = x + const . (38)
f(x) = C
0
cosh
_
x x
0
C
0
_
. (39)
Note that the sign is absorbed by the constant x
0
. The solution (39) has two free constants which
are xed by two boundary conditions:
_
cosh(x
0
/C
0
) = R
a
/C
0
,
cosh((h x
0
)/C
0
) = R
b
/C
0
.
(40)
4
Functional of many functions
The generalization of the theory to the case of more than one function, f f
(1)
, f
(2)
, . . . , f
(m)
, is
quite straightforward. Now we have
F[f
(1)
, f
(2)
, . . . , f
(m)
] =
_
x
b
xa
g(f
(1)
, f
(2)
, . . . , f
(m)
, f
(1)
x
, f
(2)
x
, . . . , f
(m)
x
, x) dx , (41)
f
(j)
(x
a
) = y
(j)
a
, f
(j)
(x
b
) = y
(j)
b
(j = 1, 2, . . . , m) . (42)
Introducing the variations
f
(j)
f
(j)
+ f
(j)
, (43)
and evaluating F, we get
F =
m

j=1
_
x
b
x
a
A
j
(x) f
(j)
dx , (44)
A
j
(x) =
g
f
(j)

d
dx
g
f
(j)
x
. (45)
Now if we are looking for minimum/maximum of the functional F, then by denition we have F 0
for a minimum, or F 0 for a maximum. But this is only possible if
A
j
(x) 0 (j = 1, 2, . . . , m) . (46)
Indeed, if for some j = j
0
we had A
j
0
(x) = 0, then we could set f
(j)
0 for all js but j
0
and write
F =
_
x
b
x
a
A
j
0
(x) f
(j
0
)
dx . (47)
And then we just repeat the reasoning we used to prove A(x) 0 in the case of just one function.
Hence, for a set of functions {f
(1)
, f
(2)
, . . . , f
(m)
} to correspond to a minimum/maximum of the
functional (41) the following Eulers equations have to be satised:
g
f
(j)

d
dx
g
f
(j)
x
= 0 (j = 1, 2, . . . , m) . (48)
This system of m dierential equations denes the functions {f
(1)
, f
(2)
, . . . , f
(m)
} up to 2m free
constants. The constants are then xed by the boundary conditions (42).
Important Theorem
What is the generalization, if any, of the alternative Eulers equation (24) for the case of many
functions? In the case of m functions, we cannot replace the whole system of m equations (48)
with alternative ones, equivalent to (24). The generalization of Eq. (24) comes in the form of a
theorem that may seem too abstract, but actually is extremely important being directly relevant to
the conservation of energy in Lagrangian mechanics. Consider the quantity (we use the same letter
we use for energy, and do it on purpose)
E(f
(1)
(x), . . . , f
(m)
(x), f
(1)
x
(x), . . . , f
(m)
x
(x), x) =
m

j=1
f
(j)
x
g
f
(j)
x
g . (49)
5
The theorem says that if the functions {f
(1)
, f
(2)
, . . . , f
(m)
} minimize/maximise the functional (41),
then for the quantity E(f
(1)
(x), . . . , f
(m)
(x), f
(1)
x
(x), . . . , f
(m)
x
(x), x) the following relation takes
place
dE
dx
=
g
x
. (50)
In particular, if the function g does not explicitly depend on x, then the right-hand side is zero and
the quantity E is just a constant.
The proof is a straightforward generalization of Eqs. (25)-(27):
d
dx
m

j=1
f
(j)
x
g
f
(j)
x
=
m

j=1
f
(j)
xx
g
f
(j)
x
+
m

j=1
f
(j)
x
d
dx
g
f
(j)
x
. (51)
dg
dx
=
m

j=1
g
f
(j)
f
(j)
x
+
m

j=1
g
f
(j)
x
f
(j)
xx
+
g
x
. (52)
Hence,
dE
dx
=
g
x
+
m

j=1
f
(j)
x
_
d
dx
g
f
(j)
x

g
f
(j)
_
. (53)
So far we did just identical transformations. Now we take into account that the functions
{f
(1)
, f
(2)
, . . . , f
(m)
} minimize/maximise the functional (41) and are supposed thus to satisfy Eulers
equations (48). Eqs. (48) state that each term in the brackets in the r.h.s. of (53) is identically equal
to zero, which completes the proof.
Lagrange Multipliers
Let us recall the problem of the exible cable (Example 2). This problem involves an extra feature,
a constraint that the total length of the curve be xed. To solve problems like that we have to un-
derstand how to treat the constraints. Actually, the idea is the same as in the calculus of functions:
one can use Lagrange multipliers.
Suppose we want to nd an extremum of the functional (1) on the set of functions subject to the
boundary conditions (2) and also the constraint that
Q[f] = C , (54)
where C is a given constant and
Q[f] =
_
x
b
x
a
q(f, f
x
, x) dx (55)
is a given functional. (In our Example 2, Q[f] is the length of the curve.)
Consider a new functional

F[f] = F[f] Q[f] , (56)


where is a xed real number. Under the constraint (54), an extremum of the functional F is
simultaneously an extremum of the functional

F, and vice versa, since the two dier by the xed
constant C. Now consider a genuine (i.e. unconstrained) extremum of the functional (56). At an
arbitrary , this genuine extremum is not supposed to have anything to do with the extremum under
the constraint. However, normally their exists a special choice of =

at which the function f


()
,
the genuine extremum of the functional (56), just satises the condition
Q[f
(

)
] = C . (57)
6
Clearly, the function f
()
is the solution to the original problem, since the genuine extremum auto-
matically implies the extremum under given (and satised) constraint. Once we know the value of

, the problem is solved. And to nd

we simply solve the problem of the genuine extremum of


the functional (56) with an arbitrary (undened) , and then a posteriori x the proper value =

by requiring that the condition (57) be satised.


Solution to the problem of the exible cable. We have (see Example 2)
g(f, f
x
, x) = f
_
1 + (f
x
)
2
, (58)
q(f, f
x
, x) =
_
1 + (f
x
)
2
. (59)
Hence,

F[f] =
_
x
b
x
a
[g(f, f
x
, x) q(f, f
x
, x)] dx =
_
x
b
x
a
(f )
_
1 + (f
x
)
2
dx . (60)
With this particular form of the functional

F it is very convenient to introduce the new function

f = f , (61)
because then we will have

F[

f] =
_
x
b
x
a

f
_
1 + (

f
x
)
2
dx , (62)
which is (up to a numeric factor) is the functional which we have minimized already in the context
of the problem of the soap lm. We just write the answer, Eq. (39):

f(x) = C
0
cosh
_
x x
0
C
0
_
f(x) = C
0
cosh
_
x x
0
C
0
_
+ . (63)
The values of the three constants, C
0
, x
0
, , should be chosen to satisfy two boundary conditions,
Eq. (2), and the constraint that the total length of the curve is equal to a given value l.
7

You might also like