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: Free-Endpoint Problems and Worked Solutions (Example)

Calculus of Variations: Free-Endpoint Problems and Worked Solutions

CV05 showed that the Euler–Lagrange equation governs the interior of a stationary curve while the endpoint freedom determines additional boundary conditions. This companion entry turns that principle into a problem-solving routine. The central fixed-x boundary term is

δJ        = [F ′η]b .
  boundary     y  a
(1)

If an endpoint value is prescribed, the corresponding variation vanishes. If the endpoint value is free, the variation is arbitrary and the coefficient of that variation must vanish. This is the source of the natural boundary condition

Fy′ = 0.
(2)

When an endpoint cost is present, the same reasoning modifies the natural condition rather than replacing it. When the endpoint abscissa itself moves, the full transversality boundary form must be used. These constructions are standard in the classical calculus of variations and in analytical mechanics [1234].

PIC

Figure. A compact decision map for fixed-x endpoint data. Prescribed endpoint values eliminate the endpoint variation; free endpoint values produce a natural condition; an explicit terminal cost contributes its own endpoint derivative.

1 How to use this set

Attempt every exercise before reading the solutions. For each problem use the same sequence:

  1. identify what is fixed and what is free at each endpoint;
  2. write the admissible variation conditions;
  3. derive the Euler–Lagrange equation in the interior;
  4. retain the boundary term instead of discarding it automatically;
  5. impose the natural or transversality condition implied by the endpoint freedom;
  6. only then solve for the integration constants; and
  7. distinguish stationarity from any stronger minimum claim.

2 Exercises

Exercise 1: classify the endpoint data

For

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

assume the independent-variable endpoints a and b are fixed. For each case below, state the endpoint conditions on the variation η and the resulting natural boundary condition, if any.

  1. y(a) and y(b) are both prescribed.
  2. y(a) is prescribed and y(b) is free.
  3. y(a) is free and y(b) is prescribed.
  4. both y(a) and y(b) are free.

Explain why a free endpoint does not mean “there is no boundary condition.”

Exercise 2: the simplest one-free-end problem

Let

         ∫
       T-  L  ′   2
J[y] = 2     y (x) dx,     T >  0,
          0
(4)

with

y(0) = Y0,
(5)

while y(L) is free.

  1. Derive the Euler–Lagrange equation.
  2. Derive the natural boundary condition at x = L.
  3. Solve for the stationary function.
  4. Prove directly that the stationary function is the global minimizer.

Exercise 3: a uniformly forced strip with a free right end

Consider

      ∫  L[ T         ]
J[y] =      --y′2 − f0y  dx,     T > 0,     f0 > 0,
        0   2
(6)

with

y(0) = 0,
(7)

and y(L) free.

  1. Derive the interior Euler–Lagrange equation.
  2. Derive the natural condition at x = L.
  3. Solve for y(x).
  4. Find y(L) and verify that the terminal slope is zero.
  5. Interpret Tyas the generalized boundary traction associated with the slope variable.

PIC

Figure. A constant distributed load with the left value fixed and the right value free. The natural condition forces a horizontal tangent at the free endpoint.

Exercise 4: a terminal spring and a Robin-type condition

Let

       ∫
         L T- ′2      k-          2
J[y] =     2 y  dx + 2 [y (L ) − Ys] ,    T >  0,    k >  0,
        0
(8)

with y(0) = 0 and y(L) free.

  1. Compute the first variation, including the variation of the terminal spring energy.
  2. Derive the interior equation.
  3. Show that the terminal condition is
    T y′(L) + k[y(L ) − Ys] = 0.
    (9)

  4. Solve the complete boundary-value problem.
  5. Examine the limits k 0 and k →∞ and interpret both.

PIC

Figure. A free terminal value can be coupled to an endpoint energy. The resulting boundary condition balances the interior conjugate quantity Ty(L) against the spring force generated by the terminal penalty.

Exercise 5: a prescribed endpoint load

