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

Can't solve limit(x**2 + x*sin(x) + cos(x), x, -oo) #12564

Closed
anniewu1214 opened this issue Apr 19, 2017 · 1 comment
Closed

Can't solve limit(x**2 + x*sin(x) + cos(x), x, -oo) #12564

anniewu1214 opened this issue Apr 19, 2017 · 1 comment

Comments

@anniewu1214
Copy link

limit(x**2 + x*sin(x) + cos(x), x, -oo) should return oo

@maurogaravello
Copy link
Contributor

maurogaravello commented Apr 29, 2017

PR #12607 should fix the issue.

maurogaravello added a commit to maurogaravello/sympy that referenced this issue Oct 15, 2017
In some situation, for example if expr = x**2 + x*sin(x), limit(expr, x, oo) fails
since heuristics() in limits.py calculates the limit of x**2 and x*sin(x) separately.
The second one returns all the real line as limit points.
If such happens, then the procedure stops.
Instead, if expr = x * (x + sin(x)), then sympy gives the correct answer.
Therefore some lines to limits.py are added in order to check whether
factor_terms(expr) or factor(expr) can help in solving the limit.

factor(expr) is more expensive than factor_terms(expr). Hence we inserted some conditional
in order to prevent, if possible, the use of factor(expr).

Moreover, two tests are added.
@smichr smichr closed this as completed Oct 17, 2017
smichr added a commit that referenced this issue Oct 17, 2017
Closes #12564. Can't solve limit(x**2 + x*sin(x) + cos(x), x, -oo).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants