Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random |  
Login
create new user
Username:
Password:
forget your password?
Main Menu
Sections

Meta

Talkback

Downloads

Information
[parent] Calculus of Variations: First Variations of Common Functionals (Example)

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

          ∫ b
δJ [y;η ] =    (F η + F ′η′) dx
           a    y     y
(1)

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.

PIC

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

      ∫   [                  ]
         b 1-     ′2
J[y] =     2 a(x)y  + V (x,y)  dx,
        a
(2)

where a and V are smooth. Derive δJ[y; η] for a fixed-endpoint variation η.

Exercise 2: forced Dirichlet functional

Consider

      ∫  1[1            ]
J[y] =     --y′2 − f(x )y  dx
        0  2
(3)

with y(0) = y(1) = 0.

  1. Derive the first variation for a general forcing function f(x).
  2. For f(x) = 1, verify that
    y (x) = 1x (1 − x )
 ∗      2
    (4)

    is stationary for every fixed-endpoint variation.

Exercise 3: weighted arc-length functional

Let

       ∫ b       ∘ -------
J[y] =    w (x,y)  1 + y′2dx,
        a
(5)

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

       ∫ t1[               ]
S[q] =      1-m ˙q2 − V(q,t)  dt.
        t0  2
(6)

  1. Derive δS[q; η].
  2. For the harmonic oscillator V (q) = 1
2kq2, show that any solution of
    m q¨+ kq =  0
    (7)

    makes the first variation vanish for all variations satisfying η(t0) = η(t1) = 0.

Exercise 5: two coupled dependent variables

Let

         ∫ b[ 1      1         ]
J[u,v] =      -u′2 + -v′2 + cuv dx.
          a   2      2
(8)

Using independent variations η and ξ, compute the full first variation of J[u + 𝜖η,v + 𝜖ξ].

Exercise 6: the p-energy

For p > 1, consider

         ∫
       1   b  ′ p
Jp[y ] =--    |y | dx.
       p  a
(9)

Assuming sufficient regularity, derive

δJp [y;η ].
(10)

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

       ∫   [                ]
 ^       b  1-′2   d--
J [y] =      2y  +  dxG (x,y ) dx,
        a
(11)

where G is smooth. Show that for fixed-endpoint variations,

           ∫ b
δJ^[y;η] =    y′η′dx.
            a
(12)

Explain why adding a total derivative does not change the interior stationarity condition for fixed endpoint problems.

Exercise 8: explicit x dependence

Consider

       ∫   [              ]
         2  1- 2 ′2   1-x  2
J [y] =      2x  y  + 2e y   dx.
        1
(13)

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

             1
F (x,y,y′) = -a(x )y ′2 + V(x, y).
             2
(14)

Its relevant partial derivatives are

Fy =  Vy(x,y),     Fy′ = a (x)y′.
(15)

Therefore

|--------------------------------------|
|          ∫ b                         |
|δJ[y;η] =     [Vy(x, y)η + a(x)y′η ′]dx. |
------------a--------------------------
(16)

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

F (x, y,y′) = 1y′2 − f (x)y.
             2
(17)

Thus

                   ′    ′
Fy = − f (x ),    Fy  = y .
(18)

The first variation is

|------------------------------|
|          ∫ 1                 |
|δJ[y;η] =    [y′η′ − f(x )η ]dx.
------------0-------------------
(19)

For f = 1 and

y (x ) = 1x(1 − x),
 ∗       2
(20)

one has

 ′   1-           ′′
y∗ = 2 −  x,    y∗ = − 1.
(21)

Then

           ∫ 1[ ( 1    )       ]
δJ[y∗;η] =        -−  x  η′ − η dx.
            0     2
(22)

Integrating the first term by parts,

∫                    ∫
  1  ′ ′       ′ 1     1  ′′
    y∗ηdx  = [y∗η]0 −     y∗ηdx.
 0                    0
(23)

The boundary term vanishes because η(0) = η(1) = 0, and y′′ = 1, so

∫            ∫
   1 ′ ′       1
    y∗η dx =     ηdx.
  0           0
(24)

Therefore

|------------|
-δJ[y∗;η] =-0-
(25)

for every admissible variation.

Solution 3: weighted arc-length functional

The integrand is

        ′           ∘ -----′2-
F (x,y,y ) = w (x, y)  1 + y .
(26)

Differentiate with respect to y:

              ∘ -------
Fy =  wy(x,y )  1 + y′2.
(27)

Differentiate with respect to y:

             ----y′----
Fy ′ = w (x,y)∘ 1 + y′2.
(28)

Hence

|----------∫-b[-----------------------------]----|
|                 ∘ ------′2      ----y′--- ′     |
|δJ[y;η] =  a   wy  1 + y  η + w ∘ 1 + y′2η  dx. |
--------------------------------------------------
(29)

When w = 1, the displacement term disappears and