Consider

       ∫ L
J [y] =     T-y′2dx − P y(L),     T > 0,
        0  2
(10)

with y(0) = 0 and y(L) free.

  1. Derive the natural terminal condition.
  2. Solve for y(x).
  3. Show that the boundary condition can be written
       ′
Ty (L) = P.
    (11)

  4. Explain why the free-end condition is not y(L) = 0 in this problem.

Exercise 6: both endpoint values free

Let

        ∫
       1-  L[   ′2      2]
J[y] = 2     T y  + Ky    dx,     T > 0,     K >  0,
          0
(12)

and suppose both y(0) and y(L) are free.

  1. Derive the Euler–Lagrange equation.
  2. Derive both natural boundary conditions.
  3. Solve the resulting boundary-value problem.
  4. Prove directly that the stationary solution is the unique global minimizer.

Exercise 7: free terminal position in mechanics

A particle moves vertically in a uniform gravitational field. Consider the action

       ∫   [             ]
         tf  1-  2
S[q] =       2m ˙q  − mgq   dt,
        0
(13)

where tf is fixed, q(0) = q0 is prescribed, and q(tf) is free.

  1. Derive the equation of motion.
  2. Derive the natural condition at t = tf.
  3. Solve the trajectory completely.
  4. Explain the physical meaning of the natural condition in terms of canonical momentum.

PIC

Figure. With terminal time fixed but terminal position free, stationarity requires the canonical momentum at the final time to vanish. For the constant-gravity example this means the trajectory reaches its turning point at tf.

Exercise 8: a conceptual free-terminal-time calculation

For a mechanical action

       ∫  tf
S [q] =     L(q, ˙q,t)dt,
         t0
(14)

suppose the initial endpoint is fixed while the terminal point may move. CV05 showed that the terminal boundary form can be written

δS  = p  δq −  H  δt ,
  f    f   f     f  f
(15)

where

    ∂L-
p =  ∂ ˙q ,   H  = pq˙− L.
(16)

  1. If tf is fixed and qf is free, what terminal condition follows?
  2. If qf is fixed and tf is free, what terminal condition follows?
  3. If both qf and tf are free independently, what two conditions follow?
  4. Explain why these are necessary stationarity conditions rather than minimum tests.

The appearance of p and H in the endpoint variation is the classical mechanics form of transversality and is closely related to terminal conditions in optimal control [456].

3 Complete worked solutions

Solution 1: classify the endpoint data

For fixed a and b, integration by parts gives

              ∫  b(       d    )
δJ = [Fy′η]ba +      Fy − ---Fy′  ηdx.
                a        dx
(17)

On a stationary curve the interior Euler–Lagrange expression vanishes, so the endpoint logic is controlled entirely by

F  ′(b)η(b) − F ′(a)η(a ).
  y           y
(18)

(a) Both endpoint values prescribed.

η (a ) = 0,    η(b) = 0.
(19)

Hence the boundary term vanishes automatically. There are no additional natural conditions.

(b) Left value prescribed, right value free.

η(a) = 0,    η (b) arbitrary.
(20)

Therefore

|----------|
Fy-′(b)-=-0.-
(21)

(c) Left value free, right value prescribed.

η(a) arbitrary,     η(b) = 0,
(22)

so

|----------|
Fy ′(a) = 0.|
------------
(23)

(d) Both values free.

Both endpoint variations are independent and arbitrary, so

|--------------------------|
|F ′(a ) = 0,    F ′(b) = 0.|
--y---------------y---------
(24)

The key conceptual point is that freedom makes the endpoint variation arbitrary. An arbitrary variation is more restrictive on the coefficient, not less restrictive. Thus a free endpoint usually creates a natural boundary condition.

Solution 2: the simplest one-free-end problem

The integrand is

     T- ′2
F =  2y  .
(25)

Hence

                    ′
Fy = 0,     Fy′ = Ty .
(26)

The Euler–Lagrange equation is

