In the calculus of variations, the Euler–Lagrange equation, Euler's equation,^{[1]} or Lagrange's equation (although the latter name is ambiguous—see disambiguation page), is a secondorder partial differential equation whose solutions are the functions for which a given functional is stationary. It was developed by Swiss mathematician Leonhard Euler and ItalianFrench mathematician JosephLouis Lagrange in the 1750s.
Because a differentiable functional is stationary at its local maxima and minima, the Euler–Lagrange equation is useful for solving optimization problems in which, given some functional, one seeks the function minimizing or maximizing it. This is analogous to Fermat's theorem in calculus, stating that at any point where a differentiable function attains a local extremum its derivative is zero.
In Lagrangian mechanics, because of Hamilton's principle of stationary action, the evolution of a physical system is described by the solutions to the Euler–Lagrange equation for the action of the system. In classical mechanics, it is equivalent to Newton's laws of motion, but it has the advantage that it takes the same form in any system of generalized coordinates, and it is better suited to generalizations. In classical field theory there is an analogous equation to calculate the dynamics of a field.
History
The Euler–Lagrange equation was developed in the 1750s by Euler and Lagrange in connection with their studies of the tautochrone problem. This is the problem of determining a curve on which a weighted particle will fall to a fixed point in a fixed amount of time, independent of the starting point.
Lagrange solved this problem in 1755 and sent the solution to Euler. Both further developed Lagrange's method and applied it to mechanics, which led to the formulation of Lagrangian mechanics. Their correspondence ultimately led to the calculus of variations, a term coined by Euler himself in 1766.^{[2]}
Statement
The Euler–Lagrange equation is an equation satisfied by a function q of a real argument t, which is a stationary point of the functional
 $\displaystyle S({\boldsymbol {q}})=\int _{a}^{b}L(t,{\boldsymbol {q}}(t),{\boldsymbol {\dot {q}}}(t))\,\mathrm {d} t$
where:
 ${\boldsymbol {q}}$ is the function to be found:
 ${\begin{aligned}{\boldsymbol {q}}\colon [a,b]\subset \mathbb {R} &\to X\\t&\mapsto x={\boldsymbol {q}}(t)\end{aligned}}$
 such that ${\boldsymbol {q}}$ is differentiable, ${\boldsymbol {q}}(a)={\boldsymbol {x}}_{a}$, and ${\boldsymbol {q}}(b)={\boldsymbol {x}}_{b}$;
 ${\boldsymbol {\dot {q}}}$; is the derivative of ${\boldsymbol {q}}$:
 ${\begin{aligned}{\dot {q}}\colon [a,b]&\to T_{q(t)}X\\t&\mapsto v={\dot {q}}(t)\end{aligned}}$
 $T_{q(t)}X$ denotes the tangent space to $X$ at the point $q(t)$.
 $L$ is a realvalued function with continuous first partial derivatives:
 ${\begin{aligned}L\colon [a,b]\times TX&\to \mathbb {R} \\(t,x,v)&\mapsto L(t,x,v).\end{aligned}}$
 $TX$ being the tangent bundle of $X$ defined by
 $TX=\bigcup _{x\in X}\{x\}\times T_{x}X$ ;
The Euler–Lagrange equation, then, is given by

$L_{x}(t,q(t),{\dot {q}}(t)){\frac {\mathrm {d} }{\mathrm {d} t}}L_{v}(t,q(t),{\dot {q}}(t))=0.$

where $L_{x}$ and $L_{v}$ denote the partial derivatives of $L$ with respect to the second and third arguments, respectively.
If the dimension of the space $X$ is greater than 1, this is a system of differential equations, one for each component:
 ${\frac {\partial L}{\partial q_{i}}}(t,{\boldsymbol {q}}(t),{\boldsymbol {\dot {q}}}(t)){\frac {\mathrm {d} }{\mathrm {d} t}}{\frac {\partial L}{\partial {\dot {q}}_{i}}}(t,{\boldsymbol {q}}(t),{\boldsymbol {\dot {q}}}(t))=0\quad {\text{for }}i=1,\dots ,n.$

