GenerateRecurrence - Maple Help

MathematicalFunctions[Evalf]

 GenerateRecurrence
 return a procedure to compute the nth coefficient of a power series expansion of the given function (one of the four Appell functions) around the origin

 Calling Sequence GenerateRecurrence(F) GenerateRecurrence(F, simplifier = ..., parameters = ...)

Parameters

 F - any of the 4 Appell functions. simplifier = ... - (optional) simplifier to be applied to the recurrence formula before constructing the procedure to be returned; default value is none parameters = ... - (optional) list with parameters of type name, to be used as parameters of the procedure to be returned, in addition to the recurrence index $i$; default value is []

Description

 • The GenerateRecurrence command accepts one of the Appell functions and returns a procedure to compute the $n$th coefficient of a power series expansion of the given function F around the origin as a function of the $n-1$ previous coefficients. The recurrence is derived from the linear ODE underlying the function by assuming the existence of a power series solution for it. This means that only the first coefficients (initial conditions of the ODE) involve mathematical functions - all the other ones only involve arithmetic operations involving the value of those first coefficients, thus resulting in an efficient way of numerically computing the value of the function.
 • Within the context of that linear ODE, the value of the last argument of F is always ignored, taken to be a symbol, say $z$, and the linear ODE is constructed with $z$ as independent variable. To evaluate the function, the recurrence-procedure returned - say $u$- is used to generate the coefficient of a power series in $z$, as in ${\sum }_{n=0}^{\mathrm{\infty }}u\left(n\right){z}^{n}$.
 • Depending on the value of the function's parameters (for example if they imply on a singular function, or the hypergeometric functions entering the initial conditions of the recurrence are divergent) it is not possible to construct a recurrence. In these cases GenerateRecurrence returns FAIL.
 • This approach, which within the Evalf package is referred as the series/recurrence approach, is one of the main methods for numerically evaluating mathematical functions and expressions where one or both of the following situations happen:
 a. The underlying differential equation has singularities, as it is the case of most special functions of the mathematical language.
 b. There is no closed form series expansion formula known (e.g. the Heun functions).
 • The recurrence returned by GenerateRecurrence can effectively compute the value of the given function provided that the following conditions are met:
 – The evaluation point $z$ where the function is to be numerically evaluated (the last argument of F) is not a singularity of the linear ODE underlying the given function F. To see the location of these singularities, use the Evalf:-Singularities command.
 – The evaluation point $z$ is within the radius of convergence of an expansion around the origin, i.e.: the distance from the origin to $z$ is smaller than the distance from the origin to the singularity closer to it.
 – The recurrence depends on $N$ initial conditions, $N\le d$ where $d$ is the order of the differential equation behind the function, that should be numerically computable by other means. These initial conditions are mainly the value of F and its first or also higher derivatives at the origin.
 Generally speaking, when the recurrence can be used to evaluate a function at some (any) point ${z}_{0}$, by using a sequence of concatenated Taylor series expansions (that in turn requires knowing the recurrence formula for an expansion around an arbitrary ${z}_{0}$, that can also be derived from the underlying differential equation), the function can be computed over the whole complex plane.
 • When there are symbolic parameters (i.e.: not numbers) in the recurrence formula returned, it is frequently desired to simplify the result. For that purpose, use the option simplifier = ... where the right-hand side is the simplifier you want to be used. This simplification will be applied to the formula before constructing the procedure to be returned. Note however that this simplification is not applied to each coefficient each time the returned procedure is applied.
 • By default, the returned procedure is a function of the recursion index. If the given function F contains symbolic (i.e not a number) parameters, you may prefer to have the returned procedure being a function of these symbolic parameters as well. For that purpose, use the option parameters = [...], where the right-hand side is a list with the parameters to appear after the recursion index in the parameters of the returned procedure.

Examples

 Initialization: Load the package and set the display of special functions in output to typeset mathematical notation (textbook notation):
 > $\mathrm{with}\left(\mathrm{MathematicalFunctions}:-\mathrm{Evalf}\right);\mathrm{Typesetting}:-\mathrm{EnableTypesetRule}\left(\mathrm{Typesetting}:-\mathrm{SpecialFunctionRules}\right):$
 $\left\{{\mathrm{Add}}{,}{\mathrm{Evalb}}{,}{\mathrm{Zoom}}{,}{\mathrm{QuadrantNumbers}}{,}{\mathrm{Singularities}}{,}{\mathrm{GenerateRecurrence}}{,}{\mathrm{PairwiseSummation}}\right\}$ (1)

