 Fundiff - Maple Help

Physics[Fundiff] - functional differentiation Calling Sequence Fundiff(expression, f1, f2, ...) Parameters

 expression - any mathematical expression or relation between expressions f1, f2, ... - functions Description

 • The Fundiff command computes functional derivatives of algebraic expressions. If the expression being differentiated contains an integral (maybe a multiple or nested one), Fundiff first attempts to functionally differentiate the integrand, then tries to evaluate the resulting integral, now containing the Dirac delta function or its derivatives. This evaluation, in turn, is carried out by using the integration routines for this problem, which return a result only when the integrand is a polynomial of Dirac functions. Otherwise, the integral is returned unevaluated, after replacing all occurrences of int by Int.
 • The %Fundiff command is the inert form of Fundiff; that is, it represents the same mathematical operation while displaying the operation unevaluated. To evaluate the operation, use the value command.
 • Since Fundiff is implemented to use Physics/diff, which in turn uses the top level diff command, any special rule for the functional derivative of a user-defined (U.D.) function can be stated by indicating the rule (for the NAME of the U.D. function) to diff in the usual way. In addition, since Physics[diff] recognizes derivatives expressed using the global :-diff or :-Diff syntaxes as mathematically equivalent to those built with the D syntax, the same holds for Fundiff. For the same reason, functional derivatives with respect to indexed fields (functions) where the index represents tensorial properties (spacetime, spinor, or gauge) are computed by Fundiff by using the sum rule for repeated indices, as Physics[diff] does. To define an indexed object as a tensor function, see Define.
 • When calculating functional derivatives, it sometimes happens that some variables are (constant) Parameters of the theory, and it would be an error to attach functionality to them. To meet this requirement, use the Parameters command of the Physics package, which allows for the declaration of a parameter as a constant parameter in such a way that no functionality can be attached to it. Examples

 > $\mathrm{with}\left(\mathrm{Physics}\right):$
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (1)

First, set two systems of Coordinates, $X$ and $Y$. Each one has four coordinates.

 > $\mathrm{Coordinates}\left(X,Y\right)$
 ${}{}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}{}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$
 ${}{}\mathrm{Systems of spacetime coordinates are:}{}{}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right){,}Y=\left(\mathrm{y1}{,}\mathrm{y2}{,}\mathrm{y3}{,}\mathrm{y4}\right)\right\}$
 $\left\{{X}{,}{Y}\right\}$ (2)
 > $\mathrm{nops}\left(\left[X\right]\right)$
 ${4}$ (3)
 > $X\left[3\right]$
 ${\mathrm{x3}}$ (4)

Define the symbol $A$ as an object having tensorial properties.

 > $\mathrm{Define}\left(A\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{A}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{X}}_{{\mathrm{\mu }}}{,}{{Y}}_{{\mathrm{\mu }}}\right\}$ (5)

Consider now the tensor field, here represented by the indexed function of $X=X$.

 > $\mathrm{ee}≔A\left[\mathrm{\mu },\mathrm{\nu }\right]\left(X\right)$
 ${\mathrm{ee}}{≔}{{A}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right)$ (6)

The functional derivative of this function with respect to ${A}_{\mathrm{\rho },\mathrm{\tau }}\left(Y\right)$ is given by:

 > $\mathrm{Fundiff}\left(\mathrm{ee},A\left[\mathrm{\rho },\mathrm{\tau }\right]\left(Y\right)\right)$
 ${\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right){}{{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{~rho}}}{}{{\mathrm{g_}}}_{{\mathrm{ν}}{,}{\mathrm{~tau}}}$ (7)

The result above is expressed in terms of a four-Dimensional Dirac delta function with the metric g_. If instead of the above you "functionally differentiate" with respect to ${A}_{\mathrm{\rho },\mathrm{\nu }}\left(Y\right)$, the index nu is repeated, and so summed from 1 to the spacetime dimension. By default, and in this help page, the Dimension is $[4,-]$, meaning that you are working in 3 + 1 Minkowski (pseudo-Euclidean) spacetime with signature -,-,-,+ (to change this default, see Setup), so you obtain the following:

 > $\mathrm{Fundiff}\left(\mathrm{ee},A\left[\mathrm{\rho },\mathrm{\nu }\right]\left(Y\right)\right)$
 ${4}{}{\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right){}{{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{~rho}}}$ (8)
 > $\mathrm{Fundiff}\left(\mathrm{ee},A\left[\mathrm{\mu },\mathrm{\nu }\right]\left(Y\right)\right)$
 ${16}{}{\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right)$ (9)

