1 | initial version |
Let us take as a comparison the results for some sample limits.
Sage shows for limit(sin(1/x), x=0)
an ind
efinite (but bounded) result.
For limit(1/sin(1/x), x=0)
we get indeed und
.
For the given limit computation of $1/x$ for $x\to 0$ we may compare:
sage: limit(1/x, x=0)
Infinity
sage: limit(1/x, x=0, dir=None) # default value for dir
Infinity
sage: limit(1/x, x=0, dir='+')
+Infinity
sage: limit(1/x, x=0, dir='-')
-Infinity
sage: limit(1/x, x=0, dir='-', algorithm='maxima')
-Infinity
sage: limit(1/x, x=0, dir='+', algorithm='maxima')
+Infinity
sage: limit(1/x, x=0, algorithm='maxima')
Infinity
sage: limit(1/x, x=0, algorithm='fricas')
und
sage: limit(1/x, x=0, dir='+', algorithm='fricas')
+Infinity
sage: limit(1/x, x=0, dir='-', algorithm='fricas')
-Infinity
sage: limit(1/x, x=0, algorithm='sympy')
+Infinity
sage: limit(1/x, x=0, dir='+', algorithm='sympy')
+Infinity
sage: limit(1/x, x=0, dir='-', algorithm='sympy')
-Infinity
The differences are minimal, but they are there. First of all, fricas
delivers (through sage) the wanted value und
.
Then sage delivers three "differently printed" results, Infinity
, +Infinity
, and -Infinity
for the dir
ection respectively None (default), from the right (positive side), and from the left (negative side). For a closer look, let us compare:
sage: L = limit(1/x, x=0)
sage: L1 = limit(1/x, x=0, dir='+')
sage: L2 = limit(1/x, x=0, dir='-')
sage: bool(L == L1)
False
sage: bool(L == L2)
False
sage: bool(L1 == L2)
False
sage: sign(L1)
1
sage: sign(L2)
-1
sage: sign(L)
sgn(Infinity)
sage: L == Infinity
Infinity == +Infinity
sage: bool(L == Infinity)
False
unsigned_infinity
sage: L == unsigned_infinity
Infinity == Infinity
sage: bool(L == unsigned_infinity)
True
sage: L.is_positive()
False
sage: L.is_positive_infinity()
False
sage: L.is_infinity()
True
sage: L1.is_positive()
True
sage: L1.is_positive_infinity()
True
sage: L1.is_infinity()
True
sage: L2.is_negative()
True
sage: L2.is_negative_infinity()
True
So we have three different "limits", L
, L1
, and L2
.
For the second limit we have a similar situation:
sage: limit(tan(x), x = pi/2)
Infinity
sage: limit(tan(x), x = pi/2, dir='-')
+Infinity
sage: limit(tan(x), x = pi/2, dir='+')
-Infinity
For the simplification, we have for instance:
sage: arcsinh(sinh(0))
0
sage: arcsinh(sinh(2*pi*i))
0
So there is some reason for keeping things as they are. (One may assume $x$ to be real, and then the story begins, somebody has to implement this simplification.)
For the final simplification we maybe also need an implementer.