User:Bob K31416/EL

Euler–Lagrange equation
Under ideal conditions, the maxima and minima of a given function may be located by finding the points where its derivative vanishes (i.e., is equal to zero). By analogy, solutions of smooth variational problems may be obtained by solving the associated Euler–Lagrange equation.

Consider the functional


 * $$ A[f] = \int_{x_1}^{x_2} L[x,f(x),f'(x)]\, dx  \,$$

where $$f'(x) = \frac{df}{dx} $$ and where $$x_1$$ and $$x_2$$ are constants.

The function $$f$$ should have at least one derivative in order to satisfy the requirements for valid application of the function; further, if the functional $$A[f]$$ attains its local minimum at $$f_0$$  and $$\eta(x)$$ is an arbitrary function that has at least one derivative and vanishes at the endpoints $$ x_1$$ and $$ x_2$$, then we must have
 * $$A[f_0] \le A[f_0 + \epsilon \eta]$$

for any number ε close to 0. Therefore, with $$f = f_0 + \epsilon\eta$$  the first variation of A must vanish,



\left.\frac{dA[f_0 + \epsilon \eta]}{d\epsilon}\right|_{\epsilon = 0} = \int_{x_1}^{x_2} \left.\frac{dL}{d\epsilon}\right|_{\epsilon = 0} dx = 0 $$.

Since $$L$$ is a function of $$f$$ and $$f'$$,



\frac{dL}{d\epsilon}=\frac{\partial L}{\partial f}\frac{df}{d\epsilon} + \frac{\partial L}{\partial f'}\frac{df'}{d\epsilon} $$.

Therefore,



\begin{align} \int_{x_1}^{x_2} \left.\frac{dL}{d\epsilon}\right|_{\epsilon = 0} dx & = \int_{x_1}^{x_2} \left(\frac{\partial L}{\partial f} \eta + \frac{\partial L}{\partial f'} \eta'\right)\, dx \\ & = \int_{x_1}^{x_2} \left(\frac{\partial L}{\partial f} \eta - \eta \frac{d}{dx}\frac{\partial L}{\partial f'} \right)\, dx + \left.\frac{\partial L}{\partial f'} \eta \right|_{x_1}^{x_2}\\ & = \int_{x_1}^{x_2} \eta \left(\frac{\partial L}{\partial f} - \frac{d}{dx}\frac{\partial L}{\partial f'} \right)\, dx \\ & = 0, \end{align} $$

where we have used the chain rule in the second line and integration by parts in the third. The last term in the third line vanishes because $$\eta \equiv 0$$ at the end points. Finally, according to the fundamental lemma of calculus of variations, we find that $$L$$ will satisfy the Euler–Lagrange equation


 * $$ \frac{\partial L}{\partial f} -\frac{d}{dx} \frac{\partial L}{\partial f'}=0,$$

In general this gives a second-order ordinary differential equation which can be solved to obtain the extremal $$f$$. The Euler–Lagrange equation is a necessary, but not sufficient, condition for an extremal. Sufficient conditions for an extremal are discussed in the references.

In order to illustrate this process, consider the problem of finding the shortest curve in the plane that connects two points $$(x_1, y_1)$$ and $$(x_2, y_2)$$. The arc length is given by


 * $$ A[f] = \int_{x_1}^{x_2} \sqrt{1 + [ f'(x) ]^2} \, dx, $$

with
 * $$ f'(x) = \frac{df}{dx}, \,$$

and where $$y=f(x)$$, $$f(x_1)=y_1$$, and $$f(x_2)=y_2$$.


 * $$ \int_{x_1}^{x_2} \frac{ f_0'(x) \eta'(x) } {\sqrt{1 + [ f_0'(x) ]^2}}\,dx =0, \,$$

for any choice of the function $$\eta$$. We may interpret this condition as the vanishing of all directional derivatives of $$A[f_0]$$ in the space of differentiable functions, and this is formalized by requiring the Fréchet derivative of $$A$$ to vanish at $$f_0$$. If we assume that $$f_0$$ has two continuous derivatives (or if we consider weak derivatives), then we may use integration by parts:


 * $$\int_a^b u(x) \eta'(x)\,dx = \left[ u(x) \eta(x) \right]_{a}^{b} - \int_a^b u'(x) \eta(x)\,dx$$

with the substitution


 * $$u(x)=\frac{ f_0'(x)} {\sqrt{1 + [ f_0'(x) ]^2}} $$

then we have


 * $$ \left[ u(x) \eta(x) \right]_{x_1}^{x_2} - \int_{x_1}^{x_2} \eta(x) \frac{d}{dx}\left[ \frac{ f_0'(x) } {\sqrt{1 + [ f_0'(x) ]^2}} \right] \, dx =0, $$

but the first term is zero since $$v(x)=\eta(x)$$ was chosen to vanish at $$x_1$$ and $$x_2$$ where the evaluation is taken. Therefore,


 * $$\int_{x_1}^{x_2} \eta(x) \frac{d}{dx}\left[ \frac{ f_0'(x) } {\sqrt{1 + [ f_0'(x) ]^2}} \right] \, dx =0$$

for any twice differentiable function $$\eta$$ that vanishes at the endpoints of the interval.

We can now apply the fundamental lemma of calculus of variations: If


 * $$ I =\int_{x_1}^{x_2} \eta(x) H(x)\, dx =0 \,$$

for any sufficiently differentiable function $$\eta(x)$$ within the integration range that vanishes at the endpoints of the interval, then it follows that $$H(x)$$ is identically zero on its domain.

Therefore,


 * $$ \frac{d}{dx}\left[ \frac{ f_0'(x) } {\sqrt{1 + [ f_0'(x) ]^2}} \right] =0.\,$$

It follows from this equation that
 * $$\frac{d^2 f_0}{dx^2}=0,$$

and hence the extremals are straight lines.