It is sometimes convenient to represent the functional derivative instead of actually computing it. For that purpose, you can either use 'delay evaluation quotes,' or use the inert form of Fundiff, %Fundiff. Note that the delay evaluation quotes can be evaluated by simply reexecuting the output, but you must use the value command to evaluate the inert form.

 > $f\left(X\right)$
 ${f}{}\left({X}\right)$ (10)
 > $'\mathrm{Fundiff}'\left(,f\left(Y\right)\right)$
 ${\mathrm{Fundiff}}{}\left({f}{}\left({X}\right){,}{f}{}\left({Y}\right)\right)$ (11)
 > 
 ${\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right)$ (12)
 > $\mathrm{%Fundiff}\left(f\left(X\right),f\left(Y\right)\right)$
 ${\mathrm{%Fundiff}}{}\left({f}{}\left({X}\right){,}{f}{}\left({Y}\right)\right)$ (13)
 > 
 ${\mathrm{%Fundiff}}{}\left({f}{}\left({X}\right){,}{f}{}\left({Y}\right)\right)$ (14)
 > $\mathrm{value}\left(\right)$
 ${\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right)$ (15)

Fundiff knows about the spacetime differentiation operator d_[mu] and the d'Alembertian operation dAlembertian(A[mu,nu](X)). To use either of these differentiation operators, you must either specify the differentiation variables, or set a coordinate system to be the default differentiation variables (this is the usual method when computing with paper and pencil) by using the Setup command.

 > $\mathrm{Setup}\left(\mathrm{differentiationvariables}=X\right)$
 ${}{}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}{}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$
 $\left[{\mathrm{differentiationvariables}}{=}\left[{X}\right]\right]$ (16)
 > $\mathrm{dAlembertian}\left(A\left[\mathrm{\mu },\mathrm{\nu }\right]\left(X\right)\right)$
 ${\mathrm{\square }}{}\left({{A}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right)\right)$ (17)
 > $\mathrm{Fundiff}\left(,A\left[\mathrm{\rho },\mathrm{\sigma }\right]\left(Y\right)\right)$
 ${\mathrm{dAlembertian}}{}\left({\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right){,}\left[{X}\right]\right){}{{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{~rho}}}{}{{\mathrm{g_}}}_{{\mathrm{ν}}{,}{\mathrm{~sigma}}}$ (18)
 > $\mathrm{d_}\left[\mathrm{\mu }\right]\left(A\left(X\right)\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({A}{}\left({X}\right)\right)$ (19)
 > $\mathrm{Fundiff}\left(,A\left(Y\right)\right)$
 ${{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right){,}\left[{X}\right]\right)$ (20)

In the following example, the output of Fundiff is expressed as the derivative of a four-dimensional Dirac delta function.

 > $\mathrm{diff}\left(A\left[\mathrm{\mu },\mathrm{\nu }\right]\left(X\right),\mathrm{x0}\right)$
 $\frac{{\partial }}{{\partial }{\mathrm{x4}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{A}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right)$ (21)
 > $\mathrm{Fundiff}\left(,A\left[\mathrm{\tau },\mathrm{\rho }\right]\left(Y\right)\right)$
 ${\mathrm{Dirac}}{}\left(\left[{0}{,}{0}{,}{0}{,}{1}\right]{,}\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right){}{{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{~tau}}}{}{{\mathrm{g_}}}_{{\mathrm{ν}}{,}{\mathrm{~rho}}}$ (22)

For example, integrate (in four dimensions) the above from -infinity to infinity (see Intc).

 > $\mathrm{Intc}\left(P\left(X\right),X\right)$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({P}{}\left({X}\right){}{\mathrm{Dirac}}{}\left(\left[{0}{,}{0}{,}{0}{,}{1}\right]{,}\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right){}{{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{~tau}}}{}{{\mathrm{g_}}}_{{\mathrm{ν}}{,}{\mathrm{~rho}}}{,}{\mathrm{x1}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x2}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x3}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x4}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right)$ (23)

