Opened 6 years ago

Closed 4 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 6 years ago by kcrisman

  • Cc kcrisman added

comment:2 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:4 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:5 Changed 5 years ago by dkrenn

Still there in 6.6.

comment:6 Changed 4 years ago by ajagekar.akshay

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 4 years ago by rws

Well, it's similar to (sin(x)/x).limit(x=0), isn't it?

https://en.wikipedia.org/wiki/Indeterminate_form

comment:8 Changed 4 years ago by ajagekar.akshay

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: Changed 4 years ago by rws

  • 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 4 years ago by ajagekar.akshay

Replying to rws:

So you agree it's user error?

Yes.

comment:11 Changed 4 years ago by dkrenn

  • 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 4 years ago by ajagekar.akshay

  • Authors set to Akshay Ajagekar

comment:13 Changed 4 years ago by kcrisman

  • Authors Akshay Ajagekar deleted
  • 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 4 years ago by vbraun

  • Resolution set to invalid
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.