− -d-(T y′) = 0.
  dx
(27)

Since T is constant,

|-------|
y′′ = 0.|
---------
(28)

At the free endpoint x = L,

|------------|
|T y′(L ) = 0,|
-------------
(29)

or simply

y′(L ) = 0.
(30)

The general solution is

y(x) = C  x + C .
         1      2
(31)

The natural condition gives C1 = 0, and y(0) = Y 0 gives C2 = Y 0. Therefore

-------------
|           |
y∗(x)-=-Y0.--
(32)

To classify the solution, note that

       T ∫  L
J[y] = --    y′2dx ≥  0.
       2   0
(33)

For y = Y 0, y= 0 and therefore

J[y∗] = 0.
(34)

Thus

|------------|
-J[y] ≥-J[y∗]|
(35)

for every admissible y. The stationary function is therefore a global minimizer, not merely a stationary candidate.

Solution 3: a uniformly forced strip with a free right end

Here

     T
F =  -y ′2 − f0y.
     2
(36)

Thus

Fy =  − f0,    Fy′ = T y′.
(37)

The Euler–Lagrange equation is

         ′′
− f0 − Ty  = 0,
(38)

so

|----------|
|y′′ = − f0.|
--------T---
(39)

Because y(L) is free while L is fixed,

|---′--------|
-T-y(L-) =-0.|
(40)

Integrating twice,

          f0
y′(x) = − --x + C1,
          T
(41)

y(x ) = −-f0x2 + C  x + C .
         2T        1     2
(42)

The fixed left endpoint gives C2 = 0. The free-end condition gives

     ′        f0
0 = y (L ) = − --L + C1,
              T
(43)

hence

     f0L
C1 = ----.
      T
(44)

Therefore

|---------(---------)--|
|       f0-       x2-  |
y(x ) = T   Lx −  2   .|
------------------------
(45)

At the free end,

|--------------|
|        f0L2  |
|y(L ) = ----. |
----------2T---
(46)

Also

y′(x) = f0-(L − x),
        T
(47)

so indeed

y′(L ) = 0.
(48)

The quantity Fy = Tyis the quantity conjugate to the endpoint value y. In this simple one-dimensional elastic model it plays the role of a boundary traction. With no externally imposed endpoint load, stationarity sets that traction to zero.

Solution 4: a terminal spring and a Robin-type condition

Write

       ∫ L    ′
J[y] =    F (y )dx + Φ (y(L)),
        0
(49)

with

     T  ′2           k           2
F =  --y ,     Φ =  -[y(L) − Ys] .
     2              2
(50)

The variation of the integral is

                 ∫ L
δJ   = [T y′η]L −     T y′′ηdx.
  int        0    0
(51)

The terminal spring contributes

δΦ  = k[y(L) − Ys]η(L).
(52)

Because y(0) is fixed, η(0) = 0. Therefore

        ∫
          L   ′′          ′
δJ =  −     Ty η dx + {T y (L) + k[y(L) − Ys]}η(L ).
         0
(53)

Interior stationarity gives

|′′-----|
y--=-0.--
(54)

Since y(L) is free, η(L) is arbitrary, so

|--′-----------------------|
-Ty-(L)-+-k[y(L)-−-Ys] =-0.-
(55)

The interior solution is

y =  Cx + D.
(56)

From y(0) = 0, D = 0. Hence y = Cx and the terminal condition becomes

TC +  k(CL  − Ys) = 0.
(57)

Therefore

C (T  + kL ) = kY ,
                s
(58)

so

|--------------|
|     --kYs--- |
|C  = T + kL . |
---------------
(59)

The stationary profile is

|-----------------|
y(x ) = --kYs--x. |
--------T-+-kL----|
(60)

The endpoint value is

|---------kLY----|
|y(L) = ------s-.|
--------T--+-kL--|
(61)

If k 0, then C 0 and the endpoint behaves like an unloaded free end. If k →∞, then

