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
Calculus of Variations: The Euler--Lagrange equation (Topic)

Calculus of Variations: The Euler–Lagrange Equation

The first four entries of this series have been building toward one result. CV00 introduced functionals and admissible curves. CV01 made local optimality precise in function space. CV02 defined the first variation,

                     |
δJ[y;η] = -dJ [y + 𝜖η ]||   ,
          d𝜖         |𝜖=0
(1)

and showed that for

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

one has

          ∫ b
δJ[y;η] =    (Fy η + Fy′η ′)dx.
           a
(3)

CV03 proved the Fundamental Lemma: if a continuous function has zero integral against every sufficiently localized test function, then that function must vanish pointwise.

The Euler–Lagrange equation is what results when those pieces are assembled. For a stationary fixed-endpoint curve,

      d
Fy − ---Fy′ = 0.
     dx
(4)

This equation is the central necessary condition of classical calculus of variations. Its importance in physics is difficult to overstate. With the independent variable interpreted as time and F as a Lagrangian, it becomes Lagrange’s equation of motion. With F representing arc length, optical path, energy, or field action, the same structure generates geodesics, ray equations, minimum-energy configurations, and field equations.

The purpose of this entry is not merely to memorize the formula. The goal is to understand exactly why it follows, which assumptions are used, what it does and does not prove, and how to apply it reliably.

1 Learning objectives

After this entry, the reader should be able to

  1. state the classical fixed-endpoint Euler–Lagrange theorem with explicit regularity hypotheses;
  2. derive the theorem from local extremality, the first variation, integration by parts, and the Fundamental Lemma;
  3. identify where the fixed-endpoint condition is used;
  4. distinguish the ordinary derivative d∕dx from the partial derivatives Fy and Fy;
  5. expand the total derivative dFy∕dx by the chain rule;
  6. determine when the Euler–Lagrange equation can be solved explicitly for y′′;
  7. use the equation to test and construct candidate extremals;
  8. distinguish a stationary function or extremal from a proven minimum;
  9. interpret the first-variation identity as a weak form and the Euler–Lagrange ODE as a strong form under sufficient regularity;
  10. use the functional-derivative notation δJ∕δy correctly; and
  11. recognize how the surviving boundary term leads to natural boundary conditions in CV05.

2 The entire logical chain

The Euler–Lagrange equation is not obtained by differentiating a functional in one step. The derivation consists of a sequence of logically distinct facts.

PIC

Figure. Logical chain for the classical fixed-endpoint Euler–Lagrange theorem. Each arrow represents a separate argument: finite-dimensional Fermat stationarity, the first-variation calculation, integration by parts, endpoint admissibility, and the Fundamental Lemma.

The chain can be summarized as

local extremum   =⇒  δJ[y;η] = 0 for every admissible η =⇒  integral identity = ⇒ Euler–Lagrange  equation.
(5)

Only the forward implication is guaranteed. Solving the Euler–Lagrange equation finds stationary candidates. It does not, by itself, prove that a candidate is a minimum.

3 Classical fixed-endpoint theorem

We now state a clean classical version. More general versions require less smoothness, but the following hypotheses make every step of the proof transparent.

Theorem: Euler–Lagrange necessary condition. Let

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

where F C2 on an open set containing the values (x,y(x),y(x)) under consideration. Let

     {      2                            }
𝒜 =   y ∈ C ([a,b]) : y (a) = A, y(b) = B  .
(7)

Suppose y ∈𝒜 is a weak local minimum or weak local maximum of J. Then y satisfies

Fy(x, y∗,y′∗) −-d-Fy′(x,y∗,y′∗) = 0
              dx
(8)

for every x (a,b).

A strong local extremum also satisfies the theorem because every strong local extremum is, in particular, a weak local extremum under the classical C0/C1 hierarchy developed in CV01.

3.1 Why these hypotheses are convenient

The proof uses several operations:

  • differentiating F(x,y + 𝜖η,y+ 𝜖η) with respect to 𝜖;
  • differentiating Fy(x,y,y) with respect to x;
  • integrating by parts; and
  • applying the classical Fundamental Lemma to a continuous coefficient.

The assumptions F C2 and y C2 are stronger than strictly necessary, but they ensure all four steps are classical and pointwise. Later sections explain the weaker-form viewpoint.

4 Proof of the Euler–Lagrange theorem

The proof is short once the earlier machinery has been established, but every step has a specific purpose.

4.1 Step 1: choose an arbitrary admissible variation

Let η C1([a,b]) satisfy

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

Construct the family

y𝜖(x) = y∗(x) + 𝜖η (x).
(10)

Because η vanishes at the endpoints,

