Ask Your Question
1

Bug in series expansion?

asked 2019-01-27 13:00:00 +0100

parzan gravatar image

updated 2019-01-27 13:27:11 +0100

I'm trying to expand $(q + 1)/(q - 3)$ at $q=\infty$. This doesn't work:

sage: f=(q + 1)/(q - 3)
sage: f.series(q==infinity,3)
Order(-Infinity)

This also doesn't:

sage: f.subs(q==1/q).series(q==0,3).subs(q==1/q)
-1/2/q - 1/2

(the value is wrong, it should be 1 as $q$ goes to infinity, not $-1/2$).

This works:

sage: f.subs(q==1/q).simplify_rational().series(q==0,3).subs(q==1/q)
4/q + 12/q^2 + 1

But is not very friendly. Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-01-27 19:01:07 +0100

Emmanuel Charpentier gravatar image

What about :

sage: var("q")
q
sage: f(q)=(q+1)/(q-3);f
q |--> (q + 1)/(q - 3)
sage: f.maxima_methods().powerseries(q,oo)
4*sum(3^(i1 - 1)/q^i1, i1, 0, +Infinity) - 1/3
edit flag offensive delete link more

Comments

That's not what had in mind (an infinite sum), but using your approach this does work:

sage: f.maxima_methods().taylor(q,oo,2)

4/q + 12/q^2 + 1

parzan gravatar imageparzan ( 2019-01-27 20:52:08 +0100 )edit

After playing with it a bit more, I realized that sage has this too:

sage: f.taylor(q,oo,2)
4/q + 12/q^2 + 1

So I consider the case closed (except for that fact that series should have done the same?)

parzan gravatar imageparzan ( 2019-01-28 07:51:50 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-01-27 13:00:00 +0100

Seen: 337 times

Last updated: Jan 27 '19