Derivation of onedimensional Euler–Lagrange equation 
The derivation of the onedimensional Euler–Lagrange equation is one of the classic proofs in mathematics. It relies on the fundamental lemma of calculus of variations.
We wish to find a function $f$ which satisfies the boundary conditions $f(a)=A$, $f(b)=B$, and which extremizes the functional
 $J=\int _{a}^{b}F(x,f(x),f'(x))\,\mathrm {d} x\ .$
We assume that $F$ is twice continuously differentiable.^{[3]} A weaker assumption can be used, but the proof becomes more difficult.^{[citation needed]}
If $f$ extremizes the functional subject to the boundary conditions, then any slight perturbation of $f$ that preserves the boundary values must either increase $J$ (if $f$ is a minimizer) or decrease $J$ (if $f$ is a maximizer).
Let $g_{\varepsilon }(x)=f(x)+\varepsilon \eta (x)$ be the result of such a perturbation $\varepsilon \eta (x)$ of $f$, where $\varepsilon$ is small and $\eta (x)$ is a differentiable function satisfying $\eta (a)=\eta (b)=0$. Then define
 $J_{\varepsilon }=\int _{a}^{b}F(x,g_{\varepsilon }(x),g_{\varepsilon }'(x))\,\mathrm {d} x=\int _{a}^{b}F_{\varepsilon }\,\mathrm {d} x$
where $F_{\varepsilon }=F(x,\,g_{\varepsilon }(x),\,g_{\varepsilon }'(x))$ .
We now wish to calculate the total derivative of $J_{\varepsilon }$ with respect to ε.
 ${\frac {\mathrm {d} J_{\varepsilon }}{\mathrm {d} \varepsilon }}={\frac {\mathrm {d} }{\mathrm {d} \varepsilon }}\int _{a}^{b}F_{\varepsilon }\,\mathrm {d} x=\int _{a}^{b}{\frac {\mathrm {d} F_{\varepsilon }}{\mathrm {d} \varepsilon }}\,\mathrm {d} x$
It follows from the total derivative that
 ${\begin{aligned}{\frac {\mathrm {d} F_{\varepsilon }}{\mathrm {d} \varepsilon }}&={\frac {\mathrm {d} x}{\mathrm {d} \varepsilon }}{\frac {\partial F_{\varepsilon }}{\partial x}}+{\frac {\mathrm {d} g_{\varepsilon }}{\mathrm {d} \varepsilon }}{\frac {\partial F_{\varepsilon }}{\partial g_{\varepsilon }}}+{\frac {\mathrm {d} g_{\varepsilon }'}{\mathrm {d} \varepsilon }}{\frac {\partial F_{\varepsilon }}{\partial g_{\varepsilon }'}}\\&={\frac {\mathrm {d} g_{\varepsilon }}{\mathrm {d} \varepsilon }}{\frac {\partial F_{\varepsilon }}{\partial g_{\varepsilon }}}+{\frac {\mathrm {d} g'_{\varepsilon }}{\mathrm {d} \varepsilon }}{\frac {\partial F_{\varepsilon }}{\partial g'_{\varepsilon }}}\\&=\eta (x){\frac {\partial F_{\varepsilon }}{\partial g_{\varepsilon }}}+\eta '(x){\frac {\partial F_{\varepsilon }}{\partial g_{\varepsilon }'}}\ .\\\end{aligned}}$
So
 ${\frac {\mathrm {d} J_{\varepsilon }}{\mathrm {d} \varepsilon }}=\int _{a}^{b}\left[\eta (x){\frac {\partial F_{\varepsilon }}{\partial g_{\varepsilon }}}+\eta '(x){\frac {\partial F_{\varepsilon }}{\partial g_{\varepsilon }'}}\,\right]\,\mathrm {d} x\ .$
