EulerLagrange - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

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\left({u}_{1}^{2}+{v}_{1}^{2}+{w}_{1}^{2}\right)}{2}-V\left({u}_{[]},{v}_{[]},{w}_{[]}\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{λ}≔L&mult\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{λ}\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}_{[]},{u}_{1},{u}_{1,1}\right):$
 E > ${\mathrm{PDEtools}}_{\mathrm{declare}}\left(F\left(x,{u}_{[]},{u}_{1},{u}_{1,1}\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}≔\frac{\partial }{\partial {u}_{[]}}\mathrm{L2},\frac{\partial }{\partial {u}_{1}}\mathrm{L2},\frac{\partial }{\partial {u}_{1,1}}\mathrm{L2}$
 ${\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}}_{1}$
 ${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}_{0},{u}_{1},{u}_{2}\right):$
 E > ${\mathrm{PDEtools}}_{\mathrm{declare}}\left(F\left(x,{u}_{[]},{u}_{1},{u}_{2}\right),\mathrm{quiet}\right)$
 E > $\mathrm{Eul1}≔\mathrm{EulerLagrange}\left(\mathrm{L2}\right)$
 ${\mathrm{Eul1}}{≔}\left[{{F}}_{{{u}}_{{0}}}{-}{{F}}_{{x}{,}{{u}}_{{1}}}{-}{{F}}_{{{u}}_{{0}}{,}{{u}}_{{1}}}{}{{u}}_{{1}}{-}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}}}{}{{u}}_{{2}}{-}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{2}}}{}{{u}}_{{3}}{+}{{F}}_{{x}{,}{x}{,}{{u}}_{{2}}}{+}{{F}}_{{x}{,}{{u}}_{{0}}{,}{{u}}_{{2}}}{}{{u}}_{{1}}{+}{{F}}_{{x}{,}{{u}}_{{1}}{,}{{u}}_{{2}}}{}{{u}}_{{2}}{+}{{F}}_{{x}{,}{{u}}_{{2}}{,}{{u}}_{{2}}}{}{{u}}_{{3}}{+}\left({{F}}_{{{u}}_{{0}}{,}{{u}}_{{0}}{,}{{u}}_{{2}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{{0}}{,}{{u}}_{{1}}{,}{{u}}_{{2}}}{}{{u}}_{{2}}{+}{{F}}_{{{u}}_{{0}}{,}{{u}}_{{2}}{,}{{u}}_{{2}}}{}{{u}}_{{3}}{+}{{F}}_{{x}{,}{{u}}_{{0}}{,}{{u}}_{{2}}}\right){}{{u}}_{{1}}{+}\left({{F}}_{{{u}}_{{0}}{,}{{u}}_{{1}}{,}{{u}}_{{2}}}{}{{u}}_{{1}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{1}}{,}{{u}}_{{2}}}{}{{u}}_{{2}}{+}{{F}}_{{{u}}_{{1}}{,}{{u}}_{{2}}{,}{{u}}_{{2}}}{}{{u}}_{{3}}{+}{{F}}_{{{u}}_{{0}}{,}{{u}}_{{2}}}{+}{{F}}_{{x}{,}{{u}}_{{1}}{,}{{u}}_{{2}}}\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\left({u}_{1}^{2}+{u}_{2}^{2}+{u}_{3}^{2}\right)}{2}$
 ${\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}}_{1},\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}&w\mathrm{Dy}\right)&w\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 }{}{\mathrm{Dy}}{}{\bigwedge }{}{\mathrm{Dz}}$ (2.16)
 E > $\mathrm{EulerLagrange}\left(\mathrm{λ3}\right)$
 $\left({{u}}_{{1}{,}{1}}{+}{{u}}_{{2}{,}{2}}{+}{{u}}_{{3}{,}{3}}\right){}{\mathrm{Dx}}{}{\bigwedge }{}{\mathrm{Dy}}{}{\bigwedge }{}{\mathrm{Dz}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{\left[\right]}$ (2.17)

Example 4.

Create a space of 3 independent variables and 3 dependent variables. Derive 3-dimensional Maxwell equations from the variational principle.

 E > $\mathrm{DGsetup}\left(\left[x,y,t\right],\left[\mathrm{A_x},\mathrm{A_y},\mathrm{A_t}\right],M,1\right):$

Define the Lagrangian.

 M > $L≔-\frac{1{\mathrm{A_t}}_{2}^{2}}{2}+{\mathrm{A_t}}_{2}{\mathrm{A_y}}_{3}-\frac{1{\mathrm{A_y}}_{3}^{2}}{2}-\frac{1{\mathrm{A_t}}_{1}^{2}}{2}+{\mathrm{A_t}}_{1}{\mathrm{A_x}}_{3}-\frac{1{\mathrm{A_x}}_{3}^{2}}{2}+\frac{1{\mathrm{A_y}}_{1}^{2}}{2}-{\mathrm{A_y}}_{1}{\mathrm{A_x}}_{2}+\frac{1{\mathrm{A_x}}_{2}^{2}}{2}$
 ${L}{≔}{-}\frac{{1}}{{2}}{}{{\mathrm{A_t}}}_{{2}}^{{2}}{+}{{\mathrm{A_t}}}_{{2}}{}{{\mathrm{A_y}}}_{{3}}{-}\frac{{1}}{{2}}{}{{\mathrm{A_y}}}_{{3}}^{{2}}{-}\frac{{1}}{{2}}{}{{\mathrm{A_t}}}_{{1}}^{{2}}{+}{{\mathrm{A_t}}}_{{1}}{}{{\mathrm{A_x}}}_{{3}}{-}\frac{{1}}{{2}}{}{{\mathrm{A_x}}}_{{3}}^{{2}}{+}\frac{{1}}{{2}}{}{{\mathrm{A_y}}}_{{1}}^{{2}}{-}{{\mathrm{A_y}}}_{{1}}{}{{\mathrm{A_x}}}_{{2}}{+}\frac{{1}}{{2}}{}{{\mathrm{A_x}}}_{{2}}^{{2}}$ (2.18)

Compute the Euler-Lagrange equations.

 M > $\mathrm{Maxwell1}≔\mathrm{EulerLagrange}\left(L\right)$
 ${\mathrm{Maxwell1}}{≔}\left[{-}{{\mathrm{A_x}}}_{{2}{,}{2}}{+}{{\mathrm{A_y}}}_{{1}{,}{2}}{-}{{\mathrm{A_t}}}_{{1}{,}{3}}{+}{{\mathrm{A_x}}}_{{3}{,}{3}}{,}{{\mathrm{A_x}}}_{{1}{,}{2}}{-}{{\mathrm{A_y}}}_{{1}{,}{1}}{-}{{\mathrm{A_t}}}_{{2}{,}{3}}{+}{{\mathrm{A_y}}}_{{3}{,}{3}}{,}{{\mathrm{A_t}}}_{{1}{,}{1}}{-}{{\mathrm{A_x}}}_{{1}{,}{3}}{+}{{\mathrm{A_t}}}_{{2}{,}{2}}{-}{{\mathrm{A_y}}}_{{2}{,}{3}}\right]$ (2.19)

Change notation to improve readability.

 M > ${\mathrm{PDEtools}}_{\mathrm{declare}}\left(\mathrm{quiet}\right)$
 M > $\mathrm{Maxwell2}≔\mathrm{map}\left(\mathrm{convert},\mathrm{Maxwell1},\mathrm{DGdiff}\right)$
 ${\mathrm{Maxwell2}}{≔}\left[{-}{{\mathrm{A_x}}}_{{y}{,}{y}}{+}{{\mathrm{A_y}}}_{{x}{,}{y}}{-}{{\mathrm{A_t}}}_{{t}{,}{x}}{+}{{\mathrm{A_x}}}_{{t}{,}{t}}{,}{{\mathrm{A_x}}}_{{x}{,}{y}}{-}{{\mathrm{A_y}}}_{{x}{,}{x}}{-}{{\mathrm{A_t}}}_{{t}{,}{y}}{+}{{\mathrm{A_y}}}_{{t}{,}{t}}{,}{{\mathrm{A_t}}}_{{x}{,}{x}}{-}{{\mathrm{A_x}}}_{{t}{,}{x}}{+}{{\mathrm{A_t}}}_{{y}{,}{y}}{-}{{\mathrm{A_y}}}_{{t}{,}{y}}\right]$ (2.20)

${\mathrm{Maxwell2}}{:=}\left[{-}{{\mathrm{A_x}}}_{{y}{,}{y}}{+}{{\mathrm{A_y}}}_{{x}{,}{y}}{+}{{\mathrm{A_x}}}_{{t}{,}{t}}{-}{{\mathrm{A_t}}}_{{t}{,}{x}}{,}{{\mathrm{A_x}}}_{{x}{,}{y}}{-}{{\mathrm{A_y}}}_{{x}{,}{x}}{+}{{\mathrm{A_y}}}_{{t}{,}{t}}{-}{{\mathrm{A_t}}}_{{t}{,}{y}}{,}{-}{{\mathrm{A_x}}}_{{t}{,}{x}}{+}{{\mathrm{A_t}}}_{{x}{,}{x}}{-}{{\mathrm{A_y}}}_{{t}{,}{y}}{+}{{\mathrm{A_t}}}_{{y}{,}{y}}\right]$

Example 5.

In this example we apply the Euler-Lagrange operator to some contact forms. We start with the case of 1 independent variable and 1 dependent variable.

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

First we try a form ${\mathrm{ω}}_{1}$ of vertical degree 1.

 E > $\mathrm{ω1}≔\mathrm{evalDG}\left(a\left(x\right){\mathrm{Cu}}_{[]}+b\left(x\right){\mathrm{Cu}}_{1}+c\left(x\right){\mathrm{Cu}}_{1,1}+d\left(x\right){\mathrm{Cu}}_{1,1,1}\right)$
 ${\mathrm{ω1}}{≔}{a}{}\left({x}\right){}{{\mathrm{Cu}}}_{\left[\right]}{+}{b}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}}{+}{c}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}{,}{1}}{+}{d}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}{,}{1}{,}{1}}$ (2.21)
 E > $\mathrm{EulerLagrange}\left(\mathrm{ω1}\right)$
 $\left[{a}{}\left({x}\right){-}{{b}}_{{x}}{+}{{c}}_{{x}{,}{x}}{-}{{d}}_{{x}{,}{x}{,}{x}}\right]$ (2.22)

