Up | Next | Prev | PrevTail | Tail |
This package implements the Gosper algorithm for the summation of series. It defines operators SUMand PROD. The operator SUMreturns the indefinite or definite summation of a given expression, and PRODreturns the product of the given expression.
This package loads automatically.
This package implements the Gosper algorithm for the summation of series. It defines operators sumand prod. The operator sumreturns the indefinite or definite summation of a given expression, and the operator prodreturns the product of the given expression. These are used with the syntax:
sum(\(\langle \)expr:expression\(\rangle \),\(\langle \)k:kernel\(\rangle \)[,\(\langle \)lolim:expression\(\rangle \)[,\(\langle \)uplim:expression\(\rangle \)]]) | ||
prod(\(\langle \)expr:expression\(\rangle \),\(\langle \)k:kernel\(\rangle \)[,\(\langle \)lolim:expression\(\rangle \)[,\(\langle \)uplim:expression\(\rangle \)]]) | ||
If there is no closed form solution, these operators return the input unchanged. \(\langle \)lolim\(\rangle \) and \(\langle \)uplim\(\rangle \) are optional parameters specifying the lower limit and upper limit of the summation (or product), respectively. If \(\langle \)uplim\(\rangle \) is not supplied, the upper limit is taken as \(\langle \)k\(\rangle \) (the summation variable itself).
For example:
sum(n**3,n); sum(a+k*r,k,0,n-1); sum(1/((p+(k-1)*q)*(p+k*q)),k,1,n+1); prod(k/(k-2),k);
Gosper’s algorithm succeeds whenever the ratio
The trigonometric functions sin, cos, etc. are converted to exponentials and then Gosper’s algorithm is applied. The result is converted back into sin, cos, sinh and cosh.
Summations of logarithms or products of exponentials are treated by the formula:
There is a switch trsum(default off). If this switch is on, trace messages are printed out during the course of Gosper’s algorithm.
Up | Next | Prev | PrevTail | Front |