|----------------------------|
|          ∫ b    y′         |
|δJ[y;η] =     ∘--------η′dx. |
------------a----1-+-y′2------|
(30)

This is the first-variation starting point for the shortest-path problem.

Solution 4: mechanical action

The mechanical integrand is the Lagrangian

            1   2
L (q, ˙q,t) =-m ˙q  − V (q,t).
            2
(31)

Under

q𝜖 = q + 𝜖η,    ˙q𝜖 = ˙q + 𝜖˙η,
(32)

the first variation is

|----------------------------------|
|          ∫ t1                    |
|δS[q;η] =     [m ˙q ˙η − Vq(q,t)η]dt.
------------t0----------------------
(33)

For the harmonic oscillator,

Vq = kq,
(34)

so

      ∫
        t1
δS  =     [m ˙q˙η − kqη]dt.
       t0
(35)

Integrate the first term by parts:

∫                      ∫
  t1               t1     t1
    m ˙q˙ηdt = [m ˙qη]t0 −     m ¨qηdt.
 t0                      t0
(36)

Because the endpoint variations vanish,

        ∫ t1
δS =  −     (m q¨+ kq )ηdt.
         t0
(37)

Any trajectory satisfying

m q¨+ kq =  0
(38)

therefore gives

|-------|
δS-=--0--
(39)

for every admissible η.

PIC

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:

u =  u + 𝜖η,    v  = v + 𝜖ξ.
 𝜖               𝜖
(40)

Then

 ′    ′    ′      ′    ′     ′
u𝜖 = u + 𝜖η ,    v𝜖 = v +  𝜖ξ .
(41)

Differentiating the scalarized functional at 𝜖 = 0 gives

|---------------∫------------------------------|
|                 b  ′ ′   ′ ′                 |
|δJ [u,v; η,ξ] =    [uη  + v ξ + c(vη + uξ)]dx. |
-----------------a-----------------------------
(42)

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

    ′    1- ′p
F (y ) = p|y |.
(43)

For p > 1, the derivative with respect to yis

       ′p−2  ′
Fy′ = |y | y .
(44)

There is no explicit dependence on y, so Fy = 0. Therefore

|----------∫-b--------------|
|               ′ p− 2 ′′    |
δJp[y;η] =  a  |y |  y η dx. |
-----------------------------
(45)

For p = 2,

           ∫
             b  ′′
δJ2[y;η] =     yη dx.
            a
(46)

For p = 4,

           ∫ b
δJ4[y;η] =    y′3η′dx.
            a
(47)

If instead one omits the prefactor 1∕p and uses J = y4dx, the corresponding first variation is 4 y3ηdx, matching the direct expansion in CV02E1.

Solution 7: adding a total derivative

Write

      ∫  b1
^J[y] =    -y ′2dx + G (b,y(b)) − G (a,y(a)).
        a 2
(48)

Under a variation, the first term contributes

∫
  b ′ ′
   y η dx.
 a
(49)

The boundary contribution varies as

δ[G(b,y(b)) − G (a, y(a))] = Gy (b,y(b))η (b) − Gy (a,y(a))η(a).
(50)

For fixed endpoints,

η(a) = η(b) = 0,
(51)

so this term vanishes. Hence

|--------------------|
|          ∫ b       |
|δ ^J[y;η] =   y′η′dx.|
------------a---------
(52)

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.

PIC

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

F(x, y,y′) =  1x2y′2 + 1exy2.
             2        2
(53)

Therefore

       x         ′    2 ′
Fy =  e y,    Fy  = x  y.
(54)

The first variation is

|--------------------------------|
|          ∫ 2[             ]    |
|δJ[y;η] =     exy η + x2y′η ′dx. |
------------1---------------------
(55)

For y = 0, both y and yvanish identically, so

|------------|
|δJ [0;η] = 0 |
-------------
(56)

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

       ∫ b
J [y] =    F (x,y,y ′)dx,
        a
(57)

the practical workflow is

                              ∫ b
F  −→  (Fy,Fy ′) −→  δJ [y;η] =    (Fyη + Fy ′η ′)dx.
                               a
(58)

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.


"Calculus of Variations: First Variations of Common Functionals" is owned by bloftin.
(view preamble)
View style:
Other names:  CV02E2

This object's parent.

Cross-references: motion, system of differential equations, vector, Hamilton's principle, Lagrangian, boundary, energy, function, mechanics, formula

This is version 1 of Calculus of Variations: First Variations of Common Functionals, born on 2026-09-10.
Object id is 1144, canonical name is CalculusOfVariationsFirstVariationsOfCommonFunctionals.
Accessed 2 times total.

Classification:
Physics Classification02.30.Xx (Calculus of variations)
 02.30.Sa (Functional analysis)
 45.20.Jj (Lagrangian and Hamiltonian mechanics)
Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:

No messages.

Interact
rate | post | correct | update request | add example | add (any)