# arctan of infinity is undefined

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Using the following code for an equation, I get an undefined result for arctan(oo):

sage: var('t, p, w')
(t, p, w)
sage: a = w^2
sage: b = w
sage: k = b/a
sage: phi = arctan(k)
sage: a = lim(k, w=0)
sage: a
Infinity
sage: lim(phi, w=0) # should be pi/2 ?
und
sage: b = oo
sage: arctan(b)
1/2*pi
sage: a==b
True
sage: arctan(a)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: cannot coerce arguments: no canonical coercion from The Unsigned Infinity Ring to Symbolic Ring


What is wrong?

edit retag close merge delete

Sort by ยป oldest newest most voted

This post is a wiki. Anyone with karma >750 is welcome to improve it.

The key here is the error message:

TypeError: cannot coerce arguments: no canonical coercion from The Unsigned Infinity Ring to Symbolic Ring


Sage has several kinds of infinity. The usual kind is oo. But there is also an unsigned one, the sort of thing that happens at vertical asymptotes that Churchill referred to.

sage: lim(1/x^2,x=0)
+Infinity
sage: lim(1/x,x=0)
Infinity


Perhaps annoyingly,

sage: Infinity
+Infinity


But anyway,

sage: arctan(oo)
1/2*pi
sage: arctan(-oo)
-1/2*pi


So there is no canonical answer. To recap:

sage: oo in SR
True
sage: -oo in SR
True
sage: lim(1/x,x=0) in SR
False


To the other question implicit in the post:

sage: lim(arctan(1/x),x=0,dir='+')
1/2*pi
sage: lim(arctan(1/x),x=0,dir='-')
-1/2*pi


So no, the limit you marked with "# should be pi/2 ?" should be und, or undefined.

more