functional differentiation - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : Physics/Fundiff

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,γμ,σμ,Xμ,Yμ,μ,gμ,ν,εα,β,μ,ν

(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

Diracx1y1,x2y2,x3y3,x4y4g_μ,~rhog_ν,~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ρ,ν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

4Diracx1y1,x2y2,x3y3,x4y4g_μ,~rho

(8)

Fundiffee,Aμ,νY

16Diracx1y1,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

FundifffX,fY

(11)

Diracx1y1,x2y2,x3y3,x4y4

(12)

%FundifffX,fY

%FundifffX,fY

(13)

%FundifffX,fY

(14)

value

Diracx1y1,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

dAlembertianDiracx1y1,x2y2,x3y3,x4y4,Xg_μ,~rhog_ν,~sigma

(18)

d_μAX

μAX

(19)

Fundiff,AY

d_μDiracx1y1,x2y2,x3y3,x4y4,X

(20)

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

x0Aμ,νX

x4Aμ,νX

(21)

Fundiff,Aτ,ρY

Dirac0,0,0,1,x1y1,x2y2,x3y3,x4y4g_μ,~taug_ν,~rho

(22)

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

IntcPX,X

IntIntIntIntPXDirac0,0,0,1,x1y1,x2y2,x3y3,x4y4g_μ,~taug_ν,~rho,x1=∞..∞,x2=∞..∞,x3=∞..∞,x4=∞..∞

(23)

This integral can be computed by using the value command.

value

g_μτμτg_νρνρ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.

Intc1ⅆⅆτqτ221kqτ22,τ

ⅆⅆτ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.

PDEtoolsdeclareΦX

PhiXwill now be displayed asΦ

(27)

L1d_μΦXd_μΦX2m2ΦX22+λΦX44

12d_μΦX,Xd_~muΦX,X12m2ΦX2+14λΦX4

(28)

The Action for this model is given by:

SIntcL,X

IntIntIntInt12d_μΦX,Xd_~muΦX,X12m2ΦX2+14λΦX4,x1=∞..∞,x2=∞..∞,x3=∞..∞,x4=∞..∞

(29)

The field equations satisfied by Phi are given by:

FundiffS,ΦY

ΦY,YΦYΦY2λ+m2

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

dAlembertianΦX,XΦXΦX2λ+m2

(31)

To express the dAlembertian in diff notation, use convert.

convertans,diff

diffdiffΦX,x1,x1+diffdiffΦX,x2,x2+diffdiffΦX,x3,x3diffdiffΦX,x4,x4ΦXΦX2λ+m2

(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

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

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,γμ,σμ,Xμ,Yμ,μ,gμ,ν,εα,β,μ,ν

(35)

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

%FundiffAμX,AνY

%FundiffAμX,AνY

(36)

value

Diracx1y1,x2y2,x3y3,x4y4g_μ,~nu

(37)

Introduce now the electromagnetic field tensor Fμ,ν.

PDEtoolsdeclareAμX

AXwill now be displayed asA

(38)

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

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

(39)

So the action in empty space is given by:

SIntcFμ,ν2,X

IntIntIntIntd_μAνX,Xd_νAμX,X2,x1=∞..∞,x2=∞..∞,x3=∞..∞,x4=∞..∞

(40)

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

'Fundiff'S,AρY

FundiffIntIntIntIntd_μAνX,Xd_νAμX,X2,x1=∞..∞,x2=∞..∞,x3=∞..∞,x4=∞..∞,AρY

(41)

subsY=X,

2d_μd_νA~nuX,X,X2dAlembertianAμX,Xg_~mu,~rho+2dAlembertianAνX,X+2d_μd_νA~muX,X,Xg_~nu,~rho

(42)

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

Simplify

4dAlembertianA~rhoX,X+4d_νd_~rhoA~nuX,X,X

(43)

See Also

d_, dAlembertian, declare, 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.