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

Integration of x**(S(9)/2) * log(x) takes about 15 minutes #15706

Open
normalhuman opened this issue Dec 28, 2018 · 6 comments
Open

Integration of x**(S(9)/2) * log(x) takes about 15 minutes #15706

normalhuman opened this issue Dec 28, 2018 · 6 comments

Comments

@normalhuman
Copy link
Contributor

The integration of x**(S(9)/2) * log(x) is an easy calculus exercise (by parts once), but SymPy takes about 15 minutes on my computer.

>>> from sympy import *
>>> from time import time
>>> x = symbols('x', positive=True)
>>> tc = time(); integrate(x**(S(9)/2)*log(x), x); print(time() - tc)
2*x**(11/2)*log(x)/11 - 4*x**(11/2)/121
947.0029301643372

The amount of time grows rapidly with the exponent; I would not want to try 99/2.

Should manual integration be tried before heurisch (which takes so long)?

>>> tc = time(); integrate(x**(S(9)/2)*log(x), x, manual=True); print(time() - tc)
4*x**(11/2)*log(x**(9/2))/99 - 4*x**(11/2)/121
0.660252571105957
@jksuom
Copy link
Member

jksuom commented Dec 29, 2018

Should manual integration be tried before heurisch

That is how it was planned, originally. I guess that the ordering of integrators became hard to implement as _eval_integral is calling itself recursively.

@asmeurer
Copy link
Member

asmeurer commented Jan 9, 2019

heurisch should absolutely be called very last.

@RituRajSingh878
Copy link
Contributor

I think there is an issue in "manualintegrate" because it is giving the wrong result for the above integrand when the manual is "True".

@RituRajSingh878
Copy link
Contributor

@asmeurer after changing order of integrators ,many test case are failing .so i think we can add time limit function in heurisch so it will break it's self after some time and continue to other integrators.

@sharma-kunal
Copy link
Contributor

@asmeurer I would like to work on the issue, if you tell me how we can make heurisch to be called at last.

@sharma-kunal
Copy link
Contributor

or we can do as proposed by @RituRajSingh878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants