Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: integrate(x*sqrt(abs(x)),(x,-1,0)) returns wrong result #21549

Closed
mihaiancu opened this issue May 30, 2021 · 4 comments
Closed

Bug: integrate(x*sqrt(abs(x)),(x,-1,0)) returns wrong result #21549

mihaiancu opened this issue May 30, 2021 · 4 comments
Labels
Easy to Fix This is a good issue for new contributors. Feel free to work on this if no one else has already. integrals

Comments

@mihaiancu
Copy link

from sympy import integrate, sqrt 
from sympy.abc import x 
integrate(x*sqrt(abs(x)), (x, -1, 0))

returns 2/5. The correct value is -2/5. The wrong opposite sign result is returned also if we replace x with x**k, where k is a positive integer.

@vsydoriak99
Copy link

Hello, I checked, everything works correctly.

@mihaiancu
Copy link
Author

Hello! I am using SymPy 1.8 and I get the wrong result 2/5. Also, trying the online JupyerLab (https://jupyter.org/try) I get the same wrong result. integrate(x*sqrt(abs(x)), (x, -1, 0)) returns the same values as integrate(x*sqrt(abs(x)), (x, 0, 1)), but in the former case the integrand is negative.

@naveensaigit
Copy link
Contributor

SymPy 1.8 gives 2/5, but it seems to be fixed on master, which gives -2/5

skirpichev added a commit to skirpichev/diofant that referenced this issue May 31, 2021
@oscarbenjamin
Copy link
Contributor

This was fixed in fe3a757 from #21404

This issue can be closed if a regression test is added to test_issue_21166

@oscarbenjamin oscarbenjamin added Easy to Fix This is a good issue for new contributors. Feel free to work on this if no one else has already. integrals labels May 31, 2021
skirpichev added a commit to skirpichev/diofant that referenced this issue Jun 1, 2021
skirpichev added a commit to skirpichev/diofant that referenced this issue Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy to Fix This is a good issue for new contributors. Feel free to work on this if no one else has already. integrals
Projects
None yet
Development

No branches or pull requests

4 participants