rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

powerseries wrong/fix #1557

Closed rtoy closed 2 days ago

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 19:39:57 Created by kratt5 on 2003-04-25 15:35:18 Original: https://sourceforge.net/p/maxima/bugs/302


(C51)
gf:-2*(175-1144*x-4882*x^3+4324*x^4-2072*x^5+416*x^6+3189*x^2)/ (2*x-1)^3/(4*x-1)/(x-1)^3$

(C52) taylor(gf,x,0,3);

                2      3   

(D52)/T/ 350 + 2262 x + 11634 x + 53650 x + . . .
(C53) taylor(powerseries(gf,x,0),x,0,3);

                2      3   

(D53)/T/ 470 + 2862 x + 13524 x + 58750 x + . . .

maybe this is related to sum(x^i,i,0,inf),x:0 giving 0, but I don't know... I checked D53 with Maple, so it seems that powerseries is wrong, not taylor.

I converted the result of powerseries to the rational function again, and obtained:

-2*(940-7436*x-41588*x^3-22066*x^5+40253*x^4+416*x^8-1816*x^7+7076*x^6+24227*x^2) /(2*x-1)^3/(4*x-1)/(x-2)^2/(x-1)^3

The difference between the two is

160*'SUM((I+1)*2^I*x^I,I,0,INF)-160*'SUM((I+1)*2^(-I-2)*x^I,I,0,INF)

so the reason might be a simple typo (- instead of + or the like)...

Should be possible to correct this... Martin

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 19:39:59 Created by kratt5 on 2003-04-30 17:35:44 Original: https://sourceforge.net/p/maxima/bugs/302/#37c9


Logged In: YES user_id=651552

Here is the fix. It's a typo, as I expected...
should really be applied as soon as possible since it gets everything wrong, where the partial fraction expansion contains (a*x+c)^(-2)...

Martin

diff -c series.lisp series.lisp.~1.1.1.1.~
*** series.lisp Wed Apr 30 19:32:58 2003
--- series.lisp.~1.1.1.1.~ Mon May 8 08:09:41 2000
***************
*** 248,255 ****
0))
((= 2 n)
(psp2form (m* (m+ 1 *index)
! (m^ a (m* -1 (m+ 2 *index))) ;; kratt5
! (m^ (m* -1 c) *index)) ;; kratt5
(if (equal m 1) *index (m* *index m))
0))
(t (psp2form (m* (do ((nn (f1- n) (f1- nn))
--- 248,255 ----
0))
((= 2 n)
(psp2form (m* (m+ 1 *index)
! (m^ c (m* -1 (m+ 2 *index)))
! (m^ (m* -1 a) *index))
(if (equal m 1) *index (m* *index m))
0))
(t (psp2form (m* (do ((nn (f1- n) (f1- nn))

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 19:40:02 Created by kratt5 on 2003-04-30 17:35:44 Original: https://sourceforge.net/p/maxima/bugs/302/#ad1d


rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 19:40:06 Created by rtoy on 2003-05-28 17:03:00 Original: https://sourceforge.net/p/maxima/bugs/302/#9b96


rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 19:40:09 Created by rtoy on 2003-05-28 17:03:00 Original: https://sourceforge.net/p/maxima/bugs/302/#ca25


Logged In: YES user_id=28849

Patch applied.