EulerLagrange - Maple Help

JetCalculus[EulerLagrange] - calculate the Euler-Lagrange equations for a Lagrangian

Calling Sequences

EulerLagrange(L)

EulerLagrange(${\mathbf{λ}}$ )

EulerLagrange(${\mathbf{ω}}$)

Parameters

L         - a function on a jet space defining the Lagrange function for a variational problem (single or multiple integral)

$\mathrm{λ}$         - a differential bi-form on a jet space defining the Lagrangian form for a variational problem (single or multiple integral)

$\mathrm{ω}$         - a differential bi-form of vertical degree > 0

Description

 • Let be a fiber bundle, with base dimension $n$ and fiber dimension $m$ and let  be the $k$-th jet bundle. Introduce local coordinates , ..., where, as usual, if $s:M\to E$ is a section andis the $k$-jet of then

and dim$\left(M\right)$.

A function $L$ on ${J}^{k}\left(E\right)$ defines the action integral or fundamental integral,

,

for a $k$-th order multiple integral problem in the calculus of variations. The Euler-Lagrange equations are the system of $m$, $2{k}^{\mathrm{th}}-$order partial differential equations for the extremals $s$ of the action integral $I\left[s\right]$. The general formula for the components of the Euler-Lagrange operator are

,

where is the total derivative with respect to ${x}^{i}$. In the special case of a single integral variational problem, this formula can be written as

while for a double integral problem, we have

.

See Gelfand and Fomin for an excellent introduction to the calculus of variations.

 • For the first calling sequence, EulerLagrange(L) returns the list of functions on ${J}^{2k}\left(E\right)$.
 • The differential forms on the jet spaces ${J}^{k}\left(E\right)$ can be bi-graded by their horizontal and vertical/contact degree. A differential form of horizontal degree and vertical degree 0 is called a Lagrangian form or Lagrangian bi-form. In terms of local coordinates on ${J}^{k}\left(E\right)$, a Lagrangian bi-form $\mathrm{λ}$ can be expressed as

, ..., .

The associated Euler-Lagrange form $E\left(\mathrm{\lambda }\right)$ is a differential bi-form of horizontal degree $n$ and vertical degree $1$. It is defined in terms of the usual Euler-Lagrange expressions by

where

For geometrical aspects of the calculus of variations, the representation of the Euler-Lagrange equations as the components of a differential bi-form is very useful.

 • The third calling sequence EulerLagrange(${\mathrm{ω}}$) returns a list of $m$ differential bi-forms of vertical degree 1 less than the vertical degree of $\mathrm{ω}$. Here the partial derivatives with respect to the jets of dependent variables  in the usual formula for the Euler-Lagrange operator acting on functions are replaced by interior products of the corresponding vector fields, that is,

where  denotes the interior product with the vector field

 • The command EulerLagrange is part of the DifferentialGeometry:-JetCalculus package.  It can be used in the form EulerLagrange(...) only after executing the commands with(DifferentialGeometry) and with(JetCalculus), but can always be used by executing DifferentialGeometry:-JetCalculus:-EulerLagrange(...).

Examples

 > $\mathrm{with}\left(\mathrm{DifferentialGeometry}\right):$$\mathrm{with}\left(\mathrm{JetCalculus}\right):$

Example 1.

Create a space of 1 independent variable and 3 dependent variables.

 > $\mathrm{DGsetup}\left(\left[t\right],\left[u,v,w\right],E,2\right):$

Define the standard Lagrangian from mechanics as the difference between the kinetic and potential energy.

 E > $L≔\frac{1}{2}\left({u\left[1\right]}^{2}+{v\left[1\right]}^{2}+{w\left[1\right]}^{2}\right)-V\left(u\left[\right],v\left[\right],w\left[\right]\right)$
 ${L}{≔}\frac{{{u}}_{{1}}^{{2}}}{{2}}{+}\frac{{{v}}_{{1}}^{{2}}}{{2}}{+}\frac{{{w}}_{{1}}^{{2}}}{{2}}{-}{V}{}\left({{u}}_{\left[\right]}{,}{{v}}_{\left[\right]}{,}{{w}}_{\left[\right]}\right)$ (2.1)

Calculate the Euler-Lagrange equations for $L$.

 E > $\mathrm{EL}≔\mathrm{EulerLagrange}\left(L\right)$
 ${\mathrm{EL}}{≔}\left[{-}{{V}}_{{{u}}_{\left[\right]}}{-}{{u}}_{{1}{,}{1}}{,}{-}{{V}}_{{{v}}_{\left[\right]}}{-}{{v}}_{{1}{,}{1}}{,}{-}{{V}}_{{{w}}_{\left[\right]}}{-}{{w}}_{{1}{,}{1}}\right]$ (2.2)

The convert/DGdiff command will change this output from jet space notation to standard differential equations notation.

 E > $\mathrm{convert}\left(\mathrm{EL},\mathrm{DGdiff}\right)$
 $\left[{-}{{\mathrm{D}}}_{{1}}{}\left({V}\right){}\left({u}{}\left({t}\right){,}{v}{}\left({t}\right){,}{w}{}\left({t}\right)\right){-}{{u}}_{{t}{,}{t}}{,}{-}{{\mathrm{D}}}_{{2}}{}\left({V}\right){}\left({u}{}\left({t}\right){,}{v}{}\left({t}\right){,}{w}{}\left({t}\right)\right){-}{{v}}_{{t}{,}{t}}{,}{-}{{\mathrm{D}}}_{{3}}{}\left({V}\right){}\left({u}{}\left({t}\right){,}{v}{}\left({t}\right){,}{w}{}\left({t}\right)\right){-}{{w}}_{{t}{,}{t}}\right]$ (2.3)

Here are the same calculations done with differential forms.

 E > $\mathrm{\lambda }≔L\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&mult\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{Dt}$
 ${\mathrm{\lambda }}{≔}\left(\frac{{{u}}_{{1}}^{{2}}}{{2}}{+}\frac{{{v}}_{{1}}^{{2}}}{{2}}{+}\frac{{{w}}_{{1}}^{{2}}}{{2}}{-}{V}{}\left({{u}}_{\left[\right]}{,}{{v}}_{\left[\right]}{,}{{w}}_{\left[\right]}\right)\right){}{\mathrm{Dt}}$ (2.4)
 E > $\mathrm{EulerLagrange}\left(\mathrm{\lambda }\right)$
 $\left({{V}}_{{{u}}_{\left[\right]}}{+}{{u}}_{{1}{,}{1}}\right){}{\mathrm{Dt}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{\left[\right]}{+}\left({{V}}_{{{v}}_{\left[\right]}}{+}{{v}}_{{1}{,}{1}}\right){}{\mathrm{Dt}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{\left[\right]}{+}\left({{V}}_{{{w}}_{\left[\right]}}{+}{{w}}_{{1}{,}{1}}\right){}{\mathrm{Dt}}{}{\bigwedge }{}{{\mathrm{Cw}}}_{\left[\right]}$ (2.5)

Example 2.

Create a space of 1 independent variable and 1 dependent variable.

 E > $\mathrm{DGsetup}\left(\left[x\right],\left[u\right],E,2\right):$

Calculate the Euler-Lagrange equations for an arbitrary second order Lagrangian.

 E > $\mathrm{L2}≔F\left(x,u\left[\right],u\left[1\right],u\left[1,1\right]\right):$
 E > $\mathrm{PDEtools}\left[\mathrm{declare}\right]\left(F\left(x,u\left[\right],u\left[1\right],u\left[1,1\right]\right),\mathrm{quiet}\right)$
 E > $\mathrm{Eul1}≔\mathrm{EulerLagrange}\left(\mathrm{L2}\right)$
 ${\mathrm{Eul1}}{≔}\left[{{F}}_{{{u}}_{\left[\right]}}{-}{{F}}_{{x}{,}{{u}}_{{1}}}{-}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}}}{}{{u}}_{{1}}{-}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}}}{}{{u}}_{{1}{,}{1}}{-}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{x}{,}{x}{,}{{u}}_{{1}{,}{1}}}{+}{{F}}_{{x}{,}{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{x}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{x}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}\left({{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{x}{,}{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}\right){}{{u}}_{{1}}{+}\left({{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}{+}{{F}}_{{x}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}\right){}{{u}}_{{1}{,}{1}}{+}\left({{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{+}{{F}}_{{x}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}\right){}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}{,}{1}}\right]$ (2.6)

Compare with the usual formula for the Euler-Lagrange expression in terms of the total derivatives (calculated using TotalDiff) of the partial derivative of L with respect to the jet coordinates .

 E > $\mathrm{P0},\mathrm{P1},\mathrm{P2}≔\mathrm{diff}\left(\mathrm{L2},u\left[\right]\right),\mathrm{diff}\left(\mathrm{L2},u\left[1\right]\right),\mathrm{diff}\left(\mathrm{L2},u\left[1,1\right]\right)$
 ${\mathrm{P0}}{,}{\mathrm{P1}}{,}{\mathrm{P2}}{≔}{{F}}_{{{u}}_{\left[\right]}}{,}{{F}}_{{{u}}_{{1}}}{,}{{F}}_{{{u}}_{{1}{,}{1}}}$ (2.7)
 E > $\mathrm{Eul2}≔\mathrm{P0}-\mathrm{TotalDiff}\left(\mathrm{P1},\left[1\right]\right)+\mathrm{TotalDiff}\left(\mathrm{P2},\left[1,1\right]\right)$
 ${\mathrm{Eul2}}{≔}{{F}}_{{{u}}_{\left[\right]}}{-}{{F}}_{{x}{,}{{u}}_{{1}}}{-}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}}}{}{{u}}_{{1}}{-}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}}}{}{{u}}_{{1}{,}{1}}{-}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{x}{,}{x}{,}{{u}}_{{1}{,}{1}}}{+}{{F}}_{{x}{,}{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{x}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{x}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}\left({{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{x}{,}{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}\right){}{{u}}_{{1}}{+}\left({{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}}{+}{{F}}_{{x}{,}{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}\right){}{{u}}_{{1}{,}{1}}{+}\left({{F}}_{{{u}}_{\left[\right]}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}{,}{1}}}{+}{{F}}_{{x}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}\right){}{{u}}_{{1}{,}{1}{,}{1}}{+}{{F}}_{{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{1}}}{}{{u}}_{{1}{,}{1}{,}{1}{,}{1}}$ (2.8)
 E > $\mathrm{Eul2}-\mathrm{Eul1}\left[1\right]$
 ${0}$ (2.9)

Here are the same calculations again using an alternative jet space notation. See Preferences for details.

 E > $\mathrm{Preferences}\left("JetNotation","JetNotation2"\right)$
 ${"JetNotation1"}$ (2.10)
 E > $\mathrm{DGsetup}\left(\left[x\right],\left[u\right],E,2\right):$

Calculate the Euler-Lagrange equations for an arbitrary second order Lagrangian.

 E > $\mathrm{L2}≔F\left(x,u\left[0\right],u\left[1\right],u\left[2\right]\right):$
 E > $\mathrm{PDEtools}\left[\mathrm{declare}\right]\left(F\left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\right){}{{u}}_{{2}}{+}\left({{F}}_{{{u}}_{{0}}{,}{{u}}_{{2}}{,}{{u}}_{{2}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{2}}{,}{{u}}_{{2}}}{}{{u}}_{{2}}{+}{{F}}_{{{u}}_{{2}}{,}{{u}}_{{2}}{,}{{u}}_{{2}}}{}{{u}}_{{3}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{2}}}{+}{{F}}_{{x}{,}{{u}}_{{2}}{,}{{u}}_{{2}}}\right){}{{u}}_{{3}}{+}{{F}}_{{{u}}_{{2}}{,}{{u}}_{{2}}}{}{{u}}_{{4}}\right]$ (2.11)
 E > $\mathrm{Preferences}\left("JetNotation","JetNotation1"\right)$
 ${"JetNotation2"}$ (2.12)
 E > 

Example 3.

Create a space of 3 independent variables and 1 dependent variable. Derive the Laplace's equation from its variational principle.

 E > $\mathrm{DGsetup}\left(\left[x,y,z\right],\left[u\right],E,1\right):$
 E > $\mathrm{L3}≔\frac{1}{2}\left({u\left[1\right]}^{2}+{u\left[2\right]}^{2}+{u\left[3\right]}^{2}\right)$
 ${\mathrm{L3}}{≔}\frac{{{u}}_{{1}}^{{2}}}{{2}}{+}\frac{{{u}}_{{2}}^{{2}}}{{2}}{+}\frac{{{u}}_{{3}}^{{2}}}{{2}}$ (2.13)
 E > $\mathrm{E3}≔\mathrm{EulerLagrange}\left(\mathrm{L3}\right)$
 ${\mathrm{E3}}{≔}\left[{-}{{u}}_{{1}{,}{1}}{-}{{u}}_{{2}{,}{2}}{-}{{u}}_{{3}{,}{3}}\right]$ (2.14)
 E > $\mathrm{convert}\left(\mathrm{E3}\left[1\right],\mathrm{DGdiff}\right)$
 ${-}{{u}}_{{x}{,}{x}}{-}{{u}}_{{y}{,}{y}}{-}{{u}}_{{z}{,}{z}}$ (2.15)

Repeat this computation using differential forms.

 E > $\mathrm{λ3}≔\mathrm{evalDG}\left(\mathrm{L3}\left(\mathrm{Dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{Dy}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{Dz}\right)$
 ${\mathrm{λ3}}{≔}\left(\frac{{{u}}_{{1}}^{{2}}}{{2}}{+}\frac{{{u}}_{{2}}^{{2}}}{{2}}{+}\frac{{{u}}_{{3}}^{{2}}}{{2}}\right){}{\mathrm{Dx}}{}{\bigwedge }{}$