do not expand sums explicitly



Dear Dmitry,

Does a quote solve your problem? E.g.:

(%i1) exp('sum(a[i]*b[i],i,1,3))

(%o1) %e^sum(a[i]*b[i],i,1,3)

This is fairly persistent over reevaluation, but of cause at some point it might still be expanded.

Best regards,

Michael

-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dmitry Shkirmanov
Sent: Thursday, April 26, 2012 10:51 AM
To: maxima at math.utexas.edu
Subject: do not expand sums explicitly

Hello, list. Is it possible to don't expand sums explicitly?
Let's consider an example:

(%i1) expr1: exp( sum(a[i]*b[i],i,1,3));
                               a  b  + a  b  + a  b
                                3  3    2  2    1  1
(%o1)                       %e
(%i2) result: factor(sum(c[j]*diff(expr1,a[j]),j,1,3));
                   a  b  + a  b  + a  b
                    3  3    2  2    1  1
(%o2)           %e                      (b  c  + b  c  + b  c )
                                           3  3    2  2    1  1

Is it possible to get answer in form, that does not have explicit summation, something like this:

exp( sum(a[i]*b[i],i,1,3)) * sum(b[i]*c[i],i,1,3)) ?

I tried to do not specify the number of terms:


(%i3) expr2: exp( sum(a[i]*b[i],i,1,n));
                                     n
                                    ====
                                    \
                                     >     a  b
                                    /      i  i
                                    ====
                                    i = 1
(%o3)                            %e

It is just what i need. But, it seems that is impossible to get derivative of such expression:
(%i4) diff(exp2,a[j]);
(%o4)                                  0
It gives zero instead of b[j]*exp( sum(a[i]*b[i],i,1,3)), so i cannot cannot define:

(%i6) result2: sum(c[j]*diff(expr2,a[j]),j,1,n);

  It gives zero instead of

                              n
                              ====
                              \
                               >     a  b
                              /      i  i  n
                              ====        ====
                              i = 1       \
(%o7)                      %e>     b  c
                                          /      j  j
                                          ====
                                          j = 1 Any ideas?

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