Open sbondaryev opened 2 years ago
In the future, please paste the code into the issue instead of posting a screenshot. That way we can actually copy the code to execute it.
The definite integral gives the right answer, although it can't simplify it.
>>> integrate((cos(x**2) - cos(x))/x**2, x)
Si(x) + sqrt(2)*sqrt(pi)*fresnels(sqrt(2)*x/sqrt(pi))*gamma(-1/4)/(4*gamma(3/4)) + cos(x)/x + cos(x**2)*gamma(-1/4)/(4*x*gamma(3/4))
>>> limit(integrate((cos(x**2) - cos(x))/x**2, x), x, -oo)
-pi/2 - sqrt(2)*sqrt(pi)*gamma(-1/4)/(8*gamma(3/4))
>>> limit(integrate((cos(x**2) - cos(x))/x**2, x), x, oo)
sqrt(2)*sqrt(pi)*gamma(-1/4)/(8*gamma(3/4)) + pi/2
>>> simplify(limit(integrate((cos(x**2) - cos(x))/x**2, x), x, oo) - limit(integrate((cos(x**2) - cos(x))/x**2, x), x, -oo))
sqrt(2)*sqrt(pi)*gamma(-1/4)/(4*gamma(3/4)) + pi
>>> N(limit(integrate((cos(x**2) - cos(x))/x**2, x), x, oo) - limit(integrate((cos(x**2) - cos(x))/x**2, x), x, -oo))
0.634964378958793
Even substituting with oo
and -oo
gives the correct result.
Edit: "correct" = the same as the limit.
@asmeurer , @oscargus
Still not working with when I use the Integral
syntax
Step to reproduce
from sympy.abc import x;I=Integral((cos(x**2)-cos(x))/x**2, (x, -oo, oo)); I.doit()
The incorrect result comes from meijerg. The result changed from -oo
to oo
after 7ed5f670e5283e6355f4b786c900e628fd71c77e.
SymPy 1.9