Try a form ${\mathrm{ω}}_{2}$ of vertical degree 2.

 E > $\mathrm{ω2}≔\mathrm{evalDG}\left(a\left(x\right)\left({\mathrm{Cu}}_{[]}\right)&w\left({\mathrm{Cu}}_{1}\right)+b\left(x\right)\left({\mathrm{Cu}}_{[]}\right)&w\left({\mathrm{Cu}}_{1,1}\right)+c\left(x\right)\left({\mathrm{Cu}}_{1}\right)&w\left({\mathrm{Cu}}_{1,1}\right)\right)$
 ${\mathrm{ω2}}{≔}{a}{}\left({x}\right){}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}}{+}{b}{}\left({x}\right){}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}{,}{1}}{+}{c}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}{,}{1}}$ (2.23)
 E > $\mathrm{EulForm1}≔\mathrm{EulerLagrange}\left(\mathrm{ω2}\right)$
 ${\mathrm{EulForm1}}{≔}\left[\left({-}{{b}}_{{x}{,}{x}}{+}{{a}}_{{x}}\right){}{{\mathrm{Cu}}}_{\left[\right]}{-}\left({{c}}_{{x}{,}{x}}{+}{2}{}{{b}}_{{x}}{-}{2}{}{a}{}\left({x}\right)\right){}{{\mathrm{Cu}}}_{{1}}{-}{3}{}{{c}}_{{x}}{}{{\mathrm{Cu}}}_{{1}{,}{1}}{-}{2}{}{c}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}{,}{1}{,}{1}}\right]$ (2.24)

Here is the explicit formula for computing EulerLagrange(omega2).

 E > $\mathrm{P0}≔\mathrm{Hook}\left({\mathrm{D_u}}_{[]},\mathrm{ω2}\right);$$\mathrm{P1}≔\mathrm{Hook}\left({\mathrm{D_u}}_{1},\mathrm{ω2}\right);$$\mathrm{P2}≔\mathrm{Hook}\left({\mathrm{D_u}}_{1,1},\mathrm{ω2}\right)$
 ${\mathrm{P0}}{≔}{a}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}}{+}{b}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}{,}{1}}$
 ${\mathrm{P1}}{≔}{-}{a}{}\left({x}\right){}{{\mathrm{Cu}}}_{\left[\right]}{+}{c}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}{,}{1}}$
 ${\mathrm{P2}}{≔}{-}{b}{}\left({x}\right){}{{\mathrm{Cu}}}_{\left[\right]}{-}{c}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}}$ (2.25)
 E > $\mathrm{EulForm2}≔\mathrm{evalDG}\left(\mathrm{P0}-\mathrm{TotalDiff}\left(\mathrm{P1},\left[1\right]\right)+\mathrm{TotalDiff}\left(\mathrm{P2},\left[1,1\right]\right)\right)$
 ${\mathrm{EulForm2}}{≔}\left({-}{{b}}_{{x}{,}{x}}{+}{{a}}_{{x}}\right){}{{\mathrm{Cu}}}_{\left[\right]}{-}\left({{c}}_{{x}{,}{x}}{+}{2}{}{{b}}_{{x}}{-}{2}{}{a}{}\left({x}\right)\right){}{{\mathrm{Cu}}}_{{1}}{-}{3}{}{{c}}_{{x}}{}{{\mathrm{Cu}}}_{{1}{,}{1}}{-}{2}{}{c}{}\left({x}\right){}{{\mathrm{Cu}}}_{{1}{,}{1}{,}{1}}$ (2.26)
 E > $\mathrm{EulForm2}&minus\left({\mathrm{EulForm1}}_{1}\right)$
 ${0}{}{{\mathrm{Cu}}}_{\left[\right]}$ (2.27)

Now we compute some simple examples in the case of 2 independent variables and 2 dependent variables.

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