When ε = 0 we have g_{ε} = f, F_{ε} = F(x, f(x), f'(x)) and J_{ε} has an extremum value, so that
 ${\frac {\mathrm {d} J_{\varepsilon }}{\mathrm {d} \varepsilon }}{\bigg }_{\varepsilon =0}=\int _{a}^{b}\left[\eta (x){\frac {\partial F}{\partial f}}+\eta '(x){\frac {\partial F}{\partial f'}}\,\right]\,\mathrm {d} x=0\ .$
The next step is to use integration by parts on the second term of the integrand, yielding
 $\int _{a}^{b}\left[{\frac {\partial F}{\partial f}}{\frac {\mathrm {d} }{\mathrm {d} x}}{\frac {\partial F}{\partial f'}}\right]\eta (x)\,\mathrm {d} x+\left[\eta (x){\frac {\partial F}{\partial f'}}\right]_{a}^{b}=0\ .$
Using the boundary conditions $\eta (a)=\eta (b)=0$,
 $\int _{a}^{b}\left[{\frac {\partial F}{\partial f}}{\frac {\mathrm {d} }{\mathrm {d} x}}{\frac {\partial F}{\partial f'}}\right]\eta (x)\,\mathrm {d} x=0\ .$
Applying the fundamental lemma of calculus of variations now yields the Euler–Lagrange equation
 ${\frac {\partial F}{\partial f}}{\frac {\mathrm {d} }{\mathrm {d} x}}{\frac {\partial F}{\partial f'}}=0\ .$


Alternate derivation of onedimensional Euler–Lagrange equation 
Given a functional
 $J=\int _{a}^{b}F(t,y(t),y'(t))\,\mathrm {d} t$
on $C^{1}([a,b])$ with the boundary conditions $y(a)=A$ and $y(b)=B$, we proceed by approximating the extremal curve by a polygonal line with $n$ segments and passing to the limit as the number of segments grows arbitrarily large.
Divide the interval $[a,b]$ into $n$ equal segments with endpoints $t_{0}=a,t_{1},t_{2},\ldots ,t_{n}=b$ and let $\Delta t=t_{k}t_{k1}$. Rather than a smooth function $y(t)$ we consider the polygonal line with vertices $(t_{0},y_{0}),\ldots ,(t_{n},y_{n})$, where $y_{0}=A$ and $y_{n}=B$. Accordingly, our functional becomes a real function of $n1$ variables given by
 $J(y_{1},\ldots ,y_{n1})\approx \sum _{k=0}^{n1}F\left(t_{k},y_{k},{\frac {y_{k+1}y_{k}}{\Delta t}}\right)\Delta t.$
Extremals of this new functional defined on the discrete points $t_{0},\ldots ,t_{n}$ correspond to points where
 ${\frac {\partial J(y_{1},\ldots ,y_{n})}{\partial y_{m}}}=0.$
Evaluating this partial derivative gives
 ${\frac {\partial J}{\partial y_{m}}}=F_{y}\left(t_{m},y_{m},{\frac {y_{m+1}y_{m}}{\Delta t}}\right)\Delta t+F_{y'}\left(t_{m1},y_{m1},{\frac {y_{m}y_{m1}}{\Delta t}}\right)F_{y'}\left(t_{m},y_{m},{\frac {y_{m+1}y_{m}}{\Delta t}}\right).$
Dividing the above equation by $\Delta t$ gives
 ${\frac {\partial J}{\partial y_{m}\Delta t}}=F_{y}\left(t_{m},y_{m},{\frac {y_{m+1}y_{m}}{\Delta t}}\right){\frac {1}{\Delta t}}\left[F_{y'}\left(t_{m},y_{m},{\frac {y_{m+1}y_{m}}{\Delta t}}\right)F_{y'}\left(t_{m1},y_{m1},{\frac {y_{m}y_{m1}}{\Delta t}}\right)\right],$
and taking the limit as $\Delta t\to 0$ of the righthand side of this expression yields
 $F_{y}{\frac {\mathrm {d} }{\mathrm {d} t}}F_{y'}=0.$
The left hand side of the previous equation is the functional derivative $\delta J/\delta y$ of the functional $J$. A necessary condition for a differentiable functional to have an extremum on some function is that its functional derivative at that function vanishes, which is granted by the last equation.

Examples
A standard example is finding the realvalued function f on the interval [a, b], such that f(a) = c and f(b) = d, for which the path length along the curve traced by f is as short as possible.
 ${\text{ds}}=\int _{a}^{b}{\sqrt {1+y'^{2}}}\,\mathrm {d} x,$
the integrand function being L(x, y, y′) = √1 + y′ ² .
The partial derivatives of L are:
 ${\frac {\partial F(x,y,y')}{\partial y'}}={\frac {y'}{\sqrt {1+y'^{2}}}}\quad {\text{and}}\quad {\frac {\partial F(x,y,y')}{\partial y}}=0.$
By substituting these into the Euler–Lagrange equation, we obtain
 ${\begin{aligned}{\frac {\mathrm {d} }{\mathrm {d} x}}{\frac {y'(x)}{\sqrt {1+(y'(x))^{2}}}}&=0\\{\frac {y'(x)}{\sqrt {1+(y'(x))^{2}}}}&=C={\text{constant}}\\\Rightarrow y'(x)&={\frac {C}{\sqrt {1C^{2}}}}:=A\\\Rightarrow y(x)&=Ax+B\end{aligned}}$
that is, the function must have constant first derivative, and thus its graph is a straight line.
Generalizations for several functions, several variables, and higher derivatives
Single function of single variable with higher derivatives
The stationary values of the functional
 $I[f]=\int _{x_{0}}^{x_{1}}{\mathcal {L}}(x,f,f',f'',\dots ,f^{(k)})~\mathrm {d} x~;~~f':={\cfrac {\mathrm {d} f}{\mathrm {d} x}},~f'':={\cfrac {\mathrm {d} ^{2}f}{\mathrm {d} x^{2}}},~f^{(k)}:={\cfrac {\mathrm {d} ^{k}f}{\mathrm {d} x^{k}}}$
can be obtained from the Euler–Lagrange equation^{[4]}
 ${\cfrac {\partial {\mathcal {L}}}{\partial f}}{\cfrac {\mathrm {d} }{\mathrm {d} x}}\left({\cfrac {\partial {\mathcal {L}}}{\partial f'}}\right)+{\cfrac {\mathrm {d} ^{2}}{\mathrm {d} x^{2}}}\left({\cfrac {\partial {\mathcal {L}}}{\partial f''}}\right)\dots +(1)^{k}{\cfrac {\mathrm {d} ^{k}}{\mathrm {d} x^{k}}}\left({\cfrac {\partial {\mathcal {L}}}{\partial f^{(k)}}}\right)=0$
under fixed boundary conditions for the function itself as well as for the first $k1$ derivatives (i.e. for all $f^{(i)},i\in \{0,...,k1\}$). The endpoint values of the highest derivative $f^{(k)}$ remain flexible.
Several functions of single variable with single derivative
If the problem involves finding several functions ($f_{1},f_{2},\dots ,f_{m}$) of a single independent variable ($x$) that define an extremum of the functional
 $I[f_{1},f_{2},\dots ,f_{m}]=\int _{x_{0}}^{x_{1}}{\mathcal {L}}(x,f_{1},f_{2},\dots ,f_{m},f_{1}',f_{2}',\dots ,f_{m}')~\mathrm {d} x~;~~f_{i}':={\cfrac {\mathrm {d} f_{i}}{\mathrm {d} x}}$
then the corresponding Euler–Lagrange equations are^{[5]}
 ${\begin{aligned}{\frac {\partial {\mathcal {L}}}{\partial f_{i}}}{\frac {\mathrm {d} }{\mathrm {d} x}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{i}'}}\right)=0_{i}\end{aligned}}$
Single function of several variables with single derivative
A multidimensional generalization comes from considering a function on n variables. If $\Omega$ is some surface, then
 $I[f]=\int _{\Omega }{\mathcal {L}}(x_{1},\dots ,x_{n},f,f_{,1},\dots ,f_{,n})\,\mathrm {d} \mathbf {x} \,\!~;~~f_{,j}:={\cfrac {\partial f}{\partial x_{j}}}$
is extremized only if f satisfies the partial differential equation
 ${\frac {\partial {\mathcal {L}}}{\partial f}}\sum _{j=1}^{n}{\frac {\partial }{\partial x_{j}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,j}}}\right)=0.$
When n = 2 and functional I is the energy functional, this leads to the soapfilm minimal surface problem.
Several functions of several variables with single derivative
If there are several unknown functions to be determined and several variables such that
 $I[f_{1},f_{2},\dots ,f_{m}]=\int _{\Omega }{\mathcal {L}}(x_{1},\dots ,x_{n},f_{1},\dots ,f_{m},f_{1,1},\dots ,f_{1,n},\dots ,f_{m,1},\dots ,f_{m,n})\,\mathrm {d} \mathbf {x} \,\!~;~~f_{i,j}:={\cfrac {\partial f_{i}}{\partial x_{j}}}$
the system of Euler–Lagrange equations is^{[4]}
 ${\begin{aligned}{\frac {\partial {\mathcal {L}}}{\partial f_{1}}}\sum _{j=1}^{n}{\frac {\partial }{\partial x_{j}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{1,j}}}\right)&=0_{1}\\{\frac {\partial {\mathcal {L}}}{\partial f_{2}}}\sum _{j=1}^{n}{\frac {\partial }{\partial x_{j}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{2,j}}}\right)&=0_{2}\\\vdots \qquad \vdots \qquad &\quad \vdots \\{\frac {\partial {\mathcal {L}}}{\partial f_{m}}}\sum _{j=1}^{n}{\frac {\partial }{\partial x_{j}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{m,j}}}\right)&=0_{m}.\end{aligned}}$
Single function of two variables with higher derivatives
If there is a single unknown function f to be determined that is dependent on two variables x_{1} and x_{2} and if the functional depends on higher derivatives of f up to nth order such that
 ${\begin{aligned}I[f]&=\int _{\Omega }{\mathcal {L}}(x_{1},x_{2},f,f_{,1},f_{,2},f_{,11},f_{,12},f_{,22},\dots ,f_{,22\dots 2})\,\mathrm {d} \mathbf {x} \\&\qquad \quad f_{,i}:={\cfrac {\partial f}{\partial x_{i}}}\;,\quad f_{,ij}:={\cfrac {\partial ^{2}f}{\partial x_{i}\partial x_{j}}}\;,\;\;\dots \end{aligned}}$
then the Euler–Lagrange equation is^{[4]}
 ${\begin{aligned}{\frac {\partial {\mathcal {L}}}{\partial f}}&{\frac {\partial }{\partial x_{1}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,1}}}\right){\frac {\partial }{\partial x_{2}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,2}}}\right)+{\frac {\partial ^{2}}{\partial x_{1}^{2}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,11}}}\right)+{\frac {\partial ^{2}}{\partial x_{1}\partial x_{2}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,12}}}\right)+{\frac {\partial ^{2}}{\partial x_{2}^{2}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,22}}}\right)\\&\dots +(1)^{k}{\frac {\partial ^{k}}{\partial x_{2}^{k}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,22\dots 2}}}\right)=0\end{aligned}}$