y𝜖(a) = A,     y𝜖(b) = B,
(11)

so the perturbed family remains in the fixed-endpoint admissible class for sufficiently small 𝜖.

4.2 Step 2: reduce to an ordinary scalar extremum

Define

Φ (𝜖) = J [y∗ + 𝜖η].
(12)

Because y is a local extremum of J, the scalar function Φ has a local extremum at 𝜖 = 0. Ordinary Fermat stationarity therefore gives

 ′
Φ (0) = 0.
(13)

By definition of the first variation,

δJ [y∗;η ] = 0.
(14)

This conclusion holds for every admissible variation η.

4.3 Step 3: insert the first-variation formula

From CV02,

           ∫  b
δJ [y ∗;η ] =    (Fyη + Fy′η′)dx,
             a
(15)

where the partial derivatives of F are evaluated along (x,y(x),y(x)).

Stationarity therefore implies

∫
  b            ′
    (Fy η + Fy′η) dx = 0
 a
(16)

for every admissible η.

4.4 Step 4: integrate by parts

The term involving ηcannot yet be handled directly by the Fundamental Lemma because the test function appears differentiated. Integrate that term by parts:

∫                      ∫
  b     ′          b     b d--
   Fy ′η dx  = [Fy′η ]a −     dxFy ′ ηdx.
 a                      a
(17)

Thus

                    ∫   (           )
                b     b        d--
δJ [y∗;η ] = [Fy′η]a +     Fy −  dxFy ′ η dx.
                     a
(18)

PIC

Figure. Integration by parts transfers the derivative from the arbitrary variation η onto the coefficient Fy. This creates both the interior Euler–Lagrange expression and a boundary term. Fixed endpoints remove the boundary term; free endpoints will not, which is the subject of CV05.

4.5 Step 5: use the fixed endpoints

Since

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

one has

     b
[Fy′η]a = 0.
(20)

Therefore stationarity reduces to

∫ b(            )
     Fy − -d-Fy′  η(x) dx = 0
 a        dx
(21)

for every admissible variation η.

This is the exact point at which the fixed-endpoint assumption enters the classical proof.

4.6 Step 6: apply the Fundamental Lemma

Define

                 ′    d--  ′       ′
g(x) = Fy (x, y∗,y∗) − dxFy (x,y∗,y∗) .
(22)

Under the stated smoothness assumptions, g is continuous. The stationarity condition says

∫
   b
    g(x)η(x)dx =  0
 a
(23)

for every admissible test function. In particular, it holds for every smooth compactly supported test function in (a,b). The Fundamental Lemma therefore gives

g (x ) = 0
(24)

for all x (a,b).

Consequently,

F  − -d-F ′ = 0.
 y   dx  y
(25)

This completes the proof.

5 What integration by parts is really doing

The first-variation formula contains two independent pieces of perturbation data: η and η. The Fundamental Lemma is designed for an integral of the form

∫ b
   g (x )η(x)dx =  0,
 a
(26)

not for an expression containing both η and η. Integration by parts reorganizes the first variation so that the arbitrary interior perturbation appears only as η.

This is why the operation is structural rather than cosmetic. It separates the first variation into

boundary  contribution + interior contribution.
(27)

The interior contribution produces the Euler–Lagrange differential equation. The boundary contribution produces endpoint conditions when the endpoints are not fixed.

This pattern reappears throughout mathematical physics. In field theory, multidimensional integration by parts separates bulk field equations from boundary terms. In finite-element and weak-form methods, the same operation reduces derivative requirements on the trial or test functions.

6 Anatomy of the Euler–Lagrange equation

For

F =  F (x, y,y′),
(28)

the equation is

     -d-
Fy − dx Fy′ = 0.
(29)

There are two different kinds of derivative in this expression.

6.1 Partial derivative with respect to y

The quantity

Fy =  ∂F--
      ∂y
(30)

means differentiate the function F(x,y,p) with respect to its second argument while holding the other arguments fixed.

6.2 Partial derivative with respect to the slope argument

Similarly,

Fy′ = ∂F--
      ∂y ′
(31)

means differentiate F with respect to its third argument.

6.3 Total derivative along the candidate curve

After Fy is formed, it becomes a function of x through

Fy′ = Fy′(x, y(x),y′(x )).
(32)

Its derivative in the Euler–Lagrange equation is therefore a total derivative:

d--                 ′       ′′
dxFy′ = Fxy′ + Fyy′y  + Fy′y′y .
(33)

Substitution gives the expanded form

                 ′        ′′
Fy − Fxy′ − Fyy′y − Fy′y′y  = 0.
(34)