y(L ) → Y ,
          s
(62)

so a very stiff terminal spring approaches a prescribed endpoint value. This is a useful bridge between natural and essential boundary data.

Solution 5: a prescribed endpoint load

The integral part gives

                 ∫ L
δJ   = [T y′η]L −     T y′′ηdx.
  int        0    0
(63)

The terminal load term contributes

δ[− P y(L)] = − Pη (L).
(64)

Thus

       ∫
          L   ′′          ′
δJ = −     T y η dx + [T y (L) − P] η(L).
         0
(65)

The interior equation is

 ′′
y  = 0,
(66)

and the free terminal value gives

|---′--------|
-Ty-(L)-=-P.--
(67)

Since y = Cx + D and y(0) = 0, D = 0. The terminal condition gives

T C =  P,
(68)

so

|------------|
|y(x) = P-x. |
--------T----|
(69)

The free endpoint does not imply y(L) = 0 because an external endpoint term is present. The natural condition expresses a balance between the internal conjugate quantity Tyand the applied terminal load P.

Solution 6: both endpoint values free

The integrand is

     1-  ′2   1-   2
F =  2T y  + 2 Ky  .
(70)

Therefore

Fy = Ky,      Fy′ = Ty′.
(71)

The Euler–Lagrange equation is

Ky  − T y′′ = 0,
(72)

or

                       ∘  ---
|--------------|          K
-y′′ −-λ2y-=-0,|   λ =    --.
                          T
(73)

Because both endpoint values are free,

|------------------------|
|y′(0) = 0,     y′(L ) = 0.|
--------------------------
(74)

The general solution is

y(x) = A cosh(λx ) + B sinh (λx ).
(75)

Differentiate:

 ′
y (x) = λA sinh(λx ) + λB cosh(λx ).
(76)

At x = 0,

 ′
y (0 ) = λB =  0,
(77)

so B = 0. Then

y′(L) = λA  sinh (λL ) = 0.
(78)

Since λ > 0 and L > 0, sinh(λL) > 0, hence A = 0. Therefore

|----------|
|y (x) = 0.|
--∗---------
(79)

Moreover,

         ∫
       1-  L (  ′2      2)
J[y] = 2      Ty  +  Ky   dx ≥  0,
          0
(80)

with equality only if y= 0 and y = 0 throughout the interval. Thus y = 0 is the unique global minimizer.

Solution 7: free terminal position in mechanics

Here the independent variable is time and

          1-   2
L (q, ˙q) = 2m q˙ − mgq.
(81)

The Euler–Lagrange equation is

∂L-   d-∂L-
∂q −  dt∂ ˙q = 0.
(82)

Since

∂L              ∂L
---=  − mg,     --- = m q˙,
∂q              ∂ ˙q
(83)

we obtain

− mg −  m ¨q = 0,
(84)

or

|--------|
|¨q = − g.|
---------
(85)

Because the terminal time tf is fixed but q(tf) is free, the natural condition is

|------------|
|∂L          |
|---(tf) = 0.|
-∂-˙q---------
(86)

Thus

|------------|
|m ˙q(tf) = 0,|
-------------
(87)

or

˙q(tf) = 0.
(88)

Integrating the equation of motion,

q˙(t) = − gt + C1.
(89)

The natural condition gives

0 = − gtf + C1,
(90)

so

C1 =  gtf.
(91)

Integrating again,

         1- 2
q(t) = − 2gt +  gtft + C2.
(92)

The prescribed initial value gives C2 = q0. Therefore

|------------------------|
|                  1-  2 |
|q(t) = q0 + gtft − 2 gt.|
-------------------------
(93)

The final position is

            1
q(tf) = q0 +--gt2f.
            2
(94)

The canonical momentum is

    ∂L
p = --- = m ˙q.
    ∂q˙
(95)

Thus a free terminal position at fixed terminal time requires

|----------|
|p(tf) = 0.|
-----------
(96)

