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

Online Help

All Products    Maple    MapleSim


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

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

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

CoordinatesX,Y

Default differentiation variables for d_, D_ and dAlembertian are:X=x1,x2,x3,x4

Systems of spacetime coordinates are:X=x1,x2,x3,x4,Y=y1,y2,y3,y4

X,Y

(2)

nopsX

4

(3)

X3

x3

(4)

Define the symbol A as an object having tensorial properties.

DefineA

Defined objects with tensor properties

A,γμ,σμ,μ,gμ,ν,εα,β,μ,ν,Xμ,Yμ

(5)

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

eeAμ,νX

eeAμ,νX

(6)

The functional derivative of this function with respect to Aρ,τY is given by:

Fundiffee,Aρ,τY

δ4x1y1,x2y2,x3y3,x4y4δμρμρδντντ

(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ρ,νY, 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:

Fundiffee,Aρ,νY

4δ4x1y1,x2y2,x3y3,x4y4δμρμρ

(8)

Fundiffee,Aμ,νY

16δ4x1y1,x2y2,x3y3,x4y4

(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.

fX

fX

(10)

Fundiff,fY

δδfYfX

(11)

δ4x1y1,x2y2,x3y3,x4y4

(12)

%FundifffX,fY

δδfYfX

(13)

δδfYfX

(14)

value

δ4x1y1,x2y2,x3y3,x4y4

(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.

Setupdifferentiationvariables=X

Default differentiation variables for d_, D_ and dAlembertian are:X=x1,x2,x3,x4

differentiationvariables=X

(16)

dAlembertianAμ,νX

Aμ,νX

(17)

Fundiff,Aρ,σY

δ4x1y1,x2y2,x3y3,x4y4δμρμρδνσνσ

(18)

d_μAX

μAX

(19)

Fundiff,AY

μδ4x1y1,x2y2,x3y3,x4y4

(20)

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

diffAμ,νX,x0

x4Aμ,νX

(21)

Fundiff,Aτ,ρY

δ40,0,0,1,x1y1,x2y2,x3y3,x4y4δμτμτδνρνρ

(22)

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

IntcPX,X

PXδ40,0,0,1,x1y1,x2y2,x3y3,x4y4δμτμτδνρνρⅆx1ⅆx2ⅆx3ⅆx4

(23)

This integral can be computed by using the value command.

value

δμτμτδνρνρy4PY

(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.

Intc12diffqτ,τ212kqτ2,τ

ⅆⅆτqτ22kqτ22ⅆτ

(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 qu.

Fundiff,qt

kqtq..t

(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.

CompactDisplayΦX

Φx1,x2,x3,x4will now be displayed asΦ

(27)

L12d_μΦXd_μΦXm22ΦX2+λ4ΦX4

LμΦμμΦ2m2Φ22+λΦ44

(28)

The Action for this model is given by:

SIntcL,X

SμΦμμΦ2m2Φ22+λΦ44ⅆx1ⅆx2ⅆx3ⅆx4

(29)

The field equations satisfied by Phi are given by:

FundiffS,ΦY

ΦY3λΦYm2ΦY,Y

(30)

Note that the display above is expressed in terms of Y=y1,y2,y3,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.

anssubsY=X,

ansΦ3λΦm2Φ

(31)

To express the dAlembertian in diff notation, use convert.

convertans,diff

Φ3λΦm2+Φx1,x1+Φx2,x2+Φx3,x3Φx4,x4

(32)

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

lprintans

Phi(X)^3*lambda-Phi(X)*m^2-Physics:-dAlembertian(Phi(X),[X])

X1

x1

(33)

X3

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μX. Use the redo option of the Define command to erase and write over the previous definition for A.

DefineA,redo

Defined objects with tensor properties

A,γμ,σμ,μ,gμ,ν,εα,β,μ,ν,Xμ,Yμ

(35)

The functional derivative of AμX with respect to AνY gives:

%FundiffAμX,AνY

δδAνYAμX

(36)

value

δ4x1y1,x2y2,x3y3,x4y4δμνμν

(37)

Introduce now the electromagnetic field tensor Fμ,ν.

CompactDisplayAμX

Ax1,x2,x3,x4will now be displayed asA

(38)

Fμ,νd_μAνXd_νAμX

Fμ,νμAννAμ

(39)

So the action in empty space is given by:

SIntcFμ,ν2,X

SμAννAμ2ⅆx1ⅆx2ⅆx3ⅆx4

(40)

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

FundiffS,AρY

δδAρYμAννAμ2ⅆx1ⅆx2ⅆx3ⅆx4

(41)

subsY=X,

2μνAνν+Aμgμ,ρμ,ρ+2Aν+μνAμμgν,ρν,ρ

(42)

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

Simplify

4μρρAμμ4Aρρ

(43)

See Also

CompactDisplay, d_, dAlembertian, Define, diff, Dirac, Intc, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Physics/diff, Setup, value

References

  

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