On Wed, Feb 10, 2010 at 5:47 PM, laurent couraud <l.couraud at gmail.com> wrote:
> Hello all,
>
> Is there a command in maxima to do the following kind of
> simplification on a sum?
>
> 1) sum(x[m],m,0,s)-sum(x[m+1],m,0,s) -> x[s+1]
> 2) sum(x[i+m,j],m,0,s)-sum(x[i+m+1,j],m,0,s) -> x[i+s+1, j] (if I'm not wrong)
> 3) sum(sum(x[i+m,j+n],n,0,s),m,0,s)-sum(sum(x[i+1+m,j+n],n,0,s),m,0,s)
> -> sum(x[i,j+n],n,0,s)-sum(x[i+s+1,j+n],n,0,s) (if I'm not wrong)
>
> I'm particularly interested by 2) and 3) :)
>
> Thanks in advance for any help!
I don't think there is a single command which can do it. But you can
do it in a couple of steps like this:
(%i1) sm1: sum(x[m],m,0,s)-sum(x[m+1],m,0,s)$
(%i2) substpart(changevar(part(sm1, 2),m+1=k,k,m),sm1,2)$
(%i3) sumcontract(intosum(%));
(%o3) x[0]-x[s+1]
(%i4) sm2: sum(x[i+m,j],m,0,s)-sum(x[i+m+1,j],m,0,s)$
(%i5) substpart(changevar(part(sm2, 2),m+1=k,k,m),sm2,2)$
(%i6) sumcontract(intosum(%));
(%o6) x[i,j]-x[s+i+1,j]
(%i7) sm3: sum(sum(x[i+m,j+n],n,0,s),m,0,s)-sum(sum(x[i+1+m,j+n],n,0,s),m,0,s)$
(%i8) substpart(changevar(part(sm3, 2),m+1=k,k,m),sm3,2)$
(%i9) intosum(intosum(%))$
(%i10) sumcontract(sumcontract(%));
(%o10) -(sum(x[s+i+1,n+j],n,0,s))+(sum(x[i,m+j],m,1,s))+x[i,j]
HTH, Andrej