convert/to_special_function
convert to a function or function class
Calling Sequence
Parameters
Description
Examples
References
convert(expr, SF, opt_1, opt_2, ...)
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
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
AppellF1
AppellF2
AppellF3
AppellF4
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
HeunB
HeunC
HeunD
HeunG
HeunT
hypergeom
JacobiP
KummerM
KummerU
LaguerreL
LambertW
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,...}.
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.
To selectively exclude some functions from the conversion process, use the exclude=F optional argument, where F is as in only=F explained above.
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.
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).
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.
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);
HermiteH⁡a,z
(1) = convert((1), HermiteH, "raise a");
HermiteH⁡a,z=z⁢HermiteH⁡a+1,z−HermiteH⁡a+2,z2a+1
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"
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.
WhittakerM⁡0,12,z
=convert⁡,exp
WhittakerM⁡0,12,z=ⅇz2−1ⅇz2
When converting to the two more general functions hypergeom and MeijerG, by default elementary functions are not converted
convert⁡,MeijerG
z⁢MeijerG⁡0,,0,−1,−zⅇz2=ⅇz2−1ⅇz2
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:
map⁡numer,
z⁢MeijerG⁡0,,0,−1,−z=ⅇz22−1
convert⁡,hypergeom,include=exp
z⁢hypergeom⁡1,2,z=hypergeom⁡,,z22−1
The above is in fact an identity for hypergeometric functions; lhs - rhs is zero.
simplify⁡lhs−rhs⁡
0
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:
JacobiP⁡12,0,−1,z
convert⁡,EllipticE
2⁢EllipticE⁡−2⁢z+22π
convert⁡,LegendreP
1+z⁢LegendreP⁡−12,z+LegendreP⁡12,3−z1+z⁢2⁢11+z4
convert⁡,GegenbauerC
1+z⁢GegenbauerC⁡−12,12,z+GegenbauerC⁡12,12,3−z1+z⁢2⁢11+z4
convert⁡,hypergeom
1+z⁢hypergeom⁡12,12,1,12−z2+hypergeom⁡−12,32,1,z−11+z⁢2⁢11+z4
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.
12⁢LegendreP⁡−12,−12,−1+4⁢z−2⁢z2⁢4⁢z−2⁢z214−2⁢−1+z214⁢−1+z−arcsin⁡−1+zπ12
LegendreP⁡−12,−12,−2⁢z2+4⁢z−1⁢−2⁢z2+4⁢z14⁢z−12⁢−2⁢z−1214−arcsin⁡z−1π
convert⁡,arctrig
The relation between LegendreP and arcsin becomes more visible by representing both in terms of the more general hypergeometric function.
convert⁡,hypergeom,include=elementary
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.
erf⁡z
convert⁡,HermiteH
−2⁢HermiteH⁡−1,zπ⁢ⅇz2+1
convert⁡,KummerU
−2⁢z⁢KummerU⁡1,32,z22−π⁢ⅇz2⁢z−z22⁢z2π⁢ⅇz2+1
evala⁡normal⁡convert⁡,WhittakerW
z214⁢π⁢ⅇz2−WhittakerW⁡−14,14,z2⁢ⅇz22⁢z214ⅇz2⁢z⁢π
z214⁢π⁢ⅇz2−z214⁢π⁢hypergeom⁡,,z2+2⁢z234⁢hypergeom⁡1,32,z2⁢z214ⅇz2⁢z⁢π
simplify⁡
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,
Ai≔AiryAi⁡z
Ai=convert⁡Ai,BesselJ
AiryAi⁡z=−z3213⁢BesselJ⁡−13,2⁢−z3233−z⁢BesselJ⁡13,2⁢−z3233⁢−z3213
For Re(z) < 0 a simpler formula is valid
Ai=convert⁡Ai,BesselJassumingℜ⁡z<0
AiryAi⁡z=−z⁢BesselJ⁡13,2⁢−z323+BesselJ⁡−13,2⁢−z3233
For Re(z) > 0 a representation in terms of BesselK is given by
Ai=convert⁡Ai,BesselKassuming0<ℜ⁡z
AiryAi⁡z=3⁢z⁢BesselK⁡13,2⁢z3233⁢π
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=convert⁡Ai,KummerUassuming0<ℜ⁡z
AiryAi⁡z=316⁢z⁢413⁢z3213⁢KummerU⁡56,53,4⁢z3233⁢π⁢ⅇ2⁢z323
Ai=convert⁡Ai,WhittakerWassuming0<ℜ⁡z
AiryAi⁡z=z⁢WhittakerW⁡0,13,4⁢z3232⁢π⁢z32
Most special functions satisfy identities relating contiguous values of their parameters. These identities can also be computed as "conversions", for instance,
=convert⁡,HermiteH,raise a
Many "rule conversions" can be requested at once and performed in a specified order; for instance, consider the following expression:
ee≔18⁢KummerU⁡32,12,z2−18⁢KummerU⁡1,32,z2⁢sqrt⁡z2−14⁢KummerU⁡1,32,z2⁢z2⁢sqrt⁡z2+14⁢sqrt⁡z2
ee≔KummerU⁡32,12,z28−KummerU⁡1,32,z2⁢z28−KummerU⁡1,32,z2⁢z2⁢z24+z24
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.
convert⁡ee,KummerU,normalize a,normalize b,mix a and b
z2⁢KummerU⁡2,32,z28−KummerU⁡12,12,z28−KummerU⁡12,12,z2⁢z24+z24
factor⁡convert⁡,KummerU,normalize a,normalize b,mix a and b
−2⁢z2+1⁢KummerU⁡1,32,z2⁢z2−KummerU⁡12,12,z28
A further manipulation actually shows the expression is equal to zero.
convert⁡,KummerU,normalize a,normalize b,mix a and b
Rules for manipulating 2F1 hypergeometric functions are available as follows. Consider, for instance:
H1≔hypergeom⁡a,b,c,z
ee≔H1=convert⁡H1,hypergeom,raise a
ee≔hypergeom⁡a,b,c,z=−z+2⁢a+b−1⁢z−c+2⁢hypergeom⁡b,a+1,c,z+hypergeom⁡b,a+2,c,z⁢z−1⁢a+1−c+a+1
simplify⁡lhs−rhs⁡ee
Lowering by one the third parameter in all hypergeometric 2F1 functions entering the right-hand side of ee:
lhs⁡ee=collect⁡convert⁡rhs⁡ee,hypergeom,lower c,hypergeom,normal
hypergeom⁡a,b,c,z=z⁢a−b⁢z−2⁢a+c+z−2⁢c−1⁢c−2⁢z−1⁢hypergeom⁡b,a+1,c−2,z−c+1+b⁢a+2−c⁢z⁢−c+a+1+z⁢a−b⁢z−2⁢a+c+z−2⁢c−1⁢z⁢a+b⁢z−2⁢z⁢c+c+4⁢z−2⁢hypergeom⁡b,a+1,c−1,z−c+1+b⁢a+2−c⁢z⁢−c+a+1−c−1⁢c−2⁢z−12⁢a+1⁢hypergeom⁡b,a+2,c−2,z−c+1+b⁢−c+3+a⁢z⁢−c+a+1−c−1⁢z⁢a+b⁢z−2⁢z⁢c+c+5⁢z−2⁢z−1⁢a+1⁢hypergeom⁡b,a+2,c−1,z−c+1+b⁢−c+3+a⁢z⁢−c+a+1
In all cases conversions can be performed with restrictions. Consider for instance
G≔cos⁡z⁢sin⁡x
convert⁡G,exp
ⅇz⁢ⅇI⁢x−ⅇ−I⁢x22+ⅇ−z⁢ⅇI⁢x−ⅇ−I⁢x22
convert⁡G,exp,exclude=sin
ⅇI⁢z⁢sin⁡x2+ⅇ−I⁢z⁢sin⁡x2
convert⁡G,exp,only=sin
cosh⁡z⁢ⅇI⁢x−ⅇ−I⁢x2
The following only converts functions having z
convert⁡G,exp,z
Because some functions automatically evaluate to other functions, in order to perform the conversion to a given function, say F, the network of routines sometimes need to delay the evaluation of F.
convert⁡sin⁡x,sinh
−I⁢sinh⁡I⁢x
To fully evaluate this result after the conversion has been performed, use eval.
eval⁡
sin⁡x
Cheb-Terrab, E.S. "The function advisor project: A Computer Algebra Handbook of Special Functions", Proceedings of the Maple Summer Workshop, University of Waterloo, Ontario, Canada, 2002.
See Also
convert
FunctionAdvisor
MathematicalFunctions
Download Help Document