Consider the AppellF2 function for some values of its parameters, for instance

 > $\mathrm{F2}≔\mathrm{AppellF2}\left(1,2,3,4,5,6,\mathrm{z2}\right)$
 ${\mathrm{F2}}{≔}{{F}}_{{2}}{}\left({1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{\mathrm{z2}}\right)$ (2)

Check the singularities of this function, that is the values of $\mathrm{z2}$ for which the underlying ODE has singularities

 > $\mathrm{Singularities}\left(\mathrm{F2}\right)$
 $\left[{0}{,}{1}{,}{-5}{,}{\mathrm{\infty }}{+}{\mathrm{\infty }}{}{I}\right]$ (3)

We see that the singularity closer to the origin is located at $\mathrm{z2}=1$. So, we can generate a recurrence to evaluate this function in the interval $0\le \mathrm{z2}$ $<1$. Assign the result to $u$

 > $u≔\mathrm{GenerateRecurrence}\left(\mathrm{F2}\right)$
 ${u}{≔}{\mathbf{proc}}\left({i}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{hfloat}}{,}{\mathrm{cache}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{if}}{}\left({i}{::}{\mathrm{nonnegint}}{,}{4}{/}{5}{*}\left({i}{^}{2}{-}{4}\right){*}{\mathrm{thisproc}}{}\left({i}{-}{1}\right){/}\left(\left({i}{+}{4}\right){*}{i}\right){+}{1}{/}{5}{*}\left({i}{^}{3}{-}{i}{^}{2}{-}{10}{*}{i}{-}{8}\right){*}{\mathrm{thisproc}}{}\left({i}{-}{2}\right){/}\left({i}{*}\left({i}{+}{4}\right){*}\left({i}{+}{3}\right)\right){,}{'}{\mathrm{procname}}{}\left({\mathrm{args}}\right){'}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (4)

Note also that, then the only parameter of the procedure returned is the recurrence index, this procedure always has a cache with the first coefficients - the higher coefficients depend on them - and there are four cached coefficients, because AppellF2 satisfies a fourth order linear ODE:

 > $\mathrm{op}\left(4,\mathrm{eval}\left(u\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{permanent}}'{=}\left[{0}{=}{}_{{2}}{F}_{{1}}{}\left({1}{,}{2}{;}{4}{;}{6}\right){,}{1}{=}\frac{{3}{}{}_{{2}}{F}_{{1}}{}\left({2}{,}{2}{;}{4}{;}{6}\right)}{{5}}{,}{2}{=}\frac{{2}{}{}_{{2}}{F}_{{1}}{}\left({2}{,}{3}{;}{4}{;}{6}\right)}{{5}}{,}{3}{=}\frac{{2}{}{}_{{1}}{F}_{{0}}{}\left({2}{;}{;}{6}\right)}{{7}}\right]\right)$ (5)

Since the higher coefficients only depend on the lower coefficients, the above means that all the coefficients of a series expansion around the origin can be expressed in terms of only these four hypergeometric functions.

When $n$ is a non-positive integer (nonposint), the procedure works recursively down until the lowest cached coefficients, caching each intermediate result. For example, the sixth coefficient is

 > $u\left(6\right)$
 $\frac{{188}{}{}_{{1}}{F}_{{0}}{}\left({2}{;}{;}{6}\right)}{{9375}}$ (6)

Check the cache of $u$

 > $\mathrm{op}\left(4,\mathrm{eval}\left(u\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{temporary}}'{=}\left[{4}{=}\frac{{3}{}{}_{{1}}{F}_{{0}}{}\left({2}{;}{;}{6}\right)}{{35}}{,}{5}{=}\frac{{29}{}{}_{{1}}{F}_{{0}}{}\left({2}{;}{;}{6}\right)}{{750}}{,}{6}{=}\frac{{188}{}{}_{{1}}{F}_{{0}}{}\left({2}{;}{;}{6}\right)}{{9375}}\right]{,}'{\mathrm{permanent}}'{=}\left[{0}{=}{}_{{2}}{F}_{{1}}{}\left({1}{,}{2}{;}{4}{;}{6}\right){,}{1}{=}\frac{{3}{}{}_{{2}}{F}_{{1}}{}\left({2}{,}{2}{;}{4}{;}{6}\right)}{{5}}{,}{2}{=}\frac{{2}{}{}_{{2}}{F}_{{1}}{}\left({2}{,}{3}{;}{4}{;}{6}\right)}{{5}}{,}{3}{=}\frac{{2}{}{}_{{1}}{F}_{{0}}{}\left({2}{;}{;}{6}\right)}{{7}}\right]\right)$ (7)

When the recurrence index is not a non-positive integer, the procedure $u$ returns unevaluated, just echoing the input

 > $u\left(n\right)$
 ${u}{}\left({n}\right)$ (8)

To have these coefficients numerically evaluated, for instance the lower order coefficients with hypergeometric functions with which the higher ones are constructed, apply evalf

 > $\mathrm{evalf}\left(\right)$
 ${0.0008021333332}$ (9)

Alternatively, if you pass the function F with floating-point arguments, evalf will automatically be applied each time you call the returned procedure. In these cases, to avoid a premature automatic evaluation of the function F itself in the presence of floating-point arguments, either use delay-evaluation quotes (see unevaluated) or use the InertForm of the function, %AppellF2. This is displayed as AppellF2 but in gray.

 > $\mathrm{IF2}≔\mathrm{%AppellF2}\left(1.0,2.0,3.0,4.0,5.0,6.0,\mathrm{z__2}\right)$
 ${\mathrm{IF2}}{≔}{\mathrm{%AppellF2}}{}\left({1.0}{,}{2.0}{,}{3.0}{,}{4.0}{,}{5.0}{,}{6.0}{,}\mathit{z__2}\right)$ (10)
 > $u≔\mathrm{GenerateRecurrence}\left(\mathrm{IF2}\right)$
 ${u}{≔}{\mathbf{proc}}\left({i}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{hfloat}}{,}{\mathrm{cache}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{if}}{}\left({i}{::}{\mathrm{nonnegint}}{,}\left({0.8}{*}{i}{^}{2}{-}{3.2}\right){*}{\mathrm{thisproc}}{}\left({i}{-}{1}\right){/}\left(\left({i}{+}{4.}\right){*}{i}\right){+}\left({0.2}{*}{i}{^}{3}{-}{0.2}{*}{i}{^}{2}{-}{2.}{*}{i}{-}{1.6}\right){*}{\mathrm{thisproc}}{}\left({i}{-}{2}\right){/}\left({i}{*}\left({i}{^}{2}{+}{7.}{*}{i}{+}{12.}\right)\right){,}{'}{\mathrm{procname}}{}\left({\mathrm{args}}\right){'}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (11)
 > $u\left(0\right)$
 ${-0.5568663767}{-}{0.4363323130}{}{I}$ (12)
 > $u\left(6\right)$
 ${0.0008021333335}{+}{0.}{}{I}$ (13)

Check the cache of the - now all-numeric - coefficients

 > $\mathrm{op}\left(4,\mathrm{eval}\left(u\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{temporary}}'{=}\left[{4}{=}{0.003428571429}{+}{0.}{}{I}{,}{5}{=}{0.001546666667}{+}{0.}{}{I}{,}{6}{=}{0.0008021333335}{+}{0.}{}{I}\right]{,}'{\mathrm{permanent}}'{=}\left[{0}{=}{-0.5568663767}{-}{0.4363323130}{}{I}{,}{1}{=}{-0.09270413916}{+}{0.2094395102}{}{I}{,}{2}{=}{0.04454931012}{+}{0.03490658504}{}{I}{,}{3}{=}{0.01142857143}\right]\right)$ (14)

A routine for the numerical evaluation of the AppellF2 function

 Provided that the evaluation point is within the radius of convergence of the series expansion, this approach can be used to produce a procedure to evaluate the AppellF2 function for arbitrary values of its parameters. For example, start with the general form of AppellF2
 > $\mathrm{F2}≔\mathrm{AppellF2}\left(a,\mathrm{b1},\mathrm{b2},\mathrm{c1},\mathrm{c2},\mathrm{z1},\mathrm{z2}\right)$
 ${\mathrm{F2}}{≔}{{F}}_{{2}}{}\left({a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right)$ (15)
 • Generate now a recurrence-procedure to evaluate the coefficients (of a power series expansion around the origin) for generic values of the function's parameters, and make this procedure also be a function of the parameters of $\mathrm{F2}$. Assign the result to $U$
 > $U≔\mathrm{GenerateRecurrence}\left(\mathrm{F2},\mathrm{parameters}=\left[\mathrm{op}\left(\mathrm{F2}\right)\right]\right)$
 ${U}{≔}{\mathbf{proc}}\left({i}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{cache}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{if}}{}\left({i}{::}{\mathrm{nonnegint}}{,}{\mathrm{if}}{}\left({i}{<}{4}{,}{T}{[}{i}{]}{}\left({i}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){,}\left({i}{+}{\mathrm{b2}}{-}{1}\right){*}\left(\left({a}{+}{i}{-}{\mathrm{b1}}{-}{1}\right){*}{\mathrm{z1}}{-}{2}{*}{a}{-}{2}{*}{i}{+}{\mathrm{c1}}{+}{2}\right){*}{\mathrm{thisproc}}{}\left({i}{-}{1}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){/}\left(\left({\mathrm{z1}}{-}{1}\right){*}\left({i}{+}{\mathrm{c2}}{-}{1}\right){*}{i}\right){+}\left({i}{+}{\mathrm{b2}}{-}{1}\right){*}\left({i}{+}{\mathrm{b2}}{-}{2}\right){*}\left({a}{+}{i}{-}{2}\right){*}\left({a}{+}{i}{-}{\mathrm{c1}}{-}{1}\right){*}{\mathrm{thisproc}}{}\left({i}{-}{2}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){/}\left({i}{*}\left({i}{-}{1}\right){*}\left({i}{+}{\mathrm{c2}}{-}{1}\right){*}\left({i}{+}{\mathrm{c2}}{-}{2}\right){*}\left({\mathrm{z1}}{-}{1}\right)\right)\right){,}{'}{\mathrm{procname}}{}\left({\mathrm{args}}\right){'}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (16)
 Check it out for some values of the parameters $a,\mathrm{b1},\mathrm{b2},\mathrm{c1},\mathrm{c2},\mathrm{z1},\mathrm{z2}$ - recall that the first argument indicates the coefficient to be computed
 > $U\left(0,1,\frac{1}{2},\frac{1}{3},\frac{1}{4},\frac{1}{5},\frac{1}{6},\frac{1}{7}\right)$
 ${}_{{2}}{F}_{{1}}{}\left(\frac{{1}}{{2}}{,}{1}{;}\frac{{1}}{{4}}{;}\frac{{1}}{{6}}\right)$ (17)
 > $U\left(5,7,6,5,4,3,2,\frac{1}{4}\right)$
 $\frac{{16884}{}{}_{{2}}{F}_{{1}}{}\left({6}{,}{10}{;}{4}{;}{2}\right)}{{5}}{-}\frac{{6048}{}{}_{{2}}{F}_{{1}}{}\left({6}{,}{9}{;}{4}{;}{2}\right)}{{5}}$ (18)
 This general procedure $U$ is used now to construct another procedure, following the steps indicated in Evalf:-Add, to numerically evaluate AppellF2 when the evaluation point $\mathrm{z2}$ is within the radius of convergence of the expansion. This is the sum form for AppellF2 using $U$ computed above
 > $\mathrm{F2}={\sum }_{n=0}^{\mathrm{\infty }}U\left(n,\mathrm{op}\left(\mathrm{F2}\right)\right){\mathrm{z2}}^{n}$
 ${{F}}_{{2}}{}\left({a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){=}{\sum }_{{n}{=}{0}}^{{\mathrm{\infty }}}{}{U}{}\left({n}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){}{{\mathrm{z2}}}^{{n}}$ (19)
 Get the summand
 > $\mathrm{summand}≔\mathrm{op}\left(1,\mathrm{rhs}\left(\right)\right)$
 ${\mathrm{summand}}{≔}{U}{}\left({n}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){}{{\mathrm{z2}}}^{{n}}$ (20)
 Construct with it a general formula that can be passed to Evalf:-Add
 > $\mathrm{general_formula}≔\mathrm{unapply}\left(\mathrm{summand},n\right)$
 ${\mathrm{general_formula}}{≔}{n}{↦}{U}{}\left({n}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){}{{\mathrm{z2}}}^{{n}}$ (21)
 Use the extension mechanism of evalf to construct a numerical evaluation procedure as indicated in the help page of Evalf:-Add (recall the relevance of the use of :- in this step). Call $\mathrm{AF2}$ this representation of AppellF2
 > $\mathrm{evalf/AF2}≔\left(a,\mathrm{b1},\mathrm{b2},\mathrm{c1},\mathrm{c2},\mathrm{z1},\mathrm{z2}\right)→\mathrm{Add}\left(\mathrm{subs}\left(\left[:-a=a,:-\mathrm{b1}=\mathrm{b1},:-\mathrm{b2}=\mathrm{b2},:-\mathrm{c1}=\mathrm{c1},:-\mathrm{c2}=\mathrm{c2},:-\mathrm{z1}=\mathrm{z1},:-\mathrm{z2}=\mathrm{z2}\right],\mathrm{eval}\left(\mathrm{general_formula}\right)\right)\right)$
 ${\mathrm{evalf/AF2}}{≔}\left({a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){↦}{\mathrm{Add}}{}\left({\mathrm{subs}}{}\left(\left[{:-}{a}{=}{a}{,}{:-}{\mathrm{b1}}{=}{\mathrm{b1}}{,}{:-}{\mathrm{b2}}{=}{\mathrm{b2}}{,}{:-}{\mathrm{c1}}{=}{\mathrm{c1}}{,}{:-}{\mathrm{c2}}{=}{\mathrm{c2}}{,}{:-}{\mathrm{z1}}{=}{\mathrm{z1}}{,}{:-}{\mathrm{z2}}{=}{\mathrm{z2}}\right]{,}{\mathrm{eval}}{}\left({\mathrm{general_formula}}\right)\right)\right)$ (22)
 So this is the $\mathrm{AF2}$ function
 > $\mathrm{AF2}\left(1,2,3,4,5,6,\frac{1}{2}\right)$
 ${\mathrm{AF2}}{}\left({1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}\frac{{1}}{{2}}\right)$ (23)
 Check whether the evaluation point, $\mathrm{z2}=\frac{1}{2}$, is within the radius of convergence; i.e.: whether the distance between the origin and the singularity closer to the origin is larger than $\frac{1}{2}$:
 > $\mathrm{Singularities}\left(\mathrm{subs}\left(\mathrm{AF2}=\mathrm{AppellF2},\right)\right)$
 $\left[{0}{,}{1}{,}{-5}{,}{\mathrm{\infty }}{+}{\mathrm{\infty }}{}{I}\right]$ (24)
 So $\frac{1}{2}$ is within the radius of convergence that is equal to 1. Hence this is the numerical evaluation of $\mathrm{AF2}\left(1,2,3,4,5,6,\frac{1}{2}\right)$
 > $\mathrm{evalf}\left(\right)$
 ${-0.5903721137}{-}{0.3228859116}{}{I}$ (25)
 Compare with the numerical evaluation of the Maple standard AppellF2 function
 > $\mathrm{subs}\left(\mathrm{AF2}=\mathrm{AppellF2},\right)$
 ${{F}}_{{2}}{}\left({1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}\frac{{1}}{{2}}\right)$ (26)
 > $\mathrm{evalf}\left(\right)$
 ${-0.5903721137}{-}{0.3228859116}{}{I}$ (27)
 Finally, note that the general procedure $U$ that works with arbitrary values of the parameters of an AppellF2 function, has, for instance, $\mathrm{z1}-1$ in the denominator of each coefficient of the series expansion. These factors that could-be-zero in the denominator frequently indicate a special case, for which the general formula is not valid. To generate the recurrence procedure for these cases, pass the function with the special case applied. In this example that would be the function at $\mathrm{z1}=1$
 >
 ${\mathrm{F2z1}}{≔}{\mathrm{%AppellF2}}{}\left({a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{1}{,}{\mathrm{z2}}\right)$ (28)
 Generate a recurrence procedure for this special case, call it $\mathrm{U1}$
 > $\mathrm{U1}≔\mathrm{GenerateRecurrence}\left(\mathrm{F2z1},\mathrm{parameters}=\left[\mathrm{op}\left(\mathrm{F2}\right)\right]\right)$
 ${\mathrm{U1}}{≔}{\mathbf{proc}}\left({i}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{cache}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{if}}{}\left({i}{::}{\mathrm{nonnegint}}{,}{\mathrm{if}}{}\left({i}{<}{4}{,}{T}{[}{i}{]}{}\left({i}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){,}\left({a}{+}{i}{-}{1}\right){*}\left({a}{+}{i}{-}{\mathrm{c1}}\right){*}\left({i}{+}{\mathrm{b2}}{-}{1}\right){*}{\mathrm{thisproc}}{}\left({i}{-}{1}{,}{a}{,}{\mathrm{b1}}{,}{\mathrm{b2}}{,}{\mathrm{c1}}{,}{\mathrm{c2}}{,}{\mathrm{z1}}{,}{\mathrm{z2}}\right){/}\left({i}{*}\left({i}{+}{\mathrm{c2}}{-}{1}\right){*}\left({i}{+}{a}{+}{\mathrm{b1}}{-}{\mathrm{c1}}\right)\right)\right){,}{'}{\mathrm{procname}}{}\left({\mathrm{args}}\right){'}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (29)
 Note that in this particular case of $\mathrm{z1}=1$, the coefficients of order 0 to 3 all involve hypergeometric functions at $\mathrm{z1}=1$
 > $\mathrm{U1}\left(0,a,\mathrm{b1},\mathrm{b2},\mathrm{c1},\mathrm{c2},1,\mathrm{z2}\right)$
 ${}_{{2}}{F}_{{1}}{}\left({a}{,}{\mathrm{b1}}{;}{\mathrm{c1}}{;}{1}\right)$ (30)
 > $\mathrm{U1}\left(1,a,\mathrm{b1},\mathrm{b2},\mathrm{c1},\mathrm{c2},1,\mathrm{z2}\right)$
 $\frac{{a}{}{\mathrm{b2}}{}{}_{{2}}{F}_{{1}}{}\left({\mathrm{b1}}{,}{a}{+}{1}{;}{\mathrm{c1}}{;}{1}\right)}{{\mathrm{c2}}}$ (31)
 > $\mathrm{U1}\left(2,a,\mathrm{b1},\mathrm{b2},\mathrm{c1},\mathrm{c2},1,\mathrm{z2}\right)$
 $\frac{{a}{}{\mathrm{b2}}{}\left({a}{+}{1}\right){}\left({\mathrm{b2}}{+}{1}\right){}{}_{{2}}{F}_{{1}}{}\left({\mathrm{b1}}{,}{2}{+}{a}{;}{\mathrm{c1}}{;}{1}\right)}{{2}{}{\mathrm{c2}}{}\left({\mathrm{c2}}{+}{1}\right)}$ (32)
 > $\mathrm{U1}\left(3,a,\mathrm{b1},\mathrm{b2},\mathrm{c1},\mathrm{c2},1,\mathrm{z2}\right)$
 $\frac{{a}{}{\mathrm{b2}}{}{}_{{2}}{F}_{{1}}{}\left({\mathrm{b1}}{,}{a}{+}{3}{;}{\mathrm{c1}}{;}{1}\right){}\left({\mathrm{b2}}{+}{2}\right){}\left({\mathrm{b2}}{+}{1}\right){}\left({2}{+}{a}\right){}\left({a}{+}{1}\right)}{{6}{}{\mathrm{c2}}{}\left({{\mathrm{c2}}}^{{2}}{+}{3}{}{\mathrm{c2}}{+}{2}\right)}$ (33)
 The recurrence in this case thus only exists if these four hypergeometric functions are convergent, which in turn will only happen if $0<\mathrm{\Re }\left(c-a-\mathrm{b1}\right),0<\mathrm{\Re }\left(c-a-1-\mathrm{b1}\right),0<\mathrm{\Re }\left(c-2-a-\mathrm{b1}\right)$, and $0<\mathrm{\Re }\left(c-a-3-\mathrm{b1}\right)$, so that if you passed values such that any of these condition is not met, for example $\mathrm{c1}=1,a=2,b=3$, the recurrence cannot be constructed and GenerateRecurrence returns FAIL
 >
 ${\mathrm{FAIL}}$ (34)

Compatibility

 • The MathematicalFunctions[Evalf][GenerateRecurrence] command was introduced in Maple 2017.