convert/to_special_function - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Conversion : convert/to_special_function

convert/to_special_function

convert to a function or function class

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

convert(expr, SF, opt_1, opt_2, ...)

Parameters

expr

-

expression

SF

-

name of a mathematical function or function class

opt_i

-

(optional) arguments; they can be given in any order and are described as follows

{x, y, ...}

-

set or list of names; only functions depending on the set or list of names are converted

evaluate

-

optional, default is false, to evaluate the resulting functions

only = F

-

convert only the function(s) F, where F is a function name, a list or set of them, or a function class name

exclude = F

-

do not convert the function(s) F, where F is as in only = ...

include = F

-

convert the function(s) F even if that is not the default behavior

include = powers

-

when converting to hypergeom, MeijerG, or Sum, also convert powers

include = radicals

-

when converting to hypergeom, MeijerG, or Sum, also convert fractional powers (not other powers)

include = all

-

when converting to hypergeom, MeijerG, also convert all powers and elementary functions

skip = ...

-

the right-hand side could be the keyword Global or Local, to skip any of the Global or Local conversion steps

simplifier = S

-

use S instead of the internal default simplifier when performing conversions

simplifier = NONE

-

use no simplifier, thus speeding up processing when performing conversions

rule

-

one or a sequence of keywords indicating conversion rules to be applied additionally, after the main conversion has been performed

Description

• 

A flexible conversion facility in the mathematical language is as important as a dictionary in spoken languages. This page describes such a tool, implemented as a net of conversion routines permitting the expression of any mathematical function in terms of another one, whenever that is possible as a finite sum of terms with rational coefficients. When converting to special functions these coefficients may also involve elementary functions. When the parameters of the functions being converted depend on symbols in a rational manner, any assumptions on these symbols made by the user are taken into account at the time of performing the conversions (see assuming).

• 

The first argument given to convert, expr, is the object being converted. expr can be any Maple mathematical object, such as an expression, equation, a list or set of them.

• 

The second argument, SF, is the name of a mathematical function or that of a function class. The conversion routines attempt to express expr in terms of SF.

• 

The rewriting of expr in terms of SF is performed in two sequential steps, by attempting first a Global and then a Local conversion. A Global conversion is one where the expr to be converted is treated as a whole. Global conversions are implemented for only few target SF functions and typically result in simpler output expressions. A Local conversion is one where only the mathematical functions found in expr are rewritten in terms of SF. Local conversions are implemented for most Maple mathematical functions (see table below).

• 

Two given functions - say, F and G - could in principle be expressed in terms of each other if they belong to the same function class. That condition, however, is in many cases not sufficient: F may be more general than G, or simply the conversion may only be possible for some particular values of the function parameters.

• 

Some mathematical functions automatically evaluate to other functions. So, to perform the conversion to one of these functions, say F, it is sometimes necessary to delay the evaluation of F; see the Examples section.

• 

The functions to which you can convert - the second argument could be one of these - are:

AiryAi

AiryBi

arccos

arccosh

arccot

arccoth

arccsc

arccsch

arcsec

arcsech

arcsin

arcsinh

arctan

arctanh

BellB

BesselI

BesselJ

BesselK

BesselY

ChebyshevT

ChebyshevU

cos

cosh

cot

coth

CoulombF

csc

csch

CylinderD

CylinderU

CylinderV

dilog

Ei

EllipticE

EllipticK

erf

exp

GAMMA

GegenbauerC

HankelH1

HankelH2

HermiteH

hypergeom

JacobiP

KummerM

KummerU

LaguerreL

LegendreP

LegendreQ

ln

MeijerG

polylog

Psi

sec

sech

sin

sinh

SphericalY

tan

tanh

WhittakerM

WhittakerW

Wrightomega

 

• 

When a function class name is given as second argument the routines attempt to express expr using any of the functions of that class. The function classes understood by convert are:

`0F1`

`1F1`

`2F1`

Airy

arctrig

arctrigh

Bessel_related

Chebyshev

Cylinder

Ei_related

elementary

Elliptic_related

erf_related

GAMMA_related

Hankel

Heun

Kelvin

Kummer

Legendre

trig

trigh

Whittaker

 

 

  

* (note spaces between words are filled with _ )

• 

Despite the large number of function classes, most of the functions of mathematical physics belong to one of the three hypergeometric classes: 2F1, 1F1, and 0F1 where these three classes also include as particular cases all the elementary functions (trig, hyperbolic trig, their arcs, exp, and ln).

  

That gives a superficial but straightforward and usually sufficient idea of how the mathematical functions are / could be related between themselves. This division into three sets also tells about the possible elementary form of the special functions of each of the classes 2F1, 1F1, and 0F1: since functions of each class can be transformed between themselves, and each of these three classes contain both special and elementary functions, the elementary form of the special functions of each class can only be obtained using the elementary functions belonging to the same class. For instance, 0F1 includes all the Bessel related and trigonometric functions, from where, for particular values of the parameters entering the Bessel functions, they can be expressed as sin or cos. In the same line, the 2F1 functions include the Legendre and arctrig ones, from where, for particular values of the parameters in the Legendre functions they admit an arctrig form.

The Optional Arguments

  

Optional arguments that can be used to restrict the conversion in different manners are as follows.

  

 

• 

{x,y,...}

  

By default, convert attempts to convert all the mathematical functions found in the given expr (the first argument). To convert only the functions having certain dependency (for example, depending on some variables x, y,...), pass these objects enclosed in a set, for instance as in {x,y,...}.

  

 

• 

only = F

  

You can convert only some specific functions among those found in expr, regardless of their arguments. For that purpose use the option only=F, where F is the name of a function, or a set or list of them, or the name of a function class as a shortcut representing all the functions of that class. For information on which functions are associated to each classes, click the hyperlinks in the table above.

  

 

• 

exclude = F

  

To selectively exclude some functions from the conversion process, use the exclude=F optional argument, where F is as in only=F explained above.

  

 

• 

include = F

  

When converting to a special function - say SF - depending on what SF is, some conversions possible in principle are nevertheless not performed by default. For example, all elementary functions are particular cases of the hypergeometric or MeijerG functions but their conversion is by default avoided. This is because the conversion formulas introducing these rather general functions typically involve elementary functions in the coefficients and to express all of them using hypergeom or MeijerG would frequently clutter the output in an undesired way. This default behavior is automatically overridden when using the only = F option and also when passing the extra argument include = F, where F is a function name, or a list or set of them, or a function class name.

  

 

• 

include = powers

  

In the same line, powers - with fractional exponent or not - can always be expressed as hypergeom or MeijerG, and thus as a Sum but that should be explicitly requested using the optional argument include = powers (all powers will be converted) or include = radicals (only fractional powers will be converted).

  

 

• 

include = all

  

When converting to hypergeom or MeijerG, use this optional argument to have all elementary functions and powers also converted.

  

 

• 

skip=Global or skip=Local

  

To skip any of the Global or Local conversion steps, use skip = Global or skip = Local.

  

 

• 

simplifier=S

  

By default some normalization and combination of powers and Gamma functions are performed before returning a result. Although these simplifications are soft and convenient in most cases, in other cases you may prefer that they not be performed or you may want to perform a different simplification instead of the default one. For these purposes use the optional argument simplifier=NONE (thus, speeding up processing) or simplifier=S, where S could be anything - from a simplification procedure of your choice to just an unassigned name.

  

 

• 

rule

  

When a conversion to a special function - say, SF - is successful, the functions SF appearing in the returned expression are expressed in the way the routines achieved them first. However, most of these functions can be re-expressed in terms of themselves using identities or contiguity rules. For example,

HermiteH(a,z);

HermiteHa,z

(1)

(1) = convert((1), HermiteH, "raise a");

HermiteHa,z=2zHermiteHa+1,zHermiteHa+2,z2a+2

(2)
  

