| Up | Next | Prev | PrevTail | Tail |
This package provides algebraic manipulations of generalized hypergeometric functions and Meijer’s G function. Generalized hypergeometric functions are simplified towards special functions and Meijer’s G function is simplified towards special functions or generalized hypergeometric functions.
Author: Victor Adamchik, with major updates by Winfried Neun
Some support for numerical evaluation of generalised hypergeometric functions has recently been added by Alan Barnes.
The package SPECFN2 is designed to provide algebraic and numeric manipulations for some less commonly used special functions:
These functions are from the non-core package SPECFN2, which needs to be loaded before use with the command:
load_package specfn2;
More information on the functions provided may be found on the website DLMF:NIST although currently not all functions may conform to these standards.
The (generalised) hypergeometric functions \[ _pF_q \left ( \genfrac {}{}{0pt}{}{a_1, \ldots , a_p}{b_1, \ldots ,b_q} \Bigg \vert z \right ) \] are defined in textbooks on special functions as \[ _pF_q \left ( \genfrac {}{}{0pt}{}{a_1, \ldots , a_p}{b_1, \ldots ,b_q} \Bigg \vert z \right ) = \sum _{n=0}^{\infty }\frac {(a_{1})_{n}\dots (a_{p})_{n}}{(b_{1})_{n}\dots (b_{q})_{n}}\frac {z^{n}}{n!} \] where \((a)_{n}\) is the Pochhammer symbol \[ (a)_{n} = \prod _{k=0}^{n-1} (a+k). \]
The hypergeometric function is currently pretty-printed in REDUCE as \[ _pF_q \left ( \{a_1, \ldots , a_p\},\{b_1, \ldots ,b_q\} \vert z \right ). \]
The function \[ G_{p q}^{m n} \left ( z \ \Bigg \vert \ \genfrac {}{}{0pt}{}{(a_p)}{(b_q)} \right ) \] has been studied by C. S. Meijer beginning in 1936 and has been called Meijer’s G function later on. The complete definition of Meijer’s G function can be found in [PBM89]. Many well-known functions can be written as G functions, e.g. exponentials, logarithms, trigonometric functions, Bessel functions and hypergeometric functions.
Several hundreds of particular values can be found in [PBM89].
The operator hypergeometric expects 3 arguments, namely the list of upper
parameters (which may be empty), the list of lower parameters (which may be empty
too), and the argument, e.g. the input:
hypergeometric ({},{},z);
yields the output
z e
and the input
hypergeometric ({1/2,1},{3/2},-x^2);
gives
atan(abs(x)) -------------- abs(x)
Since hundreds of particular cases for the generalised hypergeometric functions can
be found in the literature, one cannot expect that all cases are known to the
hypergeometric operator. Nevertheless the set of special cases can be augmented by
adding rules to the REDUCE system, e.g.
let {hypergeometric({1/2,1/2},{3/2},-(~x)^2)
=> asinh(x)/x};
If the switch ROUNDED is ON and all the parameters are numeric then the system will attempt to evaluate the generalised hypergeometric function numerically. If any of the parameters \(a_i, b_j\) and \(z\) are complex the switch COMPLEX should also be ON. Generally it is best if the COMPLEX is ON as even if all the parameters are real but \(z>1\) the result will be complex.
If one or more of the parameters \(b_i\) is a negative integer, terms of the series develop a zero denominator, the numerical evaluation fails, unless there is a larger negative integer \(a_j\) (that is \(a_j>b_i\)). Otherwise if one or more of the parameters \(a_j\) is a negative integer, the hypergeometric function reduces to a polynomial.
For the general case the technique used is a fairly naive summation of the defining power series. If \(p<q\) the series converges for all values of \(z\). If \(p>q+1\) the series diverges for all non-zero values of \(z\) except when it degenerates to a polynomial. For \(p=q+1\) the radius of convergence of the series is \(1\). If \(|z|=1\) the series is absolutely convergent if \(\Re \gamma _q >0\), convergent at \(z \neq 1\) if \(-1<\Re \gamma _q \leq 0\) and divergent otherwise, where \[ \gamma _q = (b_1 + \cdots + b_q) - (a_1 + \cdots + a_{q+1}). \] For the special case \(_2F_1\), with a real parameter \(z\) it is possible, in many cases, to use a bilinear transformation of the variable \(z\) to express the result as a linear combination of two functions \(_2F_1\) in a variable \(\tilde z\) such that \(|\tilde z|\leq 1/2\). Thus the rate of convergence of the resultant series may often be improved. For complex \(z\) these transformations also allow the analytic continuation of the hypergeometric function outside the disk \(|z|<1\). In these cases the transformation may always be chosen so that \(|\tilde z| <1\), except for the exceptional cases when \(z=\exp (\pm i\pi /3)\). See Chapters 15 and 16 of DLMF:NIST for more details.
In some cases the convergence may be slow and possibly subject to cancellation errors. In particular this occurs for the case \(p=q+1\) when \(\gamma _q\) is near to zero and also when \(z=\exp (\pm i\pi /3)\). The work on numerical evaluation is at a fairly preliminary stage and it will be possible in some cases to improve the efficiency of the algorithms used.
Outside the radius of convergence of the defining power series the hypergeometric function \(_2F_1\) becomes multivalued and is defined by analytic extension wrt \(z\). The principal branch is obtained by introducing a branch cut along the real axis from \(1\) to \(+\infty \). as one might expect the numerical value returned when \(z\) is real and \(z>1\) is the value on the upper side of the cut, that is regarding the cut as belonging to the first (rather than fourth) quadrant. This differs from Maple which returns the value on the lower side of the cut.
The discontinuity between the values of the principal branch on the two sides of the cut
may be expressed as an hypergeometric function (see DLMF:NIST 15.2.3). Its value for \(_2F_1({a,b},{c}, x)\)
is given by evaluating the algebraic procedure hyper_discont(a,b,c,x) where
\(x>1\).
The operator MeijerG expects 3 arguments, namely the list of upper parameters (which
may be empty), the list of lower parameters (which may be empty too), and the
argument.
The first element of the lists has to be the list of the first \(n\) or \(m\) respective parameters, e.g. to describe \[ G_{1 1}^{1 0} \left ( x \ \Bigg \vert \ \genfrac {}{}{0pt}{}{1}{0} \right ) \] one has to write
MeijerG({{},1},{{0}},x); % and the result is:
sign( - x + 1) + sign(x + 1)
------------------------------
2
and for \[ G_{0 2}^{1 0} \left ( \frac {x^2}{4} \ \Bigg \vert \ \genfrac {}{}{0pt}{}{}{{1+ \frac {1}{4} }, {1-\frac {1}{4}}} \right ) \]
MeijerG({{}},{{1+1/4},1-1/4},(x^2)/4) * sqrt pi;
2 2
sqrt(pi)*sqrt(-----------)*sin(abs(x))*x
abs(x)*pi
-------------------------------------------
4
| Up | Next | Prev | PrevTail | Front |