This integral can be computed by using the value command.

 > $\mathrm{value}\left(\right)$
 ${-}{{\mathrm{g_}}}_{{\mathrm{\mu }}\phantom{{\mathrm{\tau }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\tau }}}{}{{\mathrm{g_}}}_{{\mathrm{\nu }}\phantom{{\mathrm{\rho }}}}^{\phantom{{\mathrm{\nu }}}{\mathrm{\rho }}}{}\left(\frac{{\partial }}{{\partial }{\mathrm{y4}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{P}{}\left({Y}\right)\right)$ (24)

The derivand passed to Fundiff can be any algebraic expression, including integrals, specifically functionals. Consider, for example, the Action (functional of the physical system) for a one-dimensional oscillator.

 > $\mathrm{Intc}\left(\frac{1}{2}{\mathrm{diff}\left(q\left(\mathrm{\tau }\right),\mathrm{\tau }\right)}^{2}-\frac{1}{2}k{q\left(\mathrm{\tau }\right)}^{2},\mathrm{\tau }\right)$
 ${{\int }}_{{-}{\mathrm{\infty }}}^{{\mathrm{\infty }}}\left(\frac{{\left(\frac{{ⅆ}}{{ⅆ}{\mathrm{\tau }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{q}{}\left({\mathrm{\tau }}\right)\right)}^{{2}}}{{2}}{-}\frac{{k}{}{{q}{}\left({\mathrm{\tau }}\right)}^{{2}}}{{2}}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{\tau }}$ (25)

The equations of motion for this problem can be derived from this functional by using a variational principle; that is, obtained by computing the functional derivative of this Action with respect to $q\left(u\right)$.

 > $\mathrm{Fundiff}\left(,q\left(t\right)\right)$
 ${-}\stackrel{{\mathbf{..}}}{{q}}{}\left({t}\right){-}{k}{}{q}{}\left({t}\right)$ (26)

As an example of the use of Fundiff in a field model, consider the Lagrangian function for the lambda*Phi^4 model in 3+1 spacetime dimensions. For best readability, use the facility for compact display of the differential equation packages.

 > $\mathrm{PDEtools}\left[\mathrm{declare}\right]\left(\mathrm{\Phi }\left(X\right)\right)$
 ${\mathrm{\Phi }}{}\left({X}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{\Phi }}$ (27)
 > $L≔\frac{1}{2}\mathrm{d_}\left[\mathrm{\mu }\right]\left(\mathrm{\Phi }\left(X\right)\right)\mathrm{d_}\left[\mathrm{\mu }\right]\left(\mathrm{\Phi }\left(X\right)\right)-\frac{{m}^{2}}{2}{\mathrm{\Phi }\left(X\right)}^{2}+\frac{\mathrm{\lambda }}{4}{\mathrm{\Phi }\left(X\right)}^{4}$
 $\frac{{1}}{{2}}{}{{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}\left[{X}\right]\right){}{{\mathrm{d_}}}_{{\mathrm{~mu}}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}\left[{X}\right]\right){-}\frac{{1}}{{2}}{}{{m}}^{{2}}{}{{\mathrm{Φ}}{}\left({X}\right)}^{{2}}{+}\frac{{1}}{{4}}{}{\mathrm{λ}}{}{{\mathrm{Φ}}{}\left({X}\right)}^{{4}}$ (28)

The Action for this model is given by:

 > $S≔\mathrm{Intc}\left(L,X\right)$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left(\frac{{1}}{{2}}{}{{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}\left[{X}\right]\right){}{{\mathrm{d_}}}_{{\mathrm{~mu}}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}\left[{X}\right]\right){-}\frac{{1}}{{2}}{}{{m}}^{{2}}{}{{\mathrm{Φ}}{}\left({X}\right)}^{{2}}{+}\frac{{1}}{{4}}{}{\mathrm{λ}}{}{{\mathrm{Φ}}{}\left({X}\right)}^{{4}}{,}{\mathrm{x1}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x2}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x3}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x4}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right)$ (29)

The field equations satisfied by Phi are given by:

 > $\mathrm{Fundiff}\left(S,\mathrm{\Phi }\left(Y\right)\right)$
 ${-}{\mathrm{\square }}{}\left({\mathrm{\Phi }}{}\left({Y}\right){,}\left[{Y}\right]\right){-}{\mathrm{\Phi }}{}\left({Y}\right){}\left({-}{{\mathrm{\Phi }}{}\left({Y}\right)}^{{2}}{}{\mathrm{\lambda }}{+}{{m}}^{{2}}\right)$ (30)

