Opened 8 years ago

Closed 6 years ago

# symbolic.limit wrongly gives ZeroDivisionError

Reported by: Owned by: dkrenn major sage-duplicate/invalid/wontfix symbolics symbolic, limit, wrong, zero division kcrisman Daniel Krenn, Akshay Ajagekar N/A

### 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).

### comment:2 Changed 8 years ago by vbraun_spam

• Milestone changed from sage-6.1 to sage-6.2

### comment:3 Changed 8 years ago by vbraun_spam

• Milestone changed from sage-6.2 to sage-6.3

### comment:4 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.3 to sage-6.4

### comment:5 Changed 7 years ago by dkrenn

Still there in 6.6.

### comment:6 Changed 6 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 6 years ago by rws

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

### comment:8 Changed 6 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: ↓ 10 Changed 6 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 6 years ago by ajagekar.akshay

So you agree it's user error?

Yes.

### comment:11 Changed 6 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 6 years ago by ajagekar.akshay

• Authors set to Akshay Ajagekar

### comment:13 Changed 6 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 6 years ago by vbraun

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