The gfun package
Gfun is a Maple package that provides tools for
-
guessing a sequence or a series from its first terms;
-
manipulating rigorously solutions of linear differential or recurrence equations, using the equation as a data-structure.
Latest version
gfun 4.10 (April 2025).
Once downloaded, put the folder somewhere in your home directory.
If gfun_path
is that location, set the variable libname
so that Maple knows how to find gfun, by libname:="gfun_path",libname:
Be careful: the new path should appear before that of Maple’s library, otherwise the version of gfun
shipped with Maple will be used. (See the help page of libname
for more information).
It is convenient to add that line to your .mapleinit file (creating it if it does not exist) so that Maple will find the correct version of gfun in your future sessions.
You can then check that the installation worked by asking gfun:-version;
This command should return the number above. (You may have to restart Maple for your changes to be taken into account.)
The source code can be read by anyone who can read Maple code, but if you want to use the package, then it’s better to download it with the link above.
Minimization of linear differential equations
Given a linear differential equation with polynomial coefficients and initial conditions specifying a unique power series solution, the function minimizediffeq (available in versions of gfun ≥ 3.96) computes a linear differential equation of minimal order that has this power series as a solution. When the input equation is returned, it has thus been certified to be minimal. The underlying algorithm is described in the article
A Maple worksheet of examples is available in mw and pdf.
Several properties of a function can be deduced from the minimal differential equation it satisfies.
istranscendental
The function istranscendental takes as input a solution of a linear differential equation specified by an equation and initial conditions and returns a proof that the solution is transcendental, giving a property of the minimal differential equation that allows to detect transcendence. The algorithm is described in the article
A. Bostan, B. Salvy, and M. F. Singer, “On deciding transcendence of power series,” 2025.
A Maple worksheet of examples is available in mw and pdf. (An extra file of data is needed to execute the worksheet.)
algvalues
The function algvalues computes the algebraic values taken by an E-function at algebraic points. It is not part of gfun but can be downloaded here. A worksheet includes the examples given in the article mentioned above can be downloaded in mw and pdf.
Help pages
All the help pages are available directly from within Maple, and here are pdf versions:
-
The gfun package itself.
-
Functions converting expressions to differential or algebraic equations: algfuntoalgeq, algeqtodiffeq, holexprtodiffeq.
-
Functions extracting information from these representations: algeqtoseries, ratpolytocoeff, rectoproc. See also the standard DEtools and LREtools Maple packages, and the NumGfun subpackage.
-
Functions manipulating these expressions, starting with the most commonly used: diffeqtorec, rectodiffeq, algebraicsubs, poltodiffeq, poltorec, borel, cauchyproduct, diffeq+diffeq, diffeq*diffeq, diffeqtohomdiffeq, hadamardproduct, invborel, rec+rec, rec*rec, rectohomrec,indicialpolynomial.
-
New (Aug. 2022): minimizediffeq, a function that finds a minimal-order linear differential equation given an equation and initial conditions.
-
New (Dec. 2024): istranscendental, a function that proves that a solution of a linear differential equation is transcendental.
-
Functions for guessing: listtodiffeq, listtorec, listtoalgeq, listtoratpoly, listtohypergeom, guessgf, seriestodiffeq, seriestorec, seriestoalgeq, seriestoratpoly, seriestohypergeom.
-
NumGfun has its own documentation.
-
Functions related to continued fractions: the ContFrac subpackage, riccati_to_cfrac, expr_to_cfrac, examples from the Handbook of Continued Fractions.
Reference for gfun
The primary reference to use when citing gfun
is the following one:
B. Salvy and P. Zimmermann, “Gfun: a Maple package for the manipulation of generating and holonomic functions in one variable,” ACM Transactions on Mathematical Software, vol. 20, no. 2, pp. 163–177, 1994.
If you are using the NumGfun
subpackage, then the proper reference is:
M. Mezzarobba, “NumGfun: a Package for Numerical and Analytic Computation with D-finite Functions,” in Proceedings of the 2010 International Symposium on Symbolic and Algebraic Computation (ISSAC 2010), 2010, pp. 139–145.
Articles citing gfun
There are many of them. I used to maintain a list, but it is much easier to point directly to the corresponding page on Google Scholar.