To handle this situation conveniently, the conversion routines accept an optional extra argument indicating a rule; it could be one rule or a sequence of them, to be applied after the conversion has been performed. The rules known by the system are:

"raise a",

"lower a",

"normalize a",

"raise b",

"lower b",

"normalize b",

"raise c",

"lower c",

"normalize c",

"mix a and b",

"1F1 to 0F1",

"0F1 to 1F1"

"quadratic 1",

"quadratic 2",

"quadratic 3"

"quadratic 4",

"quadratic 5",

"quadratic 6"

"2a2b",

"raise 1/2",

"lower 1/2"

Examples

Conversion routines may be of use in many different frameworks, for instance when studying the mathematical functions, when simplifying expressions - for example, to detect zeros - or to express some results in terms of the functions of certain class, or just to express non usual functions in terms of simpler and more familiar ones. The following examples then do not match any particular framework but illustrate how the conversion routines work.

When the parameters of a special function are so that it admits a trigonometric form, an exponential representation is also possible.

WhittakerM0,12,z

WhittakerM0,12,z

(3)

=convert,exp

WhittakerM0,12,z=ⅇ12z1ⅇ12z

(4)

When converting to the two more general functions hypergeom and MeijerG, by default elementary functions are not converted

convert,MeijerG

zMeijerG0,,0,1,zⅇ12z=ⅇ12z1ⅇ12z

(5)

This default behavior can be overridden using the appropriate optional arguments. For example, to convert the expression above to hypergeom including the exponential, (for simplicity) first take the numerator in both sides of the equation:

mapnumer,

zMeijerG0,,0,1,z=ⅇ12z21

(6)

convert,hypergeom,include=exp

zhypergeom1,2,z=hypergeom,,12z21

(7)

The above is in fact an identity for hypergeometric functions; lhs - rhs is zero.

simplifylhsrhs

0

(8)

Generally, most of the special functions of mathematical physics are particular cases of the hypergeometric 2F1, 1F1, and 0F1 functions, where the p in pFq indicates the number of parameters in the first list of hypergeom([...],[...],z) and q represents the number of parameters of the second list. This fact naturally splits the set of functions into three subsets or classes, such that conversions are possible among functions belonging to the same class. For example, starting with a function of the 2F1 class you can typically represent it using other 2F1 type of functions:

JacobiP12,0,1,z

JacobiP12,0,1,z

(9)

convert,EllipticE

2EllipticE122z+2π

(10)

convert,LegendreP

141+zLegendreP12,z+LegendreP12,3z1+z211+z

(11)

convert,GegenbauerC

141+zGegenbauerC12,12,z+GegenbauerC12,12,3z1+z211+z

(12)

convert,hypergeom

141+zhypergeom12,12,1,1212z+hypergeom12,32,1,z11+z211+z

(13)

In the 2F1 class there are the LegendreP, LegendreQ ChebyshevT, GegenbauerC, JacobiP, and all the arctrig functions.

The convert routines also allow converting to a function class making possible to achieve more non-obvious cancellations. In this example, arctrig represents any of the arc trigonometric functions.

1LegendreP12,12,1+4z2z24z2z2141+z221+z214arcsin1+zπ12

12LegendreP12,12,2z2+4z12z2+4z1/4z12z121/4arcsinz1π

(14)

convert,arctrig

0

(15)

The relation between LegendreP and arcsin becomes more visible by representing both in terms of the more general hypergeometric function.

convert,hypergeom,include=elementary

0

(16)

In the 1F1 class, that is, as particular cases of hypergeom([a],[b],z), you have mainly the Kummer, Whittaker, Cylinder, Laguerre, HermiteH, Ei, erf, and the incomplete Gamma functions, the latter represented in Maple by GAMMA with two arguments.

erfz

erfz

(17)

convert,HermiteH

2HermiteH1,zπⅇz2+1

(18)

convert,KummerU

zKummerU1,32,z2z2πⅇz2zz2z2πⅇz2+1

(19)

normalconvert,WhittakerW

