powerseries



oh...notice the different exponents of 2 in (%o1) and (%o2):

  (%i1) powerseries((1)/((1-2*x)*(1-3*x)), x, 0);
  (%o1) sum((3^(i1+1)-2*2^i1)*x^i1,i1,0,inf)

  (%i2) sum((3^(i1+1)-2*2^i1)*x^i1,i1,0,inf);
  (%o2) sum((3^(i1+1)-2^(i1+1))*x^i1,i1,0,inf)

I think the summand in (%o1) isn't fully simplified:

  (%i44) (3^(i1+1)-2*2^i1)*x^i1;
  (%o44) (3^(i1+1)-2^(i1+1))*x^i1  <--- the summand in (%o1) should
  simplify to this

The standard expand( ...,0,0) trick doesn't simplify (%o1) to
the (%o2). Yikes.

There are bugs here, but I'm not convinced the bug is in the
testing code. I've never studied series.lisp, but there is
quite a bit of code in series.lisp that looks like:

(defun sp3form1 (e)
  (cond ((atom e) (list* (car *form) e (cdr *form)))
 ((eq (caar e) 'mplus)
  (cons '(mplus) (mapcar #'sp3form1 (cdr e)))) <-- yikes?

The last line looks like a troublemaker. Unless there is a really good
reason, I think this last line should be (addn (mapcar ....) nil).
Keeping every thing simplified as you go is a good policy.

Barton


-----"Robert Dodier"  wrote: -----

>To: "Barton Willis"
>From: "Robert Dodier"
>Date: 07/07/2007 07:05PM
>cc: "Dan Gildea" , maxima at math.utexas.edu
>Subject: Re: [Maxima] powerseries
>
>On 7/7/07, Barton Willis  wrote:
>
>> Some of these test failures are due to differences in dummy variables.
>
>No, that's not it -- I put in gensumnum:0 to ensure the same
>dummy indices are generated.
>
>Here's the observed vs expected output for the first test which failed.
>I believe the only difference is that the expected value has 1 + i1
>where the observed has i1 + 1.
>
>/* Problem 14 */
>powerseries(1/((1-2*x)*(1-3*x)),x,0);
>/* Erroneous Result?:
>'sum((3^(i1+1)-2*2^i1)*x^i1,i1,0,inf) */
>/* Expected result: */
>'sum((3^(1+i1)-2*2^i1)*x^i1,i1,0,inf);
>
>Now the funny thing is that the expected result is actually
>written with i1 + 1 in the test script:
>
>powerseries((1)/((1-2*x)*(1-3*x)), x, 0);
>'sum((3^(i1+1)-2*2^i1)*x^i1,i1,0,inf);
>
>Why was the expected result changed? Something about
>simplification or lack of it?
>
>I've committed the new powerseries code as r1.12 src/series.lisp
>and the test cases as r1.24 tests/rtest16.mac.
>The series.lisp attached to bug report 1722156 fails to load
>because some stuff not related to powerseries has changed
>in the meantime.
>
>Thanks for your help,
>Robert