compute closed forms of indefinite sums
Indefinite(f, k, opt)
expression depending on k
(optional) equation of the form failpoints=true or failpoints=false
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,p,q, where
s is a closed form of the indefinite sum of f w.r.t. k, as above,
p is a list of intervals a1..b1,a2..b2,...,am..bm where f does not exist, and
q is a list of points ki where the computed sum s does not satisfy the telescoping equation s⁡ki+1−s⁡ki=f⁡ki 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, it returns s,FAIL.
An example of a rationally summable expression:
f ≔ 1n2+5⁢n−1
s ≔ Indefinite⁡f,n
Check the telescoping equation:
A hypergeometrically summable term:
f ≔ 22⁢n−1n⁢2⁢n+1⁢binomial⁡2⁢n,n
The method of accurate summation:
f ≔ 1⁢12+1⁢5122n−12−1⁢5122n25
Sum of a logarithm of a rational function (provided the argument of the logarithm has constant sign):
Example for the library extension mechanism:
f ≔ sin⁡n⁢cos⁡n+1−Ψ⁡n
Compute the fail points:
f ≔ n⁢n!
Indeed, f is not defined for any negative integer:
Error, numeric exception: division by zero
and limits do not exist:
A rational example. f and its limit are not defined at n=0,1,5, and the correspondent sum s and its limit are not defined at n=2,3,4:
f ≔ 1n+1n−1−2n−5
s,fp ≔ Indefinite⁡f,n,'failpoints'
In the next example, f is hypergeometric term defined for all integers n:
f ≔ binomial⁡2⁢n−3,n4n
The sum s is not defined at n=2:
Note that in this example, however, the limit exists:
but the telescoping equation does not hold at n=1:
Consequently, if n=1 is between summation bounds, the Newton-Leibniz formula is wrong:
Rewriting f in terms of GAMMA functions introduces additional singularities at negative integers. These singularities are removable:
f1 ≔ convert⁡f,GAMMA
s,fp ≔ Indefinite⁡f1,n,'failpoints'
The telescoping equation is valid for all integers n (in the limit):
The singularities of f1 are detected if _EnvFormal (see sum,details) is set to false:
_EnvFormal ≔ false:
Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation
_EnvFormal ≔ '_EnvFormal':
Download Help Document