Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
1

Bug in series expansion?

asked 6 years ago

parzan gravatar image

updated 6 years ago

I'm trying to expand (q+1)/(q3) at q=. 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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 6 years ago

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
Preview: (hide)
link

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 ( 6 years ago )

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 ( 6 years ago )

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: 6 years ago

Seen: 364 times

Last updated: Jan 27 '19