This expansion is often useful when converting the variational condition into an explicit differential equation.

7 Regular and degenerate cases

If

Fy′y′ ⁄= 0,
(35)

then locally the expanded Euler–Lagrange equation can be solved for y′′:

 ′′   Fy-−-Fxy-′ −-Fyy′y′
y  =        Fy′y′       .
(36)

Such a problem is often called regular with respect to the slope variable. The Euler–Lagrange condition is then an ordinary second-order differential equation.

If

Fy′y′ = 0,
(37)

the equation can be degenerate. It may reduce to a first-order relation or an algebraic constraint rather than determining y′′. This is an early glimpse of the distinction between regular and singular variational problems.

8 A reliable calculation workflow

For practical calculations it is useful to separate the operations rather than trying to write the final differential equation from memory.

PIC

Figure. A robust Euler–Lagrange workflow. Treat F as a function of independent arguments, compute the two required partial derivatives, take the total x-derivative only after substituting the path dependence, and then assemble the equation.

The algorithm is

  1. Identify the integrand F(x,y,y).
  2. Compute Fy.
  3. Compute Fy.
  4. Compute the total derivative d(Fy)∕dx.
  5. Form
    F  − -d-F ′ = 0.
 y   dx  y
    (38)

  6. Solve the resulting differential equation subject to the original endpoint or boundary conditions.
  7. After finding a stationary curve, separately ask whether it is actually a minimum, maximum, or saddle-type stationary function.

9 Example 1: quadratic slope functional

Consider

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

with fixed endpoints

y(a) = A,     y(b) = B.
(40)

The integrand is

F (x,y,y′) = 1y′2.
             2
(41)

Therefore

                    ′
Fy  = 0,    Fy ′ = y .
(42)

The Euler–Lagrange equation gives

0 − -d-(y′) = 0,
    dx
(43)

so

 ′′
y  = 0.
(44)

Integrating twice,

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

The endpoint conditions determine the straight line

           B--−-A-
y(x) = A +  b − a (x − a).
(46)

CV01 already proved directly that this curve is the global minimizer of the quadratic slope functional. Here Euler–Lagrange recovers it as the stationary candidate.

This comparison is useful: Euler–Lagrange gives a necessary differential equation, while the direct square-completion or convexity argument establishes actual minimality.

10 Example 2: shortest planar curve

The length of a graph y(x) between fixed x-coordinates is

       ∫  b∘ -------
J [y ] =      1 + y′2 dx.
         a
(47)

Here

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

Since F does not depend explicitly on y,

Fy = 0.
(49)

Also,

      ---y-′---
Fy′ = ∘1--+-y′2.
(50)

Euler–Lagrange yields

   (          )
 d       y′
---   ∘--------  = 0.
dx      1 + y′2
(51)

Differentiate explicitly:

   (          )
 d       y′             y′′
---   ∘------′2-  = ------′2-3∕2.
dx      1 + y      (1 + y  )
(52)

Hence

y′′ = 0,
(53)

and the stationary curve is again a straight line.

CV04E2 will develop this problem in more detail, including the geometric interpretation and direct length comparison.

11 Example 3: a nonlinear integrand

Consider

       ∫ b(           )
J[y] =      1y ′4 + 1y2  dx.
        a   4      2
(54)

The integrand is

F =  1y′4 + 1y2.
     4      2
(55)

Therefore

              ′    ′3
Fy = y,     Fy  = y  .
(56)

Taking the total derivative,

-d-        ′2 ′′
dx Fy′ = 3y y  .
(57)

Thus the Euler–Lagrange equation is

       ′2 ′′
y − 3y  y  = 0.
(58)

This example illustrates why one should not assume that the Euler–Lagrange equation is linear. A simple-looking integral functional can produce a highly nonlinear differential equation.

12 Example 4: preview of classical mechanics

Let the independent variable be time t and consider the harmonic-oscillator action

      ∫
         t2
S[q] =    L (q, ˙q,t)dt,
        t1
(59)

with

          1       1
L (q, ˙q) = -m ˙q2 − -kq2.
          2       2
(60)

The Euler–Lagrange equation is now written

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

Compute

∂L- = − kq,     ∂L-=  m ˙q.
∂q              ∂q˙
(62)

Therefore

− kq − -d (m q˙) = 0,
       dt
(63)

or

m ¨q + kq = 0.
(64)

Thus the familiar differential equation for a harmonic oscillator is itself an Euler–Lagrange equation. CV14 will derive the full connection between Hamilton’s principle and Lagrange’s equations for many-degree-of-freedom mechanical systems.

13 Necessary does not mean sufficient

The theorem says

