Why not replace q with zero?



Hmmm, isn't this result actually incorrect? For instance,

(%i1) display2d:false;
(%o1) false
(%i2) sum(i,i,q,n),q=5,n=8;
(%o2) 26
(%i3) sum(i,i,q,n),q=-5,n=8;
(%o3) 21

but then I get

(%i4) sum(i,i,q,n),simpsum;
Is  q  positive, negative, or zero?

neg;
(%o4) (n^2+n)/2-(q^2+q)/2
(%i5) %,q=-5,n=8;
(%o5) 26


Further, why does simpsum need asksign for this in the first place? Isn't the result given by simpsum for q>0, (n+1-q)*(n+q)/2, actually correct regardless of sign? That is, so long as q<=n?


Viktor


-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dotan Cohen
Sent: Thursday, December 11, 2008 1:43 PM
To: maxima.
Subject: Why not replace q with zero?

I found this odd:

(%i13) sum(i,i,q,n), simpsum;
Is  q  positive, negative, or zero?

z;
                            2                  2
                           n  + n   q + (q - 1)  - 1
(%o13)                     ------ - ----------------
                             2             2
(%i14)


Why is q part of the equation if it is known to be zero? Why doesn't
Maxima simply output this:

                                     2
                                    n  + n
                                    ------
                                      2


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?
?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-??-?-?
?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?
?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?
?-?-?-?-?-?-?

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima