Calculus of variations
The calculus of variations lays the mathematical groundwork
for Lagrangian mechanics.
Consider a functional , mapping a function to a scalar value
by integrating over the so-called Lagrangian ,
which represents an expression involving , and the derivative :
If in some way measures the physical “cost” (e.g. energy) of
the path taken by a physical system,
the principle of least action states that will be a minimum of ,
so for example the expended energy will be minimized.
In practice, various cost metrics may be used,
so maxima of are also interesting to us.
If is the optimal route, then a slightly
different (and therefore worse) path between the same two points can be expressed
using the parameter :
Where is an arbitrary differentiable deviation.
Since must start and end in the same points as ,
we have the boundary conditions:
Given , the goal is to find an equation for the optimal path .
Just like when finding the minimum of a real function,
the minimum of a functional is a stationary point
with respect to the deviation weight ,
a condition often written as .
In the following, the integration limits have been omitted:
The boundary term from partial integration vanishes due to the boundary
conditions for . We are thus left with:
This holds for all , but is arbitrary, so in fact
only the parenthesized expression matters:
This is known as the Euler-Lagrange equation of the Lagrangian ,
and its solutions represent the optimal paths .
Suppose that the Lagrangian depends on multiple independent functions
In this case, every has its own deviation ,
The derivation procedure is identical to the case from earlier:
Once again, is arbitrary and disappears at the boundaries,
so we end up with equations of the same form as for a single function:
Suppose that the Lagrangian depends on multiple derivatives of :
Once again, the derivation procedure is the same as before:
The goal is to turn each into , so we need to
partially integrate the th term of the sum times. In this case,
we will need some additional boundary conditions for :
This eliminates the boundary terms from partial integration, leaving:
Once again, because is arbitrary, the Euler-Lagrange equation becomes:
Suppose now that is a function of multiple variables.
For brevity, we only consider two variables and ,
but the results generalize effortlessly to larger amounts.
The Lagrangian now depends on all the partial derivatives of :
The arbitrary deviation is then also a function of multiple variables:
The derivation procedure starts in the exact same way as before:
We partially integrate for both and , yielding:
But now, to eliminate these boundary terms, we need extra conditions for :
In other words, the deviation must be zero on the whole “box”.
Again relying on the fact that is arbitrary, the Euler-Lagrange
This generalizes nicely to functions of even more variables :
So far, for multiple functions ,
we have been assuming that all are independent, and by extension all .
Suppose that we now have constraints
that all need to obey, introducing implicit dependencies between them.
Let us consider constraints of the two forms below.
It is important that they are holonomic,
meaning they do not depend on any derivatives of any :
Where is a constant.
Note that the first form can also be used for ,
by simply redefining the constraint as .
To solve this constrained optimization problem for ,
we introduce Lagrange multipliers .
In the former case is a function of , while in the
latter case is constant:
The reason for this distinction in
is that we need to find the stationary points with respect to
of both constraint types. Written in the variational form, this is:
From this, we define a new Lagrangian for the functional ,
with the contraints built in:
Then we derive the Euler-Lagrange equation as usual for instead of :
Using the same logic as before, we end up with a set of Euler-Lagrange equations with :
By inserting the definition of , we then get the following.
Recall that is holonomic, and thus independent of all derivatives :
These are Lagrange’s equations of the first kind,
with their second-kind counterparts being the earlier Euler-Lagrange equations.
Note that there are separate equations, one for each .
Due to the constraints , the functions are not independent.
This is solved by choosing such that of the equations hold,
i.e. solving a system of equations for :
And then the remaining equations can be solved in the normal unconstrained way.
- G.B. Arfken, H.J. Weber,
Mathematical methods for physicists, 6th edition, 2005,
- O. Bang,
Applied mathematics for physicists: lecture notes, 2019,