Calculus of Variations: First Variations of Common Functionals
CV02E1 computed first variations directly by expanding J[y + 𝜖η]. This companion set develops
the complementary skill: start from the general first-variation formula
and apply it efficiently to functionals that recur in mechanics, geometry, boundary-value problems,
and later variational theory.
The emphasis here is on identifying the correct integrand derivatives and on keeping the first
variation separate from the later integration-by-parts step. Where useful, some solutions perform
that second step to verify stationarity of a known candidate, but the primary target remains the
first variation itself.
Figure. Anatomy of the first variation for a first-order integral functional. Changes in the
function itself contribute through Fyη, while changes in slope contribute through Fy′η′.
1 Exercises
Exercise 1: weighted quadratic gradient plus potential
Let
where a and V are smooth. Derive δJ[y; η] for a fixed-endpoint variation η.
Exercise 2: forced Dirichlet functional
Consider
with y(0) = y(1) = 0.
- Derive the first variation for a general forcing function f(x).
- For f(x) = 1, verify that
is stationary for every fixed-endpoint variation.
Exercise 3: weighted arc-length functional
Let
where w(x,y) > 0 is smooth. Compute δJ[y; η]. Then specialize the result to w = 1.
Exercise 4: mechanical action
For a particle with coordinate q(t), define the action
- Derive δS[q; η].
- For the harmonic oscillator V (q) =
kq2, show that any solution of
makes the first variation vanish for all variations satisfying η(t0) = η(t1) = 0.
Exercise 5: two coupled dependent variables
Let
Using independent variations η and ξ, compute the full first variation of J[u + 𝜖η,v + 𝜖ξ].
Exercise 6: the p-energy
For p > 1, consider
Assuming sufficient regularity, derive
Check that the formula reduces to the standard quadratic-gradient result when p = 2 and to the
quartic result when p = 4.
Exercise 7: adding a total derivative
Let
where G is smooth. Show that for fixed-endpoint variations,
Explain why adding a total derivative does not change the interior stationarity condition for fixed
endpoint problems.
Exercise 8: explicit x dependence
Consider
Derive the first variation. For the particular candidate y = 0, determine whether it is stationary for
arbitrary fixed-endpoint variations.
2 Solutions
Solution 1: weighted quadratic gradient plus potential
The integrand is
Its relevant partial derivatives are
Therefore
This single formula includes many standard one-dimensional energy functionals. The first term
measures sensitivity to displacement of the curve; the second measures sensitivity to its
slope.
Solution 2: forced Dirichlet functional
Here
Thus
The first variation is
For f = 1 and
one has
Then
Integrating the first term by parts,
The boundary term vanishes because η(0) = η(1) = 0, and y∗′′ = −1, so
Therefore
for every admissible variation.
Solution 3: weighted arc-length functional
The integrand is
Differentiate with respect to y:
Differentiate with respect to y′:
Hence
When w = 1, the displacement term disappears and
This is the first-variation starting point for the shortest-path problem.
Solution 4: mechanical action
The mechanical integrand is the Lagrangian
Under
the first variation is
For the harmonic oscillator,
so
Integrate the first term by parts:
Because the endpoint variations vanish,
Any trajectory satisfying
therefore gives
for every admissible η.
Figure. Hamilton’s principle uses exactly the same first-variation machinery as the
abstract functional problem: perturb the trajectory while fixing the endpoint events, then
differentiate the action with respect to the perturbation amplitude.
Solution 5: two coupled dependent variables
Perturb both variables:
Then
Differentiating the scalarized functional at 𝜖 = 0 gives
The two variations are independent. Later, the vector version of the Euler–Lagrange equation will
turn the coefficients of η and ξ into a coupled system of differential equations.
Solution 6: the p-energy
Let
For p > 1, the derivative with respect to y′ is
There is no explicit dependence on y, so Fy = 0. Therefore
For p = 2,
For p = 4,
If instead one omits the prefactor 1∕p and uses J = ∫
y′4dx, the corresponding first variation is
4 ∫
y′3η′dx, matching the direct expansion in CV02E1.
Solution 7: adding a total derivative
Write
Under a variation, the first term contributes
The boundary contribution varies as
For fixed endpoints,
so this term vanishes. Hence
Thus a total derivative changes only endpoint data. When endpoint values are fixed, it
does not alter the interior stationarity equation. In mechanics, this is the familiar fact
that Lagrangians differing by a total time derivative produce the same equations of
motion.
Figure. Adding a total derivative changes the action by a boundary contribution. For fixed
endpoints its first variation vanishes, leaving the interior variational condition unchanged.
Solution 8: explicit x dependence
The integrand is
Therefore
The first variation is
For y = 0, both y and y′ vanish identically, so
for every admissible variation. Thus y = 0 is stationary. Because the integrand is nonnegative and
vanishes at y = 0, one can in this special case go further and identify it as a global minimizer, but
that conclusion uses more than the first variation alone.
3 Summary
For the classical first-order functional
the practical workflow is
The examples show that the same structure covers elastic-energy-like functionals, forced
boundary-value problems, path length, mechanical action, coupled coordinates, nonlinear
p-energies, and Lagrangians modified by total derivatives. The first variation is therefore the
common language connecting a large class of physical extremum principles.