zπⅇz2z21/4+WhittakerW14,14,z2ⅇ12z2πⅇz2z23/4

(20)

convert,hypergeom

zπⅇz2z21/4+z21/4πhypergeom,,z22z23/4hypergeom1,32,z2πⅇz2z23/4

(21)

simplify

erfz

(22)

The 0F1 class, includes the Bessel, Hankel, Airy, Kelvin, and trigonometric functions; that is, all of them are particular cases of hypergeom([],[a],z) for some a. For example,

AiAiryAiz

Ai:=AiryAiz

(23)

Ai=convertAi,BesselJ

AiryAiz=13z3/21/3BesselJ13,23z3/213zBesselJ13,23z3/2z3/21/3

(24)

For Re(z) < 0 a simpler formula is valid

Ai&equals;convertAi&comma;BesselJassuming&real;z<0

AiryAiz&equals;13zBesselJ13&comma;23z3&sol;2&plus;BesselJ13&comma;23z3&sol;2

(25)

For Re(z) > 0 a representation in terms of BesselK is given by

Ai&equals;convertAi&comma;BesselKassuming0<&real;z

AiryAiz&equals;133zBesselK13&comma;23z3&sol;2&pi;

(26)

One of the properties of the 0F1 functions is that they can always be expressed in terms of the more general 1F1 functions (the opposite is not always true). Hence, all the Bessel, Airy, Hankel, and Kelvin functions - so called Bessel related - can be expressed in terms of Kummer, Whittaker, or other 1F1 functions.

Ai&equals;convertAi&comma;KummerUassuming0<&real;z

AiryAiz&equals;1331&sol;6z41&sol;3z3&sol;21&sol;3KummerU56&comma;53&comma;43z3&sol;2&pi;&ExponentialE;23z3&sol;2

(27)

Ai&equals;convertAi&comma;WhittakerWassuming0<&real;z

AiryAiz&equals;14z4WhittakerW0&comma;13&comma;43z3&sol;2&pi;z3&sol;2

(28)

Most special functions satisfy identities relating contiguous values of their parameters. These identities can also be computed as "conversions", for instance,

HermiteHa&comma;z

HermiteHa&comma;z

(29)

&equals;convert&comma;HermiteH&comma;raise a

HermiteHa&comma;z&equals;2zHermiteHa&plus;1&comma;zHermiteHa&plus;2&comma;z2a&plus;2

(30)

Many "rule conversions" can be requested at once and performed in a specified order; for instance, consider the following expression:

ee1KummerU32&comma;12&comma;z281KummerU1&comma;32&comma;z2z281KummerU1&comma;32&comma;z2z2z24&plus;1z24

ee:=18KummerU32&comma;12&comma;z218KummerU1&comma;32&comma;z2z214KummerU1&comma;32&comma;z2z2z2&plus;14z2

(31)

By converting it to 'KummerU' and applying rules for normalizing the first and second indices, here respectively called a and b, and then mixing them, you obtain varied representations for the same expression.

convertee&comma;KummerU&comma;normalize a&comma;normalize b&comma;mix a and b

18z2KummerU2&comma;32&comma;z218KummerU12&comma;12&comma;z214KummerU12&comma;12&comma;z2z2&plus;14z2

(32)

convert&comma;KummerU&comma;normalize a&comma;normalize b&comma;mix a and b

182z2&plus;1KummerU12&comma;12&comma;z218KummerU1&comma;32&comma;z2z214KummerU1&comma;32&comma;z2z2z2

(33)

A further manipulation actually shows the expression is equal to zero.

convert&comma;KummerU&comma;normalize a&comma;normalize b&comma;mix a and b

182z2&plus;1KummerU12&comma;12&comma;z218KummerU12&comma;12&comma;z214KummerU12&comma;12&comma;z2z2

(34)

normal

0

(35)

Rules for manipulating 2F1 hypergeometric functions are available as follows. Consider, for instance:

H1hypergeoma&comma;b&comma;c&comma;z