Some maxima problems



2008/4/29 Michel Talon <talon at lpthe.jussieu.fr>:
> Hello,
>
>  First i have the following problem with both maxima-5.14.0 and
>  maxima-5.15.0 compiled with a variety of lisps (gcl, cmucl):
>
>  (%i1) load (zeilberger);
>  (%i5) GosperSum (m*(n-m+1)*(n+m-2)/2,m,0,n);
>
>  Division by 0
>  #0: GosperSumVerboseOpt(f=m*(n-m+1)*(n+m-2)/2,k=m,a=0,b=n,mode=0)(Gosper.mac
>  line 247)
>  #1: GosperSum(f=m*(n-m+1)*(n+m-2)/2,k=m,a=0,b=n)(Gosper.mac line 253)
>   -- an error.  To debug this try debugmode(true);

Set simplified_output to true:

(%i1) load(zeilberger)$
(%i2) GosperSum(m*(n-m+1)*(n+m-2)/2, m, 0, n), simplified_output=true;
(%o2) (n*(n+1)*(-(n+1)^2+2*n^2+5*(n+1)-2*n-6))/8
(%i3) factor(%);
(%o3) ((n-1)*n*(n+1)*(n+2))/8

With simplified_output=true some intermediate results are simplified
which removes the division by zero. You can also use the older nusum
function:

(%i4) nusum(m*(n-m+1)*(n+m-2)/2, m, 0, n);
(%o4) ((n-1)*n*(n+1)*(n+2))/8

HTH,

-- 
Andrej