sum, taylor, simplification



I think the problem you are reporting is this:

(%i7) sum(taylor(exp(x*i),x,0,1),i,0,2);
(%o7) 3+3*x
(%i8) sum(taylor(exp(x*i),x,0,1),i,0,N);
(%o8) 'sum(i*x+1,i,0,N)
(%i9) taylor(sum(exp(x*i),i,0,2),x,0,1);
(%o9) 3+3*x
(%i10) taylor(sum(exp(x*i),i,0,N),x,0,1);
taylor: unable to expand at a point specified in:
'sum(%e^(i*x),i,0,N)
 -- an error. To debug this try: debugmode(true);

Presumably, he'd like %o10 to be either

          'sum(i*x+1,i,0,N)

Even better if it's the closed form:

           1+N+(N^2+N)*x/2+...

The closed form can easily be gotten in this case by setting simpsum:true :

(%i28) sum(taylor(exp(x*i),x,0,1),i,0,N),simpsum:true;
(%o28) (x*N^2+x*N)/2+N+1
(%i29) taylor(sum(exp(x*i),i,0,N),x,0,1),simpsum:true;
(%o29) 1+N+(N^2+N)*x/2

More generally, though, for finite sums, taylor(sum(...),...) is the same as
sum(taylor(...),...), so perhaps taylor should look inside sums rather than
giving an error.  Of course, if the user subsequently sets N to inf, all
bets are off.

            -s

PS Could you please be more explicit and precise in your problem reports in
the future?  Thanks.

On Fri, Apr 29, 2011 at 11:35, Robert Dodier <robert.dodier at gmail.com>wrote:

> On 4/29/11, Litvinov Sergey <slitvinov at gmail.com> wrote:
>
> > Why I cannot simplify this?
> >
> >
> > I get
> > taylor: unable to expand at a point specified in:
> >
> > This works
> > sum(taylor( exp(-x*R[i]), x, 0, 1), i, 1, N);
> >
> >
> > Maxima 5.21.1 using Lisp CLISP 2.49 (2010-07-07)
>
> There's something missing from your original message
> (and the subsequent ones didn't fix the problem).
>
> I see something interesting here. It may or may not be
> related to the problem you have observed.
>
> taylor (exp (x), x, 0, 1);
>  => /T/                  1 + x + . . .
> :lisp $%
>  => ((MRAT SIMP (((MEXPT SIMP) $%E $X) $X) (%e^x21874 X21875)
>  (($X ((1 . 1)) 0 NIL X21875 . 2)) TRUNC)
>  PS (X21875 . 2) ((1 . 1)) ((0 . 1) 1 . 1) ((1 . 1) 1 . 1))
>
> foo (taylor (exp (x), x, 0, 1));
>  => foo(x + 1)
> :lisp $%
>  => (($FOO SIMP) ((MPLUS SIMP) 1 $X))
>
> The taylor-ness of the expression was apparently thrown away
> when it was the argument of some other operator.
> I don't know if that's by design or what.
>
> best
>
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>