series expansion: (x**2 + x + 1)/(x**3 + x**2) about oo gives wrong result #9549

Open
opened this Issue Jun 19, 2015 · 9 comments

Projects
None yet
7 participants
Member

leosartaj commented Jun 19, 2015

 ``````>>> e = (x**2 + x + 1) / (x**3 + x**2) >>> series(e, x, oo) x**(-5) + x**(-3) + 1/x + O(x**(-6), (x, oo)) # wrong result `````` Here's the result by WolframAlpha ``````x**(-5) - x**(-4) + x**(-3) + 1/x + O(x**(-6), (x, oo)) `````` On Some further digging, result also appears to be inconsistent. ``````>>> series(e, x, oo, n=8) -x**(-6) - x**(-4) + x**3 + 1/x + O(x**(-8), (x, oo)) `````` Result by WolframAlpha
Member

leosartaj commented Jun 19, 2015

 However, for ``````>>> apart((x**2 + x + 1) / (x**3 + x**2)) 1/(x + 1) + 1/x**2 `````` The result is correct

skirpichev added a commit to diofant/diofant that referenced this issue Feb 23, 2016

``` Add test for sympy/sympy#9549 ```
``` 88bdefa ```

Closed

Contributor

vovapolu commented Mar 8, 2016

 @leosartaj I found this while debugging your issue, but my fix doesn't solve the problem :(

Merged

Contributor

wrat commented Mar 17, 2016

 issue solved?? I would like to work on this .

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 2, 2016

``` Add regression tests & mention closed issues ```
```    close sympy/sympy#3112 (MrvAsympt was added in diofant#6)
close sympy/sympy#9173 (test was added in 5a510ac)
close sympy/sympy#9808 (fixed in 09e539b)
close sympy/sympy#9341 (fixed in af98a00)
close sympy/sympy#9908 (fixed in cc3fa8d)
close sympy/sympy#6171 (test added in d278031)
close sympy/sympy#9276 (diagnose_imports.py removed in ab8c535)
close sympy/sympy#10201 (fixed in 0d0fc5f)
close sympy/sympy#9057 (test was added in 8290a0c)
close sympy/sympy#11159 (test was added in ffb76cb)
close sympy/sympy#2839 (new AST transformers are used, see diofant#278 and diofant#167)
close sympy/sympy#11081 (see ed01e16 and bb92329)
close sympy/sympy#10974 (see 73fc425)
close sympy/sympy#10806 (test in 539929a)
close sympy/sympy#10801 (test in 2fe3da5)
close sympy/sympy#9549 (test in 88bdefa)
close sympy/sympy#4231 (test was added in fb411d5)
close sympy/sympy#8634 (see 2fcbb58)
close sympy/sympy#8481 (see 1ef20d3)
close sympy/sympy#9956 (fixed in a34735f)
close sympy/sympy#9747 (see e117c60)
close sympy/sympy#7853 (see 3e4fbed)
close sympy/sympy#9634 (see 2be03f5)
close sympy/sympy#8500 (fixed in diofant#104 and finally in diofant#316)
close sympy/sympy#9192 (see 9bf622f)
close sympy/sympy#7130 (see e068fa3)
close sympy/sympy#8514 (see b2d543b)
close sympy/sympy#9334 (see 90de625)
close sympy/sympy#8229 (see 9755b89)
close sympy/sympy#8061 (see 7054f06)
close sympy/sympy#7872 (tested in diofant#6)
close sympy/sympy#3496 (tested in test_log_symbolic)
close sympy/sympy#2929 (see da7db7a)
close sympy/sympy#8203 (oo is not a real, see diofant#36)
close sympy/sympy#7649 (0 is imaginary since diofant#8)
close sympy/sympy#7256 (fixed in c0a4549)
close sympy/sympy#6783 (see cb28d63)
close sympy/sympy#5662 (is_integer issue fixed in 6bfa9f8, there is no is_bounded anymore)
close sympy/sympy#5295 (fixed with diofant#354)
close sympy/sympy#4856 (we now have flake/pep tests)
close sympy/sympy#4555 (flake8 enabled after diofant#214)
close sympy/sympy#5773 (cmp_to_key removed after diofant#164 and c9acbf0)
close sympy/sympy#5484 (see above)

fixes sympy/sympy#8825 (probably via diofant#209)
fixes sympy/sympy#8635
fixes sympy/sympy#8157
fixes sympy/sympy#7872
fixes sympy/sympy#7599
fixes sympy/sympy#6179
fixes sympy/sympy#5415
fixes sympy/sympy#2865
fixes sympy/sympy#5907
fixes sympy/sympy#11722

Closes diofant#347```
``` 74ade76 ```

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 2, 2016

