linguistic:voice_change, information:filtering, stylistic:style_transfer, information:highlighting
Euler–Lagrange equation

Finding the extrema of functionals is similar to finding the maxima and minima of functions. The maxima and minima of a function may be located by finding the points where its derivative vanishes (i.e., is equal to zero). The extrema of functionals may be obtained by finding functions for which the functional derivative is equal to zero. This leads to solving the associated Euler–Lagrange equation.

Consider the functional

where

If the functional J {\displaystyle J} attains a local minimum at f, {\displaystyle f,} and η (x) {\displaystyle \eta (x)} is an arbitrary function that has at least one derivative and vanishes at the endpoints x 1 {\displaystyle x_{1}} and x 2, {\displaystyle x_{2},} then for any number ε {\displaystyle \varepsilon } close to 0,

The term ε η {\displaystyle \varepsilon \eta } is called the variation of the function f {\displaystyle f} and is denoted by δ f. {\displaystyle \delta f.}

Substituting f + ε η {\displaystyle f+\varepsilon \eta } for y {\displaystyle y} in the functional J, {\displaystyle J,} the result is a function of ε, {\displaystyle \varepsilon,}

Since the functional J {\displaystyle J} has a minimum for y = f {\displaystyle y=f} the function Φ (ε) {\displaystyle \Phi (\varepsilon)} has a minimum at ε = 0 {\displaystyle \varepsilon =0} and thus,

Taking the total derivative of L, {\displaystyle L\left,} where y = f + ε η {\displaystyle y=f+\varepsilon \eta } and y ′ = f ′ + ε η ′ {\displaystyle y'=f'+\varepsilon \eta '} are considered as functions of ε {\displaystyle \varepsilon } rather than x, {\displaystyle x,} yields

and because d y d ε = η {\displaystyle {\frac {dy}{d\varepsilon }}=\eta } and d y ′ d ε = η ′, {\displaystyle {\frac {dy'}{d\varepsilon }}=\eta ',}

Therefore,

where L → L {\displaystyle L\left\to L\left} when ε = 0 {\displaystyle \varepsilon =0} and we have used integration by parts on the second term. The second term on the second line vanishes because η = 0 {\displaystyle \eta =0} at x 1 {\displaystyle x_{1}} and x 2 {\displaystyle x_{2}} by definition. Also, as previously mentioned the left side of the equation is zero so that

According to the fundamental lemma of calculus of variations, the part of the integrand in parentheses is zero, i.e.

which is called the Euler–Lagrange equation. The left hand side of this equation is called the functional derivative of J {\displaystyle J} and is denoted δ J / δ f (x). {\displaystyle \delta J/\delta f(x).}

In general this gives a second-order ordinary differential equation which can be solved to obtain the extremal function f (x). {\displaystyle f(x).} The Euler–Lagrange equation is a necessary, but not sufficient, condition for an extremum J. {\displaystyle J.} A sufficient condition for a minimum is given in the section Variations and sufficient condition for a minimum.