local extremum  =⇒  Euler–Lagrange  equation.
(65)

The converse is false in general.

A solution of the Euler–Lagrange equation is commonly called an extremal in classical terminology, even though it may not actually be a minimum or maximum. To avoid ambiguity, it is often helpful to say stationary extremal or Euler–Lagrange extremal when classification has not yet been established.

13.1 Stationary maximum

Consider

         ∫
           1 ′2
J[y] = −    y  dx
          0
(66)

with y(0) = y(1) = 0. The Euler–Lagrange equation is again

 ′′
y  = 0,
(67)

so the only endpoint-compatible stationary curve is y = 0. But now

J [y] ≤ 0 = J [0]
(68)

for every admissible y. Thus y = 0 is a global maximum, not a minimum.

13.2 Stationary saddle-type example

Consider

      ∫  1( ′2     2 2)
J[y] =     y  − 2π  y  dx
        0
(69)

with y(0) = y(1) = 0. The zero function satisfies the Euler–Lagrange equation and is stationary.

Now compare the two admissible directions

η1(x) = sin (πx),    η2(x ) = sin(2πx ).
(70)

For y = 𝜖η1,

           π2
J [𝜖η1] = − --𝜖2 < 0
           2
(71)

when 𝜖≠0, while for y = 𝜖η2,

J[𝜖η2] = π2𝜖2 > 0.
(72)

Therefore arbitrarily close admissible curves exist with both larger and smaller values of J. The stationary curve y = 0 is saddle-type.

                    direction η1: curves upward
                    direction η2: curves downward
−−−−−000001−−001a𝜖ΦS.....lt100002468105lηa..... h(t86425a𝜖)ivoe−naΦrΦηi′η(t(0y0))do=es0notdicrlaescstiiofny tηh3e: eflxattretmoa slecond order

Figure. Vanishing first variation means that every one-dimensional slice Φη(𝜖) = J[y + 𝜖η] has zero slope at 𝜖 = 0. It does not determine the curvature of those slices. Different directions can bend upward, downward, or remain flat to second order, so stationarity alone does not classify the extremal.

Second-variation theory begins in CV11 precisely because this classification question requires additional information.

14 Weak form and strong form

Before applying the Fundamental Lemma, stationarity can be written as

∫ b
    (Fy η + Fy′η′) dx = 0
 a
(73)

for every admissible test function η. This is a variational or weak-form statement.

After integration by parts and sufficient regularity, the Fundamental Lemma produces the pointwise differential equation

     -d-
Fy − dx Fy′ = 0.
(74)

This is the corresponding classical strong form.

In modern analysis, a function may satisfy the weak variational identity even when it does not possess enough classical derivatives for the strong equation to make pointwise sense. Under additional regularity, weak solutions can often be shown to satisfy the strong equation. This weak-to-strong relationship is a major bridge from the calculus of variations to partial differential equations and finite-element methods.

15 Functional derivative notation

For a first-order functional, one often writes

δJ-        -d-
δy =  Fy − dx Fy′.
(75)

Then the first variation may be represented schematically as

          ∫
             bδJ-
δJ [y;η ] =    δy η dx
            a
(76)

when the appropriate boundary term vanishes.

The notation is useful, but it hides the integration-by-parts step. In full,

                   ∫  b
δJ [y; η] = [Fy′η]b+    δJ-η dx.
                a    a δy
(77)

Thus the functional derivative captures the interior coefficient of the variation. Boundary conditions must still be handled separately.

This distinction becomes essential in CV05, field theory, and Hamiltonian mechanics.

16 Why endpoint conditions are not bookkeeping

The fixed-endpoint proof used

η(a) = η(b) = 0
(78)

only after integration by parts. If an endpoint is free, the term

      b
[Fy′η]a
(79)

does not automatically vanish.

Stationarity must then control both the interior integral and the boundary contribution. The interior still yields the Euler–Lagrange equation, while the boundary term yields a natural boundary condition. If an endpoint is allowed to move along a prescribed curve, still more general transversality conditions appear.

This is why the admissible class introduced in CV01 is part of the theorem itself. Changing the endpoint freedom changes the necessary conditions.

17 Dimensional consistency

In physical applications the two terms of the Euler–Lagrange equation must have the same dimensions.

If x has dimensions [x], y has dimensions [y], and F has dimensions [F], then

       [F-]
[Fy] = [y] .
(80)

Since

  ′   [y]
[y ] = [x],
(81)

one has

       [F ][x]
[Fy ′] = ------.
         [y]
(82)

Taking d∕dx gives

[ d    ]   [F ]
 ---Fy′  = ----,
 dx         [y ]
(83)