Note that the display above is expressed in terms of $\left(Y\right)=\mathrm{y1},\mathrm{y2},\mathrm{y3},\mathrm{y4}$, which are not the default differentiation variables, and so the symbol $Y$ appears explicitly in the display. If you replace $Y$ by the default differentiation variables (see Setup), then the display is free of redundancies.

 > $\mathrm{ans}≔\mathrm{subs}\left(Y=X,\right)$
 ${-}{\mathrm{dAlembertian}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}\left[{X}\right]\right){-}{\mathrm{Φ}}{}\left({X}\right){}\left({-}{{\mathrm{Φ}}{}\left({X}\right)}^{{2}}{}{\mathrm{λ}}{+}{{m}}^{{2}}\right)$ (31)

To express the dAlembertian in diff notation, use convert.

 > $\mathrm{convert}\left(\mathrm{ans},\mathrm{diff}\right)$
 ${\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}{\mathrm{x1}}\right){,}{\mathrm{x1}}\right){+}{\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}{\mathrm{x2}}\right){,}{\mathrm{x2}}\right){+}{\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}{\mathrm{x3}}\right){,}{\mathrm{x3}}\right){-}\left({\mathrm{diff}}{}\left({\mathrm{diff}}{}\left({\mathrm{Φ}}{}\left({X}\right){,}{\mathrm{x4}}\right){,}{\mathrm{x4}}\right)\right){-}{\mathrm{Φ}}{}\left({X}\right){}\left({-}{{\mathrm{Φ}}{}\left({X}\right)}^{{2}}{}{\mathrm{λ}}{+}{{m}}^{{2}}\right)$ (32)

Note also that the actual Maple mathematical expression behind this default compact display is the one expected, depending on $\left(X\right)=\mathrm{x1},\mathrm{x2},\mathrm{x3},\mathrm{x4}$ (see lprint).

 > $\mathrm{lprint}\left(\mathrm{ans}\right)$
 -Physics:-dAlembertian(Phi(X),[X])-Phi(X)*(-Phi(X)^2*lambda+m^2)
 > $X\left[1\right]$
 ${\mathrm{x1}}$ (33)
 > $X\left[3\right]$
 ${\mathrm{x3}}$ (34)

Maxwell equations can also be derived from a variational principle, by taking the functional derivative of the corresponding Action. For that purpose, define the Action for the problem in terms of the 4-vector ${A}_{\mathrm{\mu }}\left(X\right)$. Use the redo option of the Define command to erase and write over the previous definition for $A$.

 > $\mathrm{Define}\left(A,\mathrm{redo}\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{A}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{X}}_{{\mathrm{\mu }}}{,}{{Y}}_{{\mathrm{\mu }}}\right\}$ (35)

The functional derivative of ${A}_{\mathrm{\mu }}\left(X\right)$ with respect to ${A}_{\mathrm{\nu }}\left(Y\right)$ gives:

 > $\mathrm{%Fundiff}\left(A\left[\mathrm{\mu }\right]\left(X\right),A\left[\mathrm{\nu }\right]\left(Y\right)\right)$
 ${\mathrm{%Fundiff}}{}\left({{A}}_{{\mathrm{μ}}}{}\left({X}\right){,}{{A}}_{{\mathrm{ν}}}{}\left({Y}\right)\right)$ (36)
 > $\mathrm{value}\left(\right)$
 ${\mathrm{Dirac}}{}\left(\left[{\mathrm{x1}}{-}{\mathrm{y1}}{,}{\mathrm{x2}}{-}{\mathrm{y2}}{,}{\mathrm{x3}}{-}{\mathrm{y3}}{,}{\mathrm{x4}}{-}{\mathrm{y4}}\right]\right){}{{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{~nu}}}$ (37)

