You are on page 1of 17

Chapter 5

Calculus of Variations

Chapter contents:

The Euler-Lagrange Equation

Systems of Several Variables

Hamilton’s Principle

1
The Euler-Lagrange Equation
We have derived the Lagrange’s equations from D’Alembert principle.
It is also possible to derive it from a “variational principle”.
The mathematical language needed to provide the framework is called
the calculus of variations (or variational calculus), which involves
finding the minimum or maximum (or stationary values) of a quantity
that is expressible as an integral.

As an example, let us consider finding


the shortest path between two points
on a plane.

Question: Given two fixed points (x1, y1)


and (x2, y2). What is the shortest path
y(x) between them?
2
Consider a short segment of the curve. Its path
length is given by (as dx, dy → 0):
2 2 2 dy
ds= √ dx +dy = √ 1+ y ' (x) dx y ' (x)≡
dx

The total path length is given by


x2 x2

l= ∫ ds=∫ √ 1+ y ' ( x ) dx
2

x1 x1

Our task is to find the function y(x) such that the length l is minimum.
How to determine such a function y(x)? We need to find y(x) so that the
integral is minimized.

In elementary calculus, for a given function f(x), a point x0 is called a


stationary point of the function if its derivative f '(x0) at that point vanishes:
f ' (x 0)=0
3
Let us now formulate the problem in a general setting. Suppose we are
given a known function F[y(x), y’(x), x] of an unknown curve y(x) and
its first derivative y’(x). Here x is independent variable and y(x) is
dependent variable with respect to x. But (y, y’) will be treated as
independent variables in F. The yet unknown function y(x) is assumed
to pass through two fixed points:
y ( x1 )= y 1 ; y (x 2 )= y 2
x2
Define: I [ y ]≡∫ F [ y ( x) , y ' ( x), x] dx
x1

I[y] is a functional of y (i.e., it is a function of function!)

Our task: Find the curve y(x) which makes the integral I[y] an extremum
(also called stationary)

4
To say that I[y] is an extremum means that it is either a minimum or
maximum for a unique curve y(x). A small variation in this curve can
only produce second-order variation in the integral.

Consider small variations in y(x) and y’(x) at a fixed value of x:


δ y ( x)
d
δ ( y ' ( x)) = (δ y)
dx
Variation of the path Variation of x along
a given path
(Note: The two variations are independent and thus they “commute”)

The two end points (x1, y1) and (x2, y2) are fixed: δ y ( x1 )=δ y ( x2 )=0

Change in I[y] due to the variation of the path:


δ I ≡I [ y+δ y ]−I [ y ]
x2 x2

=∫ F [ y +δ y , y ' +δ y ' , x] dx−∫ F [ y , y ' , x] dx


5
x1 x1
Side note:
Taylor expansion of a function of two variables F(u, v) around (u0, v0)

∂F ∂F
F (u , v)=F (u 0 , v 0 )+
∂u ] u0 , v 0
(u−u 0 )+
∂v ]u0 , v 0
(v−v 0 )+... .

Higher order terms neglected


x2 x2
∂F ∂F
δ I =∫ {
x1
F [ y , y ' , x]+
∂y
δ y+
∂y' x
}
δ y ' +... dx−∫ F [ y , y ' , x ]dx
1
x2
∂F ∂F
=∫ [ δ y+ δ y ' ] dx (we only keep to linear order terms δy and δy’)
x1 ∂y ∂ y'

Consider the 2nd term:


x2 x2 Note: The two variations δ and d/dx are
∂F ∂F d independent, so we have
∫ ∂ y ' δ y ' dx=∫ ∂ y ' dx (δ y )dx δ(dy /dx)=d (δ y)/dx
x 1 x 1

x2 x2
∂F d ∂F
=
∂ y' x
]
δ y −∫
x dx ∂ y '
1
δ y dx
1
( ) (we have used integration by parts)
6
By assumption: δ y ( x 1 )=δ y ( x 2 )=0
x2 x2 x2
∂F ∂F d ∂F
∫∂ y'
x1
δ y ' dx=
∂ y'
δ y
x
−∫ ]
x dx ∂ y '
δ y dx
1 1
( )
=0
x2 x2
∂F ∂F ∂F d ∂F
=> δ I =∫
x1
[ ∂y
δ y+
∂ y'
δ y ' dx=∫
x
]−
∂ y dx ∂ y '
1
[
δ y dx ( )]
If I[y] for the path y(x) is stationary, it means that I does not change for
infinitesimal variations: y(x)+δy(x). That is, δI = 0 for any choice of δy(x)
for which we ignore higher order terms O(δy2):
x2
∂F d ∂F
=> δ I =∫
x1
[ − ( )]
∂ y dx ∂ y '
δ y dx=0 for all δ y ( x)