``` Add regression tests & mention closed issues ```
```    close sympy/sympy#3112 (MrvAsympt was added in diofant#6)
close sympy/sympy#9173 (test was added in 5a510ac)
close sympy/sympy#9808 (fixed in 09e539b)
close sympy/sympy#9341 (fixed in af98a00)
close sympy/sympy#9908 (fixed in cc3fa8d)
close sympy/sympy#6171 (test added in d278031)
close sympy/sympy#9276 (diagnose_imports.py removed in ab8c535)
close sympy/sympy#10201 (fixed in 0d0fc5f)
close sympy/sympy#9057 (test was added in 8290a0c)
close sympy/sympy#11159 (test was added in ffb76cb)
close sympy/sympy#2839 (new AST transformers are used, see diofant#278 and diofant#167)
close sympy/sympy#11081 (see ed01e16 and bb92329)
close sympy/sympy#10974 (see 73fc425)
close sympy/sympy#10806 (test in 539929a)
close sympy/sympy#10801 (test in 2fe3da5)
close sympy/sympy#9549 (test in 88bdefa)
close sympy/sympy#4231 (test was added in fb411d5)
close sympy/sympy#8634 (see 2fcbb58)
close sympy/sympy#8481 (see 1ef20d3)
close sympy/sympy#9956 (fixed in a34735f)
close sympy/sympy#9747 (see e117c60)
close sympy/sympy#7853 (see 3e4fbed)
close sympy/sympy#9634 (see 2be03f5)
close sympy/sympy#8500 (fixed in diofant#104 and finally in diofant#316)
close sympy/sympy#9192 (see 9bf622f)
close sympy/sympy#7130 (see e068fa3)
close sympy/sympy#8514 (see b2d543b)
close sympy/sympy#9334 (see 90de625)
close sympy/sympy#8229 (see 9755b89)
close sympy/sympy#8061 (see 7054f06)
close sympy/sympy#7872 (tested in diofant#6)
close sympy/sympy#3496 (tested in test_log_symbolic)
close sympy/sympy#2929 (see da7db7a)
close sympy/sympy#8203 (oo is not a real, see diofant#36)
close sympy/sympy#7649 (0 is imaginary since diofant#8)
close sympy/sympy#7256 (fixed in c0a4549)
close sympy/sympy#6783 (see cb28d63)
close sympy/sympy#5662 (is_integer issue fixed in 6bfa9f8, there is no is_bounded anymore)
close sympy/sympy#5295 (fixed with diofant#354)
close sympy/sympy#4856 (we now have flake/pep tests)
close sympy/sympy#4555 (flake8 enabled after diofant#214)
close sympy/sympy#5773 (cmp_to_key removed after diofant#164 and c9acbf0)
close sympy/sympy#5484 (see above)

fixes sympy/sympy#8825 (probably via diofant#209)
fixes sympy/sympy#8635
fixes sympy/sympy#8157
fixes sympy/sympy#7872
fixes sympy/sympy#7599
fixes sympy/sympy#6179
fixes sympy/sympy#5415
fixes sympy/sympy#2865
fixes sympy/sympy#5907
fixes sympy/sympy#11722

Closes diofant#347```
``` 48c035e ```

grassknoted commented Feb 28, 2017

 Is the Issue still open to work on?

Open

Him98 commented Feb 20, 2018 • edited

 @leosartaj I was following this issue. Firstly, I wanted to ask if I can work upon it? Secondly, while going through the code of sympy/core/sympy/expr.py I inferred that there is some issue in the for loop starting at line number 2679. Is that correct?
Contributor

Yathartha22 commented Feb 21, 2018 • edited

 @Him98 if you have found a fix just create a PR, there are many active people here who will help review your PR.
Member

leosartaj commented Feb 21, 2018

 Hi @Him98 @grassknoted @wrat @vovapolu feel free to work on this issue. It will be great, if only one PR is made for fixing an issue, it is a good idea usually to collaborate. I will try to look into the issue in the coming weekend.

grassknoted commented Feb 21, 2018

 I will take this up. … On Wed 21 Feb, 2018, 2:51 PM Sartaj Singh, ***@***.***> wrote: Hi @Him98 @grassknoted @wrat @vovapolu feel free to work on this issue. It will be great, if only one PR is made for fixing an issue, it is a good idea usually to collaborate. I will try to look into the issue in the coming weekend. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#9549 (comment)>, or mute the thread .

Him98 commented Mar 3, 2018

 It would be really helpful if someone can explain the present implementation of series function.