Try a form of vertical degree 1.

 E > $\mathrm{ω3}≔\mathrm{evalDG}\left(a\left(x,y\right){\mathrm{Cu}}_{[]}+b\left(x,y\right){\mathrm{Cv}}_{[]}+c\left(x,y\right){\mathrm{Cu}}_{1}+d\left(x,y\right){\mathrm{Cu}}_{2}+e\left(x,y\right){\mathrm{Cv}}_{1}+f\left(x,y\right){\mathrm{Cv}}_{2}\right)$
 ${\mathrm{ω3}}{≔}{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{\left[\right]}{+}{b}{}\left({x}{,}{y}\right){}{{\mathrm{Cv}}}_{\left[\right]}{+}{c}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{{1}}{+}{d}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{{2}}{+}{e}{}\left({x}{,}{y}\right){}{{\mathrm{Cv}}}_{{1}}{+}{f}{}\left({x}{,}{y}\right){}{{\mathrm{Cv}}}_{{2}}$ (2.28)
 E > $\mathrm{EulerLagrange}\left(\mathrm{ω3}\right)$
 $\left[{a}{}\left({x}{,}{y}\right){-}{{c}}_{{x}}{-}{{d}}_{{y}}{,}{b}{}\left({x}{,}{y}\right){-}{{e}}_{{x}}{-}{{f}}_{{y}}\right]$ (2.29)

Try a form of vertical degree 2.

 E > $\mathrm{ω4}≔\mathrm{evalDG}\left(a\left(x,y\right)\left({\mathrm{Cu}}_{[]}\right)&w\left({\mathrm{Cv}}_{[]}\right)+b\left(x,y\right)\left({\mathrm{Cu}}_{1}\right)&w\left({\mathrm{Cv}}_{2}\right)\right)$
 ${\mathrm{ω4}}{≔}{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cv}}}_{\left[\right]}{+}{b}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{2}}$ (2.30)
 E > $\mathrm{EulerLagrange}\left(\mathrm{ω4}\right)$
 $\left[{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cv}}}_{\left[\right]}{-}{{b}}_{{x}}{}{{\mathrm{Cv}}}_{{2}}{-}{b}{}\left({x}{,}{y}\right){}{{\mathrm{Cv}}}_{{1}{,}{2}}{,}{-}{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{\left[\right]}{+}{{b}}_{{y}}{}{{\mathrm{Cu}}}_{{1}}{+}{b}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{{1}{,}{2}}\right]$ (2.31)

Try a form ${\mathrm{ω}}_{5}$ of vertical degree 3.

 E > $\mathrm{ω5}≔\mathrm{evalDG}\left(a\left(x,y\right)\left(\left({\mathrm{Cu}}_{[]}\right)&w\left({\mathrm{Cu}}_{1}\right)\right)&w\left({\mathrm{Cv}}_{1}\right)\right)$
 ${\mathrm{ω5}}{≔}{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{1}}$ (2.32)
 E > $\mathrm{EulerLagrange}\left(\mathrm{ω5}\right)$
 $\left[{{a}}_{{x}}{}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{1}}{+}{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{1}{,}{1}}{+}{2}{}{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{1}}{,}{-}{{a}}_{{x}}{}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}}{-}{a}{}\left({x}{,}{y}\right){}{{\mathrm{Cu}}}_{\left[\right]}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}{,}{1}}\right]$ (2.33)

The Euler-Lagrange operator of the horizontal exterior derivative of any form vanishes, for example:

 E > $\mathrm{η}≔\mathrm{HorizontalExteriorDerivative}\left({u}_{2,3}\left({\mathrm{Cu}}_{1}\right)&w\left({\mathrm{Cv}}_{2}\right)\right)$
 ${\mathrm{\eta }}{≔}{{u}}_{{1}{,}{2}{,}{3}}{}{\mathrm{Dx}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{2}}{+}{{u}}_{{2}{,}{3}}{}{\mathrm{Dx}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{1}{,}{2}}{-}{{u}}_{{2}{,}{3}}{}{\mathrm{Dx}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{2}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}{,}{1}}{+}{{u}}_{{2}{,}{2}{,}{3}}{}{\mathrm{Dy}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{2}}{+}{{u}}_{{2}{,}{3}}{}{\mathrm{Dy}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{2}{,}{2}}{-}{{u}}_{{2}{,}{3}}{}{\mathrm{Dy}}{}{\bigwedge }{}{{\mathrm{Cv}}}_{{2}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{{1}{,}{2}}$ (2.34)
 E > $\mathrm{EulerLagrange}\left(\mathrm{η}\right)$
 $\left[{0}{}{\mathrm{Dx}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{\left[\right]}{,}{0}{}{\mathrm{Dx}}{}{\bigwedge }{}{{\mathrm{Cu}}}_{\left[\right]}\right]$ (2.35)

 See Also