compute closed forms of indefinite sums - Maple Help

Home : Support : Online Help : Mathematics : Discrete Mathematics : Summation and Difference Equations : SumTools : SumTools/IndefiniteSum/Indefinite

SumTools[IndefiniteSum][Indefinite] - compute closed forms of indefinite sums

 Calling Sequence Indefinite(f, k, opt)

Parameters

 f - expression depending on k k - name opt - (optional) equation of the form failpoints=true or failpoints=false

Description

 • The Indefinite(f, k) command computes a closed form of the indefinite sum of $f$ with respect to $k$.
 • The command uses a combination of algorithms handling various classes of summands. They include the classes of polynomials, rational functions, and hypergeometric terms and j-fold hypergeometric terms, functions for which their minimal annihilators can be constructed, for example, d'Alembertian terms. For more information, see LinearOperators.
 A library extension mechanism is also used to include sums for which an algorithmic approach to finding closed forms does not yet exist. Currently the computable summands include expressions containing the harmonic function, logarithmic function, digamma and polygamma functions, and sin, cos, and the exponential functions.
 • If the option failpoints=true (or just failpoints for short) is specified, then the command returns a pair $s,\left[p,q\right]$, where
 – $s$ is a closed form of the indefinite sum of $f$ w.r.t. $k$, as above,
 – $p$ is a list of intervals $\left[{a}_{1}..{b}_{1},{a}_{2}..{b}_{2},\mathrm{...},{a}_{m}..{b}_{m}\right]$ where $f$ does not exist, and
 – $q$ is a list of points ${k}_{i}$ where the computed sum $s$ does not satisfy the telescoping equation $s\left({k}_{i}+1\right)-s\left({k}_{i}\right)=f\left({k}_{i}\right)$ or does not exist.
 If such points appear in the summation interval, the discrete Newton-Leibniz formula may fail.
 • If the command is unable to compute one of the lists $p,q$, the command returns $s,\mathrm{FAIL}$.

Examples

 > $\mathrm{with}\left(\mathrm{SumTools}[\mathrm{IndefiniteSum}]\right):$

An example of a rationally summable expression:

 > $f:=\frac{1}{{n}^{2}+\sqrt{5}n-1}$
 ${f}{:=}\frac{{1}}{{{n}}^{{2}}{+}\sqrt{{5}}{}{n}{-}{1}}$ (1)
 > $s:=\mathrm{Indefinite}\left(f,n\right)$
 ${s}{:=}{-}\frac{{1}}{{3}{}\left({n}{-}\frac{{3}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}{-}\frac{{1}}{{3}{}\left({n}{-}\frac{{1}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}{-}\frac{{1}}{{3}{}\left({n}{+}\frac{{1}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}$ (2)

Check the telescoping equation:

 > $\mathrm{evala}\left(\mathrm{Normal}\left(\genfrac{}{}{0}{}{s}{\phantom{n=n+1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{s}}{n=n+1}-s\right),\mathrm{expanded}\right)$
 $\frac{{1}}{{{n}}^{{2}}{+}\sqrt{{5}}{}{n}{-}{1}}$ (3)

A hypergeometrically summable term:

 > $f:=\frac{{2}^{2n-1}}{n\left(2n+1\right)\mathrm{binomial}\left(2n,n\right)}$
 ${f}{:=}\frac{{{2}}^{{2}{}{n}{-}{1}}}{{n}{}\left({2}{}{n}{+}{1}\right){}{\mathrm{binomial}}{}\left({2}{}{n}{,}{n}\right)}$ (4)
 > $s:=\mathrm{Indefinite}\left(f,n\right)$
 ${s}{:=}\frac{\left({-}{2}{}{n}{-}{1}\right){}{{2}}^{{2}{}{n}{-}{1}}}{{n}{}\left({2}{}{n}{+}{1}\right){}{\mathrm{binomial}}{}\left({2}{}{n}{,}{n}\right)}$ (5)
 > $\mathrm{normal}\left(\mathrm{expand}\left(\genfrac{}{}{0}{}{s}{\phantom{n=n+1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{s}}{n=n+1}-s\right)\right)$
 $\frac{{1}}{{2}}{}\frac{{\left({{2}}^{{n}}\right)}^{{2}}}{{n}{}\left({2}{}{n}{+}{1}\right){}{\mathrm{binomial}}{}\left({2}{}{n}{,}{n}\right)}$ (6)

The method of accurate summation:

 > $f:=\frac{1{\left({\left(\frac{1}{2}+\frac{1{5}^{\frac{1}{2}}}{2}\right)}^{n}-{\left(\frac{1}{2}-\frac{1{5}^{\frac{1}{2}}}{2}\right)}^{n}\right)}^{2}}{5}$
 ${f}{:=}\frac{{1}}{{5}}{}{\left({\left(\frac{{1}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}}{-}{\left(\frac{{1}}{{2}}{-}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}}\right)}^{{2}}$ (7)
 > $\mathrm{Indefinite}\left(f,n\right)$
 ${-}\frac{{3}}{{10}}{}{\left({\left(\frac{{1}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}}{-}{\left(\frac{{1}}{{2}}{-}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}}\right)}^{{2}}{-}\frac{{1}}{{10}}{}{\left({\left(\frac{{1}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}{+}{1}}{-}{\left(\frac{{1}}{{2}}{-}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}{+}{1}}\right)}^{{2}}{+}\frac{{1}}{{10}}{}{\left({\left(\frac{{1}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}{+}{2}}{-}{\left(\frac{{1}}{{2}}{-}\frac{{1}}{{2}}{}\sqrt{{5}}\right)}^{{n}{+}{2}}\right)}^{{2}}$ (8)

Example for the library extension mechanism:

 > $f:=\mathrm{sin}\left(n\right)\mathrm{cos}\left(n+1\right)-\mathrm{ln}\left(2n\right)$
 ${f}{:=}{\mathrm{sin}}{}\left({n}\right){}{\mathrm{cos}}{}\left({n}{+}{1}\right){-}{\mathrm{ln}}{}\left({2}{}{n}\right)$ (9)
 > $\mathrm{Indefinite}\left(f,n\right)$
 ${-}\frac{{1}}{{2}}{}\frac{{{\mathrm{cos}}{}\left({1}\right)}^{{2}}{}{\mathrm{sin}}{}\left({1}\right){}{n}{+}{2}{}{{\mathrm{cos}}{}\left({1}\right)}^{{2}}{}{\mathrm{ln}}{}\left({2}\right){}{n}{+}{2}{}{\mathrm{ln}}{}\left({\mathrm{Γ}}{}\left({n}\right)\right){}{{\mathrm{cos}}{}\left({1}\right)}^{{2}}{-}{\mathrm{sin}}{}\left({1}\right){}{{\mathrm{cos}}{}\left({n}\right)}^{{2}}{-}{\mathrm{sin}}{}\left({1}\right){}{n}{-}{2}{}{n}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{\mathrm{ln}}{}\left({\mathrm{Γ}}{}\left({n}\right)\right)}{{{\mathrm{cos}}{}\left({1}\right)}^{{2}}{-}{1}}$ (10)

Compute the fail points:

 > $f:=nn!$
 ${f}{:=}{n}{}{n}{!}$ (11)
 > $\mathrm{Indefinite}\left(f,n,'\mathrm{failpoints}'\right)$
 ${n}{!}{,}\left[\left[{-}{\mathrm{∞}}{..}{-}{1}\right]{,}\left[{}\right]\right]$ (12)

Indeed, $f$ is not defined for any negative integer:

 > $\genfrac{}{}{0}{}{f}{\phantom{n=-3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{f}}{n=-3}$
 > $f:=\frac{\mathrm{binomial}\left(2n-3,n\right)}{{4}^{n}}$
 ${f}{:=}\frac{{\mathrm{binomial}}{}\left({2}{}{n}{-}{3}{,}{n}\right)}{{{4}}^{{n}}}$ (13)
 > $s,\mathrm{fp}:=\mathrm{Indefinite}\left(f,n,'\mathrm{failpoints}'\right)$
 ${s}{,}{\mathrm{fp}}{:=}\frac{{2}{}{n}{}\left({n}{+}{1}\right){}{\mathrm{binomial}}{}\left({2}{}{n}{-}{3}{,}{n}\right)}{\left({n}{-}{2}\right){}{{4}}^{{n}}}{,}\left[\left[{}\right]{,}\left[{2}\right]\right]$ (14)

The sum $s$ is not defined at $n=2$:

 > $\genfrac{}{}{0}{}{s}{\phantom{n=2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{s}}{n=2}$

Note that in this example, however, the limit exists:

 > $\underset{n→2}{lim}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}s$
 $\frac{{3}}{{8}}$ (15)

Rewriting $f$ in terms of GAMMA functions introduces additional singularities at negative integers:

 > $\mathrm{Indefinite}\left(\mathrm{convert}\left(f,\mathrm{Γ}\right),n,'\mathrm{failpoints}'\right)$
 $\frac{{2}{}{n}{}\left({n}{+}{1}\right){}{\mathrm{Γ}}{}\left({2}{}{n}{-}{2}\right)}{\left({n}{-}{2}\right){}{\mathrm{Γ}}{}\left({n}{-}{2}\right){}{\mathrm{Γ}}{}\left({n}{+}{1}\right){}{{4}}^{{n}}}{,}\left[\left[{-}{\mathrm{∞}}{..}{0}\right]{,}\left[{2}\right]\right]$ (16)

In the following rational example, the limit does not exist:

 > $f:=\frac{1}{n}+\frac{1}{n-1}-\frac{2}{n-5}$
 ${f}{:=}\frac{{1}}{{n}}{+}\frac{{1}}{{n}{-}{1}}{-}\frac{{2}}{{n}{-}{5}}$ (17)
 > $s,\mathrm{fp}:=\mathrm{Indefinite}\left(f,n,'\mathrm{failpoints}'\right)$
 ${s}{,}{\mathrm{fp}}{:=}\frac{{2}}{{n}{-}{5}}{+}\frac{{2}}{{n}{-}{4}}{+}\frac{{2}}{{n}{-}{3}}{+}\frac{{2}}{{n}{-}{2}}{+}\frac{{1}}{{n}{-}{1}}{,}\left[\left[{0}{..}{1}{,}{5}{..}{5}\right]{,}\left[{2}{,}{3}{,}{4}\right]\right]$ (18)
 > $\underset{n→2}{lim}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}s$
 ${\mathrm{undefined}}$ (19)