functional differentiation - Maple 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 x1,x2,x3,x4=x1,x2,x3,x4.

eeA[μ,ν]X

eeAμ,νX

(6)

The functional derivative of this function with respect to A[rho,tau]y1,y2,y3,y4 is given by:

Fundiffee,A[ρ,τ]Y

δ4x1y1,x2y2,x3y3,x4y4gμρμρgντντ

(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[rho,nu]y1,y2,y3,y4, 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,x4y4gμρμρ

(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,x4y4gμρμρgνσνσ

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

x0A[μ,ν]X

x4Aμ,νX

(21)

Fundiff,A[τ,ρ]Y

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

(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,x4y4gμτμτgνρνρⅆ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.

PDEtools[declare]ΦX

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

(27)

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

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

ΦY,YΦYΦY2λ+m2

(30)

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

anssubsY=X,

ansΦΦΦ2λ+m2

(31)

To express the dAlembertian in diff notation, use convert.

convertans,diff

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

(32)

Note also that the actual Maple mathematical expression behind this default compact display is the one expected, depending on x1,x2,x3,x4=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[mu]x1,x2,x3,x4. 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[mu]x1,x2,x3,x4 with respect to A[nu]y1,y2,y3,y4 gives:

%FundiffA[μ]X,A[ν]Y

δδAνYAμX

(36)

value

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

(37)

Introduce now the electromagnetic field tensor Fmu,nu.

PDEtools[declare]A[μ]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 equations before evaluating the expression.

'Fundiff'S,A[ρ]Y

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

(41)

subsY=X,

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

(42)

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

Simplify

4Aρρ+4μμρρAμ

(43)

See Also

d_, dAlembertian, declare, Define, diff, Dirac, Intc, Physics, Physics conventions, Physics examples, Physics/diff, Setup, value

References

  

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


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam