rtoy / maxima

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

coeff, ratcoef on Taylor series around inf #1404

Open rtoy opened 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 15:01:32 Created by *anonymous on 2007-04-02 08:46:56 Original: https://sourceforge.net/p/maxima/bugs/1161


It seems that coeff() and ratcoef() have trouble extracting coefficients from Taylor expansions around infinity:

(%i119) taylor(1/x, x, inf, 1); 1 (%o119)/T/ - + . . . x (%i120) ratcoef(taylor(1/x, x, inf, 1), x, -1); (%o120)/R/ 0 (%i121) coeff(taylor(1/x, x, inf, 1), x, -1); (%o121)/R/ 0

A work-around is to get rid of the Taylor property, e.g., by wrapping the expression in subst(0, 0, ...).

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 15:01:32 Created by macrakis on 2007-04-05 05:45:51 Original: https://sourceforge.net/p/maxima/bugs/1161/#9aee


Logged In: YES user_id=588346 Originator: NO

Yes, ratcoeff is a bit confused by taylor expansions at infinity:

qq: taylor(sum((i-3+100)*x^(i-3),i,0,5),x,inf,10) => 102*x^2+101*x+100+99/x+98/x^2+97/x^3 + ...

makelist(ratcoeff(qq,x,i),i,-3,4) => => [0, 102, 101, 100, 99, 98, 97, 0]

In other words, it treats the 1/x^2 as the ratcoeff(...,x,2) term.

So the workaround is to negate the power... but of course that will become exactly wrong when the bug is fixed....

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 15:01:36 Created by robert_dodier on 2007-06-29 23:18:20 Original: https://sourceforge.net/p/maxima/bugs/1161/#569f