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
Sympy integrate returns an integral instead of result #20831
Comments
@sagilap Actually sympy returns an Intergral object (as in you case) when it is not able to calculate some intergral. |
I wonder if there should be a check in integral for divergent integrals like this. These two facts should be enough to conclude that the integral is infinite if the upper limit is
|
is the second check really necessary? |
Yes: In [1]: x = Symbol('x', positive=True)
In [2]: expr = 1/x**2
In [3]: expr.is_positive
Out[3]: True
In [4]: expr.limit(x, oo)
Out[4]: 0
In [5]: integrate(expr, (x, 1, oo))
Out[5]: 1 The fact that the integrand goes to zero can not be used to conclude that it is convergent though: In [6]: expr = 1/x
In [7]: expr.is_positive
Out[7]: True
In [8]: expr.limit(x, oo)
Out[8]: 0
In [9]: integrate(expr, (x, 1, oo))
Out[9]: ∞ Clearly though if the integrand is always positive and diverges to infinity then the integral will be |
hey @oscarbenjamin i think it should be
I am currently working on a pull request for this and i was thinking to use |
I'm trying to use
sympy
to calculate the following equations: Integral ofexp(x)*exp(log(x)^2)
between 1 and infinity, but I'm getting a result of an integral..This is the result:(should be infinity)
The thing is if I try
log(x)
instead oflog(x)**2
, it works and the result is oo(infinity) as expected. Why is this happening?The text was updated successfully, but these errors were encountered: