genfunc - Maple Programming Help

Home : Support : Online Help : Mathematics : Algebra : Rational Expressions : Rational Generating Functions : genfunc/rgf_expand

genfunc

 rgf_expand
 expand rational generating functions

 Calling Sequence rgf_expand(Fz, z, n)

Parameters

 Fz - rational generating function of z z - name, the generating function variable n - name, the index variable for the expansion of Fz

Description

 • The function finds the closed form expansion of the nth term in the sequence encoded by the rational generating function Fz.
 • If the denominator of Fz has polynomial factors of degree greater than two that cannot be factored over the rationals, an inert Sum expression involving RootOf values is returned.
 • The global variables _J and _R are used in the RootOf expressions.
 • The command with(genfunc,rgf_expand) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{genfunc}\right):$
 > $\mathrm{rgf_expand}\left(\frac{1}{1-5z+6{z}^{2}},z,n\right)$
 ${-}{2}{}{{2}}^{{n}}{+}{3}{}{{3}}^{{n}}$ (1)
 > $\mathrm{rgf_expand}\left(\frac{y}{1-y-{y}^{2}},y,k\right)$
 ${-}\frac{\left(\sqrt{{5}}{-}{1}\right){}\sqrt{{5}}{}{\left({-}\frac{{2}}{{-}\sqrt{{5}}{+}{1}}\right)}^{{k}}}{{5}{}\left({-}\sqrt{{5}}{+}{1}\right)}{-}\frac{\sqrt{{5}}{}{\left({-}\frac{{2}}{\sqrt{{5}}{+}{1}}\right)}^{{k}}}{{5}}$ (2)
 > $\mathrm{rgf_expand}\left(\frac{1+2z+3{z}^{2}}{1-z-{z}^{2}-{z}^{3}},z,n\right)$
 ${\sum }_{{\mathrm{_R}}{=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{+}{{\mathrm{_Z}}}^{{2}}{+}{\mathrm{_Z}}{-}{1}\right)}{}\left({-}\frac{\left(\underset{{z}{\to }{\mathrm{_R}}}{{lim}}{}\left({-}\frac{\left({z}{-}{\mathrm{_R}}\right){}\left({3}{}{{z}}^{{2}}{+}{2}{}{z}{+}{1}\right)}{{{z}}^{{3}}{+}{{z}}^{{2}}{+}{z}{-}{1}}\right)\right){}{\left(\frac{{1}}{{\mathrm{_R}}}\right)}^{{n}}}{{\mathrm{_R}}}\right)$ (3)