Opened 7 years ago

# cancellation of two indefinite limits

Reported by: Owned by: dkrenn major sage-6.4 symbolics symbolic, cancellation, limit, indefinite jakobkroeker N/A wrongBehaviourMarker

We get

```sage: limit(cos(x),x=oo) - limit(sin(x),x=oo)
0
```

This comes from the fact that the return value of each of these limits is a symbolic variable:

```sage: limit(sin(x), x=oo)
ind
sage: type(limit(sin(x), x=oo))
<type 'sage.symbolic.expression.Expression'>
sage: limit(sin(x), x=oo).variables()
(ind,)
```

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

• Description modified (diff)

### comment:2 Changed 7 years ago by nbruin

This is an upstream problem (in maxima). It seems "ind" isn't a special symbol there either:

```Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
(%i3) limit(sin(x),x,inf)-limit(cos(x),x,inf);
(%o3)                                  0
```

We could intercept ind whenever it comes by (from limit) and raise an exception to limit the damage, but I imagine the bad simplifications could already happen internal to maxima.

This seems to happen with infinity as well, by the way:

```(%i14) limit(1/x^2,x,0)-limit(1/x^4,x,0);
(%o14)                                 0
```

Sage catches those (when they happen in a way sage can see it happen), so perhaps we should recognize `ind` and a special value--leading to an exception if we can't do anything with it.

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

• Milestone changed from sage-6.3 to sage-6.4

### comment:4 Changed 6 years ago by dkrenn

Still there in 6.6.