matching [Fy]. This provides a quick error check in mechanics, optics, and engineering applications.

18 Common mistakes

18.1 Mistake 1: using a partial derivative where a total derivative is required

The equation contains

d--  ′
dxFy ,
(84)

not merely ∂Fy∕∂x. The quantity Fy also changes because y(x) and y(x) change.

18.2 Mistake 2: dropping the boundary term before integrating by parts

The boundary term must first be produced. It vanishes only because of the specific endpoint conditions of the problem.

18.3 Mistake 3: treating yas dependent on y when computing partial derivatives

When computing Fy and Fy, treat x, y, and yas independent arguments of F. Their path dependence is reintroduced when taking the total x-derivative.

18.4 Mistake 4: believing every Euler–Lagrange solution is a minimum

Euler–Lagrange is a stationarity condition. A stationary curve can be a minimum, maximum, or saddle-type extremal.

18.5 Mistake 5: forgetting the original endpoint conditions

The differential equation produces a family of candidate solutions. The original boundary data select the admissible members of that family.

18.6 Mistake 6: cancelling the variation from the integral

From

∫  b
    g(x)η(x)dx =  0
 a
(85)

one cannot algebraically cancel η. The conclusion g = 0 follows from the Fundamental Lemma and the richness of the test-function class.

18.7 Mistake 7: confusing existence with stationarity

Even if the Euler–Lagrange boundary-value problem has a formal solution, a minimizer of the original variational problem need not exist under arbitrary hypotheses. Existence is a separate question involving compactness, coercivity, and lower semicontinuity in more advanced theory.

19 A compact theorem checklist

When using Euler–Lagrange, ask the following questions.

  1. What is the admissible class?
  2. Are the endpoints fixed or free?
  3. Is the candidate regular enough for the classical theorem?
  4. What is the integrand F(x,y,y)?
  5. What are Fy and Fy?
  6. Did I take a total derivative of Fy?
  7. What boundary conditions must the resulting ODE satisfy?
  8. Have I shown only stationarity, or have I actually proved minimality?

Keeping these questions separate prevents most common variational mistakes.

20 What CV05 and CV06 add

CV04 has used fixed endpoints to eliminate the boundary term

[Fy′η ]ba .
(86)

CV05 removes that simplification. Free endpoints, movable endpoints, and endpoints constrained to curves produce natural boundary and transversality conditions.

CV06 then studies special forms of the Euler–Lagrange equation. If the integrand lacks explicit dependence on certain variables, the differential equation admits first integrals such as the Beltrami identity. These conservation-like reductions are especially important in the catenary, brachistochrone, mechanics, and optics.

21 Summary

For the classical fixed-endpoint functional

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

a sufficiently smooth local extremum must satisfy the Euler–Lagrange equation

Fy − -d-Fy′ = 0.
     dx
(88)

The derivation is

local extremum   =⇒  δJ = 0 = ⇒ integration by parts =⇒  Fundamental  Lemma   = ⇒  Euler–Lagrange.
(89)

Integration by parts separates boundary and interior behavior. Fixed endpoints remove the boundary term, while the Fundamental Lemma converts the remaining integral identity into a pointwise differential equation.

The resulting equation is a necessary condition for stationarity, not a proof of minimality. Classification, existence, boundary freedom, conservation laws, and physical specialization all require additional theory developed in the following entries.

22 References and further reading

  • I. M. Gelfand and S. V. Fomin, Calculus of Variations.
  • B. van Brunt, The Calculus of Variations.
  • C. Fox, An Introduction to the Calculus of Variations.
  • C. Lanczos, The Variational Principles of Mechanics.
  • H. Goldstein, C. Poole, and J. Safko, Classical Mechanics.
  • L. C. Evans, Partial Differential Equations, for weak formulations and the modern variational viewpoint.

"Calculus of Variations: The Euler--Lagrange equation" is owned by bloftin.
(view preamble)
View style:
Keywords:  calculus of variations, Euler-Lagrange equation, first variation, Fundamental Lemma, integration by parts, stationary function, extremal, functional derivative, weak form, strong form

Cross-references: catenary, mechanics, Hamiltonian, partial differential equations, systems, Hamilton's principle, graph, algorithm, algebraic, relation, second-order differential equation, regular, mathematical physics, differential equation, scalar, sections, operations, implication, boundary, identity, theorem, formula, geodesics, field, energy, motion, Lagrange's equation, Lagrangian, function

This is version 1 of Calculus of Variations: The Euler--Lagrange equation, born on 2026-09-02.
Object id is 1140, canonical name is CalculusOfVariationsTheEulerLagrangeEquation.
Accessed 4 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)