Opened 5 years ago
Closed 3 years ago
#15451 closed defect (invalid)
symbolic.limit wrongly gives ZeroDivisionError
Reported by: | dkrenn | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | symbolics | Keywords: | symbolic, limit, wrong, zero division |
Cc: | kcrisman | Merged in: | |
Authors: | Reviewers: | Daniel Krenn, Akshay Ajagekar | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
We have
sage: (4-x^2)/(3-sqrt(x^2+5)).limit(x=2) Traceback (most recent call last): ... ZeroDivisionError: Symbolic division by zero
but
sage: limit((4-x^2)/(3-sqrt(x^2+5)), x=2) 6
Those two should give the same result (at least the docstring of x.limit
says See "sage.calculus.calculus.limit"
, so it has the appearence that the same functions are called).
Change History (14)
comment:1 Changed 5 years ago by
- Cc kcrisman added
comment:2 Changed 5 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:3 Changed 5 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:4 Changed 5 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:5 Changed 4 years ago by
comment:6 Changed 3 years ago by
I don't understand the issue. In case of
sage: (4-x^2)/(3-sqrt(x^2+5)).limit(x=2)
4-x^2
gets divided by (3-sqrt(x^2+5)).limit(x=2)
which is 0, so the ZeroDivisionError?. But this works
sage: ((4-x^2)/(3-sqrt(x^2+5))).limit(x=2) 6
comment:7 Changed 3 years ago by
Well, it's similar to (sin(x)/x).limit(x=0)
, isn't it?
comment:8 Changed 3 years ago by
The expression of which limit is evaluated in this case is (3-sqrt(x^2+5))
at x=2 and not the whole expression (4-x^2)/(3-sqrt(x^2+5))
as for the second case limit((4-x^2)/(3-sqrt(x^2+5)), x=2)
limit is evaluated for whole expression. proper parenthesis would give correct answer.
comment:9 follow-up: ↓ 10 Changed 3 years ago by
- Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
So you agree it's user error?
comment:10 in reply to: ↑ 9 Changed 3 years ago by
comment:11 Changed 3 years ago by
- Reviewers set to Daniel Krenn
- Status changed from needs_review to positive_review
I agree as well that it is a user error (sorry, I didn't see this (the wrong parentheses) when opening the ticket).
Feel free to insert your name(s) in the author field.
comment:12 Changed 3 years ago by
comment:13 Changed 3 years ago by
- Reviewers changed from Daniel Krenn to Daniel Krenn, Akshay Ajagekar
Actually, there are no authors if there is no patch, but definitely this is a contribution so I put it in reviewers.
comment:14 Changed 3 years ago by
- Resolution set to invalid
- Status changed from positive_review to closed
Still there in 6.6.