Introduce now the electromagnetic field tensor ${F}_{\mathrm{\mu },\mathrm{\nu }}$.

 > $\mathrm{PDEtools}\left[\mathrm{declare}\right]\left(A\left[\mathrm{\mu }\right]\left(X\right)\right)$
 ${A}{}\left({X}\right){}{\mathrm{will now be displayed as}}{}{A}$ (38)
 > $F\left[\mathrm{\mu },\mathrm{\nu }\right]≔\mathrm{d_}\left[\mathrm{\mu }\right]\left(A\left[\mathrm{\nu }\right]\left(X\right)\right)-\mathrm{d_}\left[\mathrm{\nu }\right]\left(A\left[\mathrm{\mu }\right]\left(X\right)\right)$
 ${{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({{A}}_{{\mathrm{ν}}}{}\left({X}\right){,}\left[{X}\right]\right){-}{{\mathrm{d_}}}_{{\mathrm{ν}}}{}\left({{A}}_{{\mathrm{μ}}}{}\left({X}\right){,}\left[{X}\right]\right)$ (39)

So the action in empty space is given by:

 > $S≔\mathrm{Intc}\left({F\left[\mathrm{\mu },\mathrm{\nu }\right]}^{2},X\right)$
 ${\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\left({{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({{A}}_{{\mathrm{ν}}}{}\left({X}\right){,}\left[{X}\right]\right){-}{{\mathrm{d_}}}_{{\mathrm{ν}}}{}\left({{A}}_{{\mathrm{μ}}}{}\left({X}\right){,}\left[{X}\right]\right)\right)}^{{2}}{,}{\mathrm{x1}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x2}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x3}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x4}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right)$ (40)

The "equations of motion" (Maxwell equations) are output below: use delay evaluation quotes to display the equations before evaluating the expression.

 > $'\mathrm{Fundiff}'\left(S,A\left[\mathrm{\rho }\right]\left(Y\right)\right)$
 ${\mathrm{Fundiff}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\left({{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({{A}}_{{\mathrm{ν}}}{}\left({X}\right){,}\left[{X}\right]\right){-}{{\mathrm{d_}}}_{{\mathrm{ν}}}{}\left({{A}}_{{\mathrm{μ}}}{}\left({X}\right){,}\left[{X}\right]\right)\right)}^{{2}}{,}{\mathrm{x1}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x2}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x3}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{\mathrm{x4}}{=}{-}{\mathrm{∞}}{..}{\mathrm{∞}}\right){,}{{A}}_{{\mathrm{ρ}}}{}\left({Y}\right)\right)$ (41)
 > $\mathrm{subs}\left(Y=X,\right)$
 $\left({2}{}{{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({{\mathrm{d_}}}_{{\mathrm{ν}}}{}\left({{A}}_{{\mathrm{~nu}}}{}\left({X}\right){,}\left[{X}\right]\right){,}\left[{X}\right]\right){-}{2}{}{\mathrm{dAlembertian}}{}\left({{A}}_{{\mathrm{μ}}}{}\left({X}\right){,}\left[{X}\right]\right)\right){}{{\mathrm{g_}}}_{{\mathrm{~mu}}{,}{\mathrm{~rho}}}{+}\left({-}{2}{}{\mathrm{dAlembertian}}{}\left({{A}}_{{\mathrm{ν}}}{}\left({X}\right){,}\left[{X}\right]\right){+}{2}{}{{\mathrm{d_}}}_{{\mathrm{μ}}}{}\left({{\mathrm{d_}}}_{{\mathrm{ν}}}{}\left({{A}}_{{\mathrm{~mu}}}{}\left({X}\right){,}\left[{X}\right]\right){,}\left[{X}\right]\right)\right){}{{\mathrm{g_}}}_{{\mathrm{~nu}}{,}{\mathrm{~rho}}}$ (42)

In order to obtain Maxwell equations, a simplification of the contracted indices is necessary.

 > $\mathrm{Simplify}\left(\right)$
 ${4}{}{{\mathrm{d_}}}_{{\mathrm{ν}}}{}\left({{\mathrm{d_}}}_{{\mathrm{~rho}}}{}\left({{A}}_{{\mathrm{~nu}}}{}\left({X}\right){,}\left[{X}\right]\right){,}\left[{X}\right]\right){-}{4}{}{\mathrm{dAlembertian}}{}\left({{A}}_{{\mathrm{~rho}}}{}\left({X}\right){,}\left[{X}\right]\right)$ (43)
 > See Also References

 Cheb-Terrab, E.S. "Maple procedures for partial and functional derivatives." Computer Physics Communications, Vol. 79. (1994): 409-424.