For this example, the stationary trajectory reaches its turning point exactly at the terminal time.

Solution 8: a conceptual free-terminal-time calculation

The terminal boundary form is

δSf = pf δqf − Hf δtf.
(97)

(a) Fixed terminal time, free terminal position.

Here

δt =  0,
  f
(98)

while δqf is arbitrary. Therefore

|-------|
pf-=-0.--
(99)

(b) Fixed terminal position, free terminal time.

Here

δqf = 0,
(100)

while δtf is arbitrary. Therefore

|--------|
|Hf =  0.|
---------
(101)

(c) Both terminal position and terminal time free independently.

The variations δqf and δtf are independent, so both coefficients must vanish:

|--------------------|
|p  = 0,     H  =  0.|
--f------------f-----
(102)

(d) Necessary versus sufficient.

These conditions come from requiring the first-order variation to vanish. They therefore identify stationary candidates. They do not determine whether the candidate is a minimum, maximum, or saddle. Classification requires additional information such as convexity or second-variation tests.

4 Common mistakes

  • Mistake: setting η = 0 at every endpoint automatically. This silently converts a free-endpoint problem back into a fixed-endpoint one.
  • Mistake: imposing Fy = 0 at an endpoint whose value is prescribed. The variation already vanishes there, so no new natural condition follows.
  • Mistake: assuming every free endpoint gives y= 0. The actual condition is Fy = 0, or a modified balance when endpoint costs or loads are present.
  • Mistake: forgetting the variation of an endpoint energy such as Φ(y(L)).
  • Mistake: treating the natural condition as a replacement for the Euler–Lagrange equation. A stationary solution normally must satisfy both the interior equation and the relevant endpoint condition.
  • Mistake: concluding “minimum” solely from Euler–Lagrange and natural boundary conditions. They are first-order necessary conditions.

5 Summary of skills practiced

After completing this set, the reader should be able to

  • translate endpoint freedom into conditions on the variation η;
  • derive natural boundary conditions from the retained integration-by-parts term;
  • solve one-free-end and two-free-end boundary-value problems;
  • include endpoint loads and terminal spring energies consistently;
  • recognize Robin-type conditions as variational boundary balances;
  • interpret Fy as an endpoint-conjugate quantity such as traction or canonical momentum;
  • apply the fixed-terminal-time free-position condition pf = 0 in mechanics;
  • interpret the free-terminal-time condition Hf = 0 when the final coordinate is fixed; and
  • keep stationarity separate from minimum classification.

CV05E2 will use the same endpoint boundary form when the terminal point is not fully free but constrained to lie on a prescribed curve. That restriction couples the allowed endpoint variations and produces the classical transversality relation.

References

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]   Charles Fox, An Introduction to the Calculus of Variations, Dover Publications, 1987.

[4]   Herbert Goldstein, Charles Poole, and John Safko, Classical Mechanics, 3rd ed., Addison Wesley, 2002.

[5]   L. D. Landau and E. M. Lifshitz, Mechanics, 3rd ed., Course of Theoretical Physics, Vol. 1, Pergamon Press, 1976.

[6]   Donald E. Kirk, Optimal Control Theory: An Introduction, Prentice-Hall, 1970.


"Calculus of Variations: Free-Endpoint Problems and Worked Solutions" is owned by bloftin.
(view preamble)
View style:
Other names:  CV05E1
Keywords:  calculus of variations, free endpoint, natural boundary condition, endpoint variation, terminal cost, Robin boundary condition, traction boundary condition, free terminal position, free terminal time, transversality, Euler-Lagrange equation, worked exercises

This object's parent.

Cross-references: relation, position, momentum, motion, field, energy, forces, function, mechanics, boundary, CV05

This is version 1 of Calculus of Variations: Free-Endpoint Problems and Worked Solutions, born on 2026-09-13.
Object id is 1201, canonical name is CalculusOfVariationsFreeEndpointProblemsAndWorkedSolutions.
Accessed 5 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)