which can be represented shortly as:
 ${\frac {\partial {\mathcal {L}}}{\partial f}}+\sum _{j=1}^{n}\sum _{\mu _{1}\leq \ldots \leq \mu _{j}}(1)^{j}{\frac {\partial ^{j}}{\partial x_{\mu _{1}}\dots \partial x_{\mu _{j}}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{,\mu _{1}\dots \mu _{j}}}}\right)=0$
wherein $\mu _{1}\dots \mu _{j}$ are indices that span the number of variables, that is, here they go from 1 to 2. Here summation over the $\mu _{1}\dots \mu _{j}$ indices is only over $\mu _{1}\leq \mu _{2}\leq \ldots \leq \mu _{j}$ in order to avoid counting the same partial derivative multiple times, for example $f_{,12}=f_{,21}$ appears only once in the previous equation.
Several functions of several variables with higher derivatives
If there are p unknown functions f_{i} to be determined that are dependent on m variables x_{1} ... x_{m} and if the functional depends on higher derivatives of the f_{i} up to nth order such that
 ${\begin{aligned}I[f_{1},\ldots ,f_{p}]&=\int _{\Omega }{\mathcal {L}}(x_{1},\ldots ,x_{m};f_{1},\ldots ,f_{p};f_{1,1},\ldots ,f_{p,m};f_{1,11},\ldots ,f_{p,mm};\ldots ;f_{p,m\ldots m})\,\mathrm {d} \mathbf {x} \\&\qquad \quad f_{i,\mu }:={\cfrac {\partial f_{i}}{\partial x_{\mu }}}\;,\quad f_{i,\mu _{1}\mu _{2}}:={\cfrac {\partial ^{2}f_{i}}{\partial x_{\mu _{1}}\partial x_{\mu _{2}}}}\;,\;\;\dots \end{aligned}}$
