SumTools[IndefiniteSum]
Indefinite
compute closed forms of indefinite sums
Calling Sequence
Parameters
Description
Examples
Indefinite(f, k, opt)
f
-
expression depending on k
k
name
opt
(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.
with⁡SumToolsIndefiniteSum:
An example of a rationally summable expression:
f≔1n2+sqrt⁡5⁢n−1
f≔1n2+5⁢n−1
s≔Indefinite⁡f,n
s≔−13⁢n−32+52−13⁢n−12+52−13⁢n+12+52
Check the telescoping equation:
evala⁡Normal⁡eval⁡s,n=n+1−s,expanded
1n2+5⁢n−1
A hypergeometrically summable term:
f≔22⁢n−1n⁢2⁢n+1⁢binomial⁡2⁢n,n
f≔22⁢n−1n⁢2⁢n+1⁢2⁢nn
s≔−22⁢n−12⁢nn⁢n
normal⁡expand⁡eval⁡s,n=n+1−s
2n22⁢n⁢2⁢n+1⁢2⁢nn
The method of accurate summation:
f≔15⁢12+12⁢512n−12−12⁢512n2
f≔12+52n−12−52n25
Indefinite⁡f,n
−3⁢12+52n−12−52n210−12+52n+1−12−52n+1210+12+52n+2−12−52n+2210
Sum of a logarithm of a rational function (provided the argument of the logarithm has constant sign):
sum⁡ln⁡2⁢n+1,nassuming0≤n
n⁢ln⁡2+ln⁡Γ⁡n+12
sum⁡ln⁡2⁢n+1,nassumingn≤−1
n⁢ln⁡2−ln⁡Γ⁡12−n+I⁢π⁢n
Example for the library extension mechanism:
f≔sin⁡n⁢cos⁡n+1−Ψ⁡n
−sin⁡1⁢n2−csc⁡1⁢cos⁡n22−Ψ⁡n+1⁢n+n+Ψ⁡n+γ
Compute the fail points:
f≔n⁢n!
Indefinite⁡f,n,failpoints
n!,−∞..−1,
Indeed, f is not defined for any negative integer:
eval⁡f,n=−3
Error, numeric exception: division by zero
and limits do not exist:
limit⁡f,n=−3
undefined
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
s,fp≔2n−5+2n−4+2n−3+2n−2+1n−1,0..1,5..5,2,3,4
limit⁡s,n=2
In the next example, f is hypergeometric term defined for all integers n:
f≔binomial⁡2⁢n−3,n4n
f≔2⁢n−3n4n
s,fp≔2⁢n⁢n+1⁢2⁢n−3nn−2⁢4n,,2
The sum s is not defined at n=2:
eval⁡s,n=2
Note that in this example, however, the limit exists:
38
but the telescoping equation does not hold at n=1:
limit⁡s,n=2−eval⁡s,n=1=eval⁡f,n=1
−58=−14
Consequently, if n=1 is between summation bounds, the Newton-Leibniz formula is wrong:
sum⁡f,n=0..10=eval⁡s,n=11−eval⁡s,n=0
236871262144=138567262144
Rewriting f in terms of GAMMA functions introduces additional singularities at negative integers. These singularities are removable:
f1≔convert⁡f,Γ
f1≔Γ⁡2⁢n−2Γ⁡n+1⁢Γ⁡n−2⁢4n
s,fp≔Indefinite⁡f1,n,failpoints
s,fp≔2⁢n⁢n+1⁢Γ⁡2⁢n−2n−2⁢Γ⁡n+1⁢Γ⁡n−2⁢4n,,
The telescoping equation is valid for all integers n (in the limit):
sum⁡f1,n=0..10=eval⁡s,n=11−limit⁡s,n=0
138567262144=138567262144
The singularities of f1 are detected if _EnvFormal (see sum,details) is set to false:
_EnvFormal≔false:
s,fp≔2⁢n⁢n+1⁢Γ⁡2⁢n−2n−2⁢Γ⁡n+1⁢Γ⁡n−2⁢4n,−∞..2,
sum⁡f1,n=0..10
Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation
_EnvFormal≔_EnvFormal:
See Also
SumTools[DefiniteSummation]
SumTools[IndefiniteSum][Hypergeometric]
SumTools[Summation]
Download Help Document