
sum - definite and indefinite summation

Calling sequence:
sum(f, k)
sum(f, k=a..b)
sum(f, k=RootOf(p,x))

Parameters:
f, a, b   --  expressions
k         --  indeterminate
p         --  polynomial

Summary:

sum(f, k) computes the indefinite sum of f with respect to k, that is an
expression g(k) such that f = g(k+1)-g(k).  The call sum(f, k=a..b)
computes the definite sum of f from a to b.  The function sum implements
Abramov's algorithm for rational functions, Gosper's algorithm for hypergeometric
function, and Zeilberger's algorithm for the definite summation of holonomic
functions.

The special form sum(f, k=RootOf(p,x)) normalizes the sum of the rational
function f in k over the roots of the polynomial p in x.

>>  sum(1/(x^2-1),x);

                          1       1
                        - --- - ---------
                          2 x   2 (x - 1)
>>  sum(1/k/(k+2)^2,k);

                    1    psi(k + 2, 1)      1
                 - --- + ------------- + ----------
                   4 k        2        - 4 k - 4

>>  sum(binomial(n+k,k),k);

                       k binomial(k + n, k)
                       --------------------
                             n + 1

>>  sum(1/(n^2+21*n),n=1..infinity);

                        18858053/108636528

>>  sum(binomial(n,k)/2^n-binomial(n+1,k)/2^(n+1),k);

             - 2 k binomial(n, k) + k binomial(n + 1, k)
             --------------------------------------------
                         n       n       n
                    - 2 2  + 4 k 2  - 2 n 2

>>  sum(k^2,k=RootOf(x^3+a*x^2+b*x+c,x));

                                   2
                           - 2 b + a

See also:  psi