d ∂F ∂F
( ) −
dx ∂ y ' ∂ y
=0 Euler-Lagrange equation

7
Example: Shortest path between 2 points

Recall: Path length


x2 x2
l=∫ ds= ∫ √ 1+ y ' (x)2 dx
x1 x1

In this case, we have F ( y , y ' , x)= √ 1+ y ' (x)2

=> ∂F y' ∂F
= , =0
∂ y ' √ 1+ y ' 2 ∂y

d y'
Euler-Lagrange equation =>
dx (√ 1+ y '
2 )
=0

y ' (x)= Constant≡m

Solution for y(x): y (x)=mx+b


=> The shortest (or stationary) path between 2 fixed points is a straight
line. 8
Systems of Several Variables
It is straightforward to generalize to the case where F is a function of
N independent variables yk(x) and their derivatives yk’(x):
x2

I ≡∫ F [ y 1 ( x), ... , y N ( x), y1 ' ( x) ,... , y N ' ( x), x ] dx


x1

We want to impose the condition δI = 0 under the assumption that the


two end points are fixed so that
δ y k ( x1 )=δ y k ( x 2 )=0 for k=1, 2, ... , N
Variation of I:
x2

δ I ≡∫ F [ y1 +δ y1 , ... , y N +δ y N , y 1 ' +δ y 1 ' ,... , y N ' +δ y N ' , x] dx


x1
x2

−∫ F [ y 1 , ... , y N , y 1 ' , ... , y N ' , x] dx


9
x1
We preform Taylor expansion and keep only to first-order terms:
x2 x2
∂F ∂F ∂F ∂F
δ I =∫
x1
( ∂ y1
δ y 1+
∂ y1 ' )
δ y 1 ' dx+∫
x ∂ y2
1
(
δ y 2+
∂ y2 '
δ y2 ' dx+....
)
x2
∂F ∂F
....+∫
x1
( ∂ yN
δ yN +
∂ yN '
δ y N ' dx
)
For each integral, we perform integration by parts for the second term
and note that the resulting boundary term vanishes because the end
points are fixed (like what we did for single variable). As a result, we
obtain
x2 x2
∂F d ∂F ∂F d ∂F
δ I =∫
x1 [ −
∂ y 1 dx ∂ y1 '( )]
δ y1 dx + .... + ∫
x1 [ −
( )]
∂ y N dx ∂ y N '
δ y N dx

Since yk(x) are independent, the variations δyk are also independent.
The condition δI = 0 requires that

d ∂F ∂F
( ) −
dx ∂ y k ' ∂ y k
=0 (k=1, 2,... , N )
10
Hamilton’s Principle
It is interesting to note that the Euler-Lagrange equation derived from
the calculus of variation has the same form as the Lagrange’s equation
that we obtained from the D’Alembert principle for mechanics. For a
system of single variable, we have the following correspondence:
d ∂F ∂F d ∂L ∂L
( )
dx ∂ y '

∂y
=0 ( )
dx ∂ q̇

∂q
=0

F ( y , y ' , x) L(q , q̇ , t)
x t
y q
y' q̇
=> We can re-formulate mechanics and derive the Lagrange’s equation
using a variational approach. 11
Definition: Action S[q] S[q] is a functional of q(t)

t2

S [q]≡∫ L(q(t ), q̇(t ),t )dt


t1

Note: We shall generalize to the case of N degree-of-freedom.

Hamilton’s principle: (also known as the principle of stationary action)

The physical path q(t) of a mechanical system between 2 fixed end


points (t1, q(t1)) and (t2, q(t2)) is such that the action S[q] is stationary
(also called extremum):
δ S=0

Following the derivation we worked out before:


d ∂L ∂L
δ S=0 => ( )
dt ∂ q̇

∂q
=0
12
Remark:
If we take the Lagrange’s equation (derived from D’Alembert principle)
as a given result, then we obtain δS = 0 as a consequence. But now we
turn the procedure around and assert that the Hamilton’s principle is a
fundamental postulate, and hence derive the Lagrange’s equation from
it.

13
Side note: δ-notation

As before, a Taylor expansion of δS ≡ S[q+δq] − S[q] gives


t2
∂L ∂L
δ S=∫
t1
[ ∂q
δ q+
∂ q̇ ]
δ q̇ dt As before, we have used
integration by parts and imposed
t1 the conditions δq(t1) = δq(t2) = 0
∂L d ∂L
=∫
t2
[ − ( )]
∂ q dt ∂ q̇
δ q dt

It is convenient to introduce shorthand notation “δ” as follow:


t2 t2
δL
δ S≡∫ δ L dt≡∫
t1 t1
( )
δq
δ q dt

Comparing with the above result gives:


δL ∂L d ∂L
≡ −
δ q ∂ q dt ∂ q̇ ( )
This is known as the variational derivative of L. 14
It is straightforward to generalize to the case of N degrees of freedom.
Let {q1, …, qN} be a set of generalized coordinates and the Lagrangian
is given by
L(q 1 , ... , q N , q̇1 ,... , q̇ N , t)
t2

Action: S≡∫ L(q 1 , ... , q N , q̇ 1 ,... , q̇ N ,t ) dt


t1

t2 N t2 N
Variation of S: δ S=∫
t1
(∑
α=1
δL
δ qα )
δ q α dt=∫
∂L d ∂L

t α=1 ∂ q α
1
[−
dt ∂ q̇α ( )]
δ q α dt

In obtaining the Euler-Lagrange’s equations for several variables {yk}, we


assumed that {yk} are independent. Here, the corresponding condition
connecting to the Hamilton’s principle is that {qα} are independent. This
requires that the constraints are holonomic:
d ∂L ∂L
δ S=0 => ( ) −
dt ∂ q̇ α ∂ q α
=0 (α=1, 2,... , N )
15
Summary:
Hamilton’s principle can be taken as a fundamental postulate (instead of
Newton’s laws) to derive the equations of motion for mechanical systems
if

all forces (except constraint forces) in the system can be derived from a
generalized scalar potential so that a Lagrangian can be defined.
● the constraints are holonomic (i.e., {q } are independent)
α
[Extension to some non-holonomic systems is possible, but we shall not discuss this
issue.]

Advantages of variational formulation:


● The action S is invariant to the choice of {q } used to express the
α
Lagrangian. Hence, the Lagrange’s equations always have the same
form independent of the choice of {qα}.

Variational principle is the route to many different areas of physics.

16
Side note: Non-uniqueness of Lagrangian
We have discussed before that two Lagrangians related by
dF (q ,t) arbitrary function of (q,t)
L ' (q , q̇ , t)≡L(q , q̇ , t)+
dt
are physically equivalent. Here we can see how the same conclusion
is obtained by the variational formulation.
t2

S '≡∫ L ' (q , q̇ ,t )dt


t1
t2 t2
dF
=∫ L(q , q̇ , t )dt +∫ dt =S+ F (q(t 2 ), t 2 )−F (q(t 1 ),t 1 )
t 1 t dt 1

Variation of S′: δ S '=δ S+δ [ F (q(t 2), t 2)−F (q(t 1), t 1 )]


Variations at the fixed end points = 0

Hamilton’s principle: δ S '=δ S=0 => Same equation of motion

Similarly, two Lagrangians different from each other by an additive or17


multiplicative constant are physically equivalent.

You might also like