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
Integral of real function has complex result #23596
Comments
Possibly related to #23337 |
It is coming from the computation of the FTC: >>> t = symbols('t', positive=True)
>>> pdf = ((1+t)/t**3)*sympy.exp(-1/t)
>>> expr = integrate(pdf*t)
>>> expr
-Ei(-1/t) + exp(-1/t)
>>> limit(expr, t, 0)
0
>>> limit(expr, t, oo)
-EulerGamma + 1 + I*pi I don't know if the limit is wrong or if the indefinite integral is simply inappropriate for naively computing the definite integral. |
@asmeurer @skirpichev I was unaware of the diofant package. It does a little better, so it might be worthwhile to look at changes there. But both sympy and diofant fail at the following
|
There is a problem with the limits:
has output
|
This term is already false:
The series expansion of |
Not fully sure if there is an
The changes are the following
The diff would also solve the limit errors you've pointed out above @eendebakpt
EDIT: I also see this above diff playing a part in one of the failing tests in my #23592 , so I'll fix the series based errors here once I figure the error I am having (related to failing limit in |
@anutosh491 The |
Yeah will address this soon ! I feel this would fix the issue . |
A minimal example:
has output
The text was updated successfully, but these errors were encountered: