sumtools
gosper
Gosper's algorithm for summation
Calling Sequence
Parameters
Description
Examples
gosper(f, k)
gosper(f, k=m..n)
f
-
expression
k
name, summation variable
m, n
expressions, representing upper and lower summation bounds
This function is an implementation of Gosper's algorithm, and calculates a closed form (upward) antidifference of a closed form expression f whenever a closed form (upward) antidifference exists. In this case, the procedure can be used to calculate definite sums
∑k=mn⁡f⁡k
whenever f does not depend on variables occurring in m and n.
An expression f is called closed form with respect to k if
subs⁡k=k+1,ff
is rational with respect to k. This is typically the case for ratios of products of rational functions, exponentials, factorials, binomial coefficients, and Pochhammer symbols that are integer-linear in their arguments. The implementation supports this type of input.
An expression g is called closed form upward antidifference of f if
f=subs⁡k=k+1,g−g
If the second argument k is a name, then gosper returns the closed form (upward) antidifference of f with respect to k, or FAIL, if either the input function is no closed form expression, or no closed form antidifference exists. Which of these cases applies, can be seen with infolevelsum≔2 .
If the second argument has the form k=m..n then the definite sum
is determined if Gosper's algorithm applies.
The command with(sumtools,gosper) allows the use of the abbreviated form of this command.
with⁡sumtools:
see (SIAM Review, 1994, Problem 94-2)
gosper⁡−1k+1⁢4⁢k+1⁢2⁢k!k!⁢4k⁢2⁢k−1⁢k+1!,k
−2⁢k+1⁢−1k+1⁢2⁢k!k!⁢4k⁢2⁢k−1⁢k+1!
gosper⁡binomial⁡k,n,k
k−n⁢knn+1
gosper⁡binomial⁡n,k2n−binomial⁡n−1,k2n−1,k
−k⁢nk2n−n−1k2n−12⁢k−n
gosper⁡pochhammer⁡k,n,k
k−1⁢pochhammer⁡k,nn+1
gosper⁡pochhammer⁡b,kk!,k=0..n
n+1⁢pochhammer⁡b,n+1b⁢n+1!
gosper⁡k2!,k
FAIL
gosper⁡1k,k
See Also
sum
SumTools[Hypergeometric][Gosper]
Download Help Document