Calculus of Variations: Computing Second Variations - Exercises and Worked Solutions
CV11 introduced the second variation as the variational analogue of a Hessian quadratic form.
This companion entry is deliberately computational. The goal is to become fluent at moving
between three equivalent viewpoints:
and, for a first-order functional J[y] = ∫
abF(x,y,y′)dx,
All derivatives of F are evaluated along the candidate y∗. The main lesson emphasized that this
quadratic form carries classification information only after y∗ has first been shown to be stationary.
The exercises below reinforce that separation. Standard treatments of the second variation and
Legendre condition include [1, 2, 3, 4].
Figure. A reliable workflow for computing the second variation. Direct epsilon
differentiation and Hessian-coefficient assembly must give the same quadratic functional.
1 Exercises
Exercise 1: a positive quadratic functional
Consider
where ω is a real constant.
- Verify that y∗(x) = 0 is stationary.
- Compute δ2J[0; η] from the Hessian formula.
- Evaluate the result for η(x) = sin(πx).
Exercise 2: direct epsilon expansion with variable coefficients
Let
For a general candidate y∗ and variation η:
- substitute y∗ + 𝜖η directly and isolate the coefficient of 𝜖2;
- infer δ2J[y
∗; η];
- check the result using Fyy, Fyy′, and Fy′y′;
- evaluate it for η = x(1 − x).
Exercise 3: a mixed term that becomes a boundary term
Consider
with fixed endpoints y(0) = y(1) = 0.
- Compute the three Hessian coefficients.
- Write the unreduced second variation.
- Show explicitly that the mixed term integrates to zero for admissible variations.
- Evaluate the reduced form for η = sin(πx).
Exercise 4: a nontrivial stationary logarithmic extremal
Consider
with endpoint values
- Verify that
is an Euler–Lagrange extremal.
- Compute Fyy, Fyy′, and Fy′y′ along y∗.
- Write the unreduced second variation.
- Integrate the mixed term by parts and show that the η2 term cancels completely.
Exercise 5: second variation of arc length about a straight line
For
let
join the prescribed endpoints.
- Compute the second variation about y∗.
- Evaluate it for
- State what the sign tells you and what it does not prove by itself.
Exercise 6: harmonic-oscillator action and trial modes
For the mechanical action
let q∗ be any stationary trajectory with fixed endpoints.
- Compute δ2S[q
∗; η].
- Evaluate it on the trial family
- For each n, find the interval length at which this particular trial direction becomes
neutral.
Exercise 7: a nonlinear slope energy and the Legendre coefficient
Let
- Compute the second variation about a stationary function y∗.
- Identify the Legendre coefficient Fy′y′.
- If y∗ = 0 is stationary and V ′(0) = 0, simplify the result.
- Explain immediately why α < 0 rules out y∗ = 0 as a weak local minimum.
Exercise 8: a variable-coefficient quadratic form
Consider
- Show that y∗ = 0 is stationary and compute its second variation.
- Evaluate the second variation on η = sin(πx).
- Find the values of λ for which this one trial direction already proves that y∗ = 0 cannot
be a local minimum.
Exercise 9: the bilinear variational Hessian
For
define
- Compute B(η,ξ).
- Verify explicitly that B(η,ξ) = B(ξ,η).
- Evaluate B for
- Explain the relation between B(η,η) and the ordinary second variation.
2 Worked solutions
Solution 1: a positive quadratic functional
The integrand is
Its first derivatives are
At y∗ = 0, both vanish, so the Euler–Lagrange equation is satisfied. The Hessian coefficients
are
Therefore
For η = sin(πx),
and
Hence
This is strictly positive for every real ω and every nonzero version of this trial direction.
Solution 2: direct epsilon expansion with variable coefficients
Substitute
Then
| J[y𝜖] | = ∫
01 dx | (28)
|
| = J[y∗] + 𝜖∫
01 dx | (29)
|
| + 𝜖2 ∫
01 dx. | (30) |
Because the Taylor convention is
we obtain
The Hessian check gives
which reproduces the same result.
For
we find
| δ2J | = ∫
01 dx | (35)
|
| = . | (36) |
This example is useful because the second variation does not depend on y∗ at all: the original
functional is already quadratic in y and y′.
Solution 3: a mixed term that becomes a boundary term
For
we have
Therefore
Now use
Thus
Because admissible fixed-endpoint variations satisfy
this boundary contribution vanishes. Hence
For η = sin(πx),
Notice that α disappears completely from the fixed-endpoint second variation. In fact,
αyy′ =
(d∕dx)(y2) is itself a total derivative.
Figure. The mixed term 2Fyy′ηη′ can often be converted into an η2 contribution plus an
endpoint term. For constant Fyy′ = α and fixed endpoints, only the boundary term
remains, and it vanishes.
Solution 4: a nontrivial stationary logarithmic extremal
Here
The first derivatives are
Therefore
The Euler–Lagrange equation becomes
For
we have
so indeed
The second derivatives of F are
and
Along y∗ = ln(1 + x),
and therefore
The unreduced form is
Since
integration by parts gives
The boundary term vanishes, so the −2η2 produced here cancels the original +2η2.
Thus
This is a useful example because a complicated-looking Hessian quadratic form collapses to a
manifestly nonnegative expression after the mixed term is handled correctly.
Figure. The stationary curve y∗ = ln(1 + x) and the positive Weight (1 + x)2 appearing in
its reduced second variation.
Solution 5: second variation of arc length about a straight line
For
we have
Also,
so
Along the straight line y∗′ = m,
For
we have
and therefore
Hence
This positive value confirms positive curvature of the functional along this trial direction.
Positivity in one direction alone does not prove a minimum. Here the full quadratic form is positive
for every nonzero fixed-endpoint variation, which is much stronger; a complete sufficiency
statement still belongs to the later theory.
Solution 6: harmonic-oscillator action and trial modes
For
we have
Thus every stationary trajectory has the same second variation,
Take
Then
and
Therefore
This direction becomes neutral when
or
For T > Tn, that trial direction produces a negative second variation. The first mode n = 1
therefore detects loss of positive definiteness first. This is the calculation behind the
conjugate-point threshold developed more systematically in CV12 and is standard in variational
mechanics [5, 1].
Figure. Second variation of the first three sine trial modes as the endpoint separation T
changes, with m = k = 1. Each mode crosses zero at Tn = nπ.
Solution 7: a nonlinear slope energy and the Legendre coefficient
The integrand is
Its relevant second derivatives are
and
Therefore about a stationary y∗,
The Legendre coefficient is
If y∗ = 0 is stationary, then V ′(0) = 0 and y∗′ = 0, so
If α < 0, then
along the candidate. The Legendre necessary condition for a weak local minimum is
violated immediately. No further classification calculation is needed to rule out a weak
minimum.
Solution 8: a variable-coefficient quadratic form
The functional is already quadratic, and y∗ = 0 plainly satisfies the Euler–Lagrange equation. The
Hessian coefficients are
Hence
For η = sin(πx),
Also,
so
| ∫
01(1 + x)(η′)2dx | = π2 ∫
01(1 + x) cos 2(πx)dx | (90)
|
| = . | (91) |
Therefore
This trial direction is negative when
Thus
This is only a one-direction test. If the value is positive, we have not proved that the quadratic
form is positive for every admissible variation.
Solution 9: the bilinear variational Hessian
For the quadratic functional,
The integrand is unchanged when η and ξ are interchanged, so
Now choose
Orthogonality gives
Their derivatives are proportional to cos(πx) and cos(2πx), which are also orthogonal on [0, 1],
so
Hence
Finally, the ordinary quadratic second variation is simply the bilinear Hessian evaluated twice in
the same direction:
This is exactly analogous to the finite-dimensional expression hT Hh obtained by inserting the
same displacement vector into both slots of the Hessian bilinear form.
3 A compact computation checklist
For a functional
a reliable calculation proceeds as follows.
- Verify that the candidate is stationary before using the second variation for
classification.
- Compute
along the candidate.
- Assemble
- If useful, reduce the mixed term using
- Apply the actual endpoint conditions before discarding boundary terms.
- Check the Legendre coefficient C = Fy′y′.
- Evaluate selected trial functions to find negative or neutral directions.
- Do not infer positivity for all variations from positivity on only one or a few trial
directions.
The last point is the bridge to CV11E2 and CV12: computing a quadratic form is straightforward;
proving its sign for an infinite-dimensional class is the deeper problem.
4 Summary
The second variation can be obtained either by direct epsilon expansion or by differentiating the
integrand Hessian. For fixed-endpoint problems the general expression is
The mixed term often simplifies after integration by parts, but it must not simply be dropped. The
Legendre coefficient Fy′y′ gives a pointwise necessary condition, while selected trial directions can
disprove minimality by producing a negative second variation. Positive values on a few directions
are not a proof of a minimum. That distinction motivates the classification and Jacobi-field
problems that follow.
References
[1] I. M. Gelfand and S. V. Fomin, Calculus of Variations, Dover Publications, 2000.
[2] Bruce van Brunt, The Calculus of Variations, Springer, 2004.
[3] Hans Sagan, Introduction to the Calculus of Variations, Dover Publications, 1992.
[4] Robert Weinstock, Calculus of Variations with Applications to Physics and
Engineering, Dover Publications, 1974.
[5] Cornelius Lanczos, The Variational Principles of Mechanics, Dover Publications,
1986.