convert/to_special_function - convert to a function or function class
|
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
|
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:
|
•
|
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:
|
|
* (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.
|
|
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.
|
|
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,
|
| (1) |
>
|
(1) = convert((1), HermiteH, "raise a");
|
| (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.
>
|
|
| (3) |
>
|
|
| (4) |
When converting to the two more general functions hypergeom and MeijerG, by default elementary functions are not converted
>
|
|
| (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:
>
|
|
| (6) |
>
|
|
| (7) |
The above is in fact an identity for hypergeometric functions; lhs - rhs is zero.
>
|
|
| (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:
>
|
|
| (9) |
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
>
|
|
| (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.
>
|
|
| (14) |
>
|
|
| (15) |
The relation between LegendreP and arcsin becomes more visible by representing both in terms of the more general hypergeometric function.
>
|
|
| (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.
>
|
|
| (17) |
>
|
|
| (18) |
>
|
|
| (19) |
>
|
|
| (20) |
>
|
|
| (21) |
>
|
|
| (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,
>
|
|
| (23) |
>
|
|
| (24) |
For Re(z) < 0 a simpler formula is valid
>
|
|
| (25) |
For Re(z) > 0 a representation in terms of BesselK is given by
>
|
|
| (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.
>
|
|
| (27) |
>
|
|
| (28) |
Most special functions satisfy identities relating contiguous values of their parameters. These identities can also be computed as "conversions", for instance,
>
|
|
| (29) |
>
|
|
| (30) |
Many "rule conversions" can be requested at once and performed in a specified order; for instance, consider the following expression:
>
|
|
| (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.
>
|
|
| (32) |
>
|
|
| (33) |
A further manipulation actually shows the expression is equal to zero.
>
|
|
| (34) |
>
|
|
| (35) |
Rules for manipulating 2F1 hypergeometric functions are available as follows. Consider, for instance:
>
|
|
| (36) |
>
|
|
| (37) |
>
|
|
| (38) |
Lowering by one the third parameter in all hypergeometric 2F1 functions entering the right-hand side of :
>
|
|
| (39) |
>
|
|
| (40) |
In all cases conversions can be performed with restrictions. Consider for instance
>
|
|
| (41) |
>
|
|
| (42) |
>
|
|
| (43) |
>
|
|
| (44) |
>
|
|
| (45) |
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.
>
|
|
| (46) |
To fully evaluate this result after the conversion has been performed, use eval.
>
|
|
| (47) |
|
|
References
|
|
|
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.
|
|
|