where $\mu _{1}\dots \mu _{j}$ are indices that span the number of variables, that is they go from 1 to m. Then the Euler–Lagrange equation is
 ${\frac {\partial {\mathcal {L}}}{\partial f_{i}}}+\sum _{j=1}^{n}\sum _{\mu _{1}\leq \ldots \leq \mu _{j}}(1)^{j}{\frac {\partial ^{j}}{\partial x_{\mu _{1}}\dots \partial x_{\mu _{j}}}}\left({\frac {\partial {\mathcal {L}}}{\partial f_{i,\mu _{1}\dots \mu _{j}}}}\right)=0$
where the summation over the $\mu _{1}\dots \mu _{j}$ is avoiding counting the same derivative $f_{i,\mu _{1}\mu _{2}}=f_{i,\mu _{2}\mu _{1}}$ several times, just as in the previous subsection. This can be expressed more compactly as
 $\sum _{j=0}^{n}\sum _{\mu _{1}\leq \ldots \leq \mu _{j}}(1)^{j}\partial _{\mu _{1}\ldots \mu _{j}}^{j}\left({\frac {\partial {\mathcal {L}}}{\partial f_{i,\mu _{1}\dots \mu _{j}}}}\right)=0$
Generalization to manifolds
Let $M$ be a smooth manifold, and let $C^{\infty }([a,b])$ denote the space of smooth functions $f:[a,b]\to M$. Then, for functionals $S:C^{\infty }([a,b])\to \mathbb {R}$ of the form
 $S[f]=\int _{a}^{b}(L\circ {\dot {f}})(t)\,\mathrm {d} t$
where $L:TM\to \mathbb {R}$ is the Lagrangian, the statement $\mathrm {d} S_{f}=0$ is equivalent to the statement that, for all $t\in [a,b]$, each coordinate frame trivialization $(x^{i},X^{i})$ of a neighborhood of ${\dot {f}}(t)$ yields the following $\dim M$ equations:
 $\forall i:{\frac {\mathrm {d} }{\mathrm {d} t}}{\frac {\partial F}{\partial X^{i}}}{\bigg }_{{\dot {f}}(t)}={\frac {\partial F}{\partial x^{i}}}{\bigg }_{{\dot {f}}(t)}$
See also
Notes
References
 Hazewinkel, Michiel, ed. (2001) [1994], "Lagrange equations (in mechanics)", Encyclopedia of Mathematics, Springer Science+Business Media B.V. / Kluwer Academic Publishers, ISBN 9781556080104
 Weisstein, Eric W. "EulerLagrange Differential Equation". MathWorld.
 "Calculus of Variations". PlanetMath.
 Gelfand, Izrail Moiseevich (1963). Calculus of Variations. Dover. ISBN 0486414485.
 Roubicek, T.: Calculus of variations. Chap.17 in: Mathematical Tools for Physicists. (Ed. M. Grinfeld) J. Wiley, Weinheim, 2014, ISBN 9783527411887, pp.551588.