ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 25 Mar 2011 23:13:12 +0100arctan of infinity is undefinedhttps://ask.sagemath.org/question/8026/arctan-of-infinity-is-undefined/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?Fri, 25 Mar 2011 22:35:55 +0100https://ask.sagemath.org/question/8026/arctan-of-infinity-is-undefined/Answer by kcrisman for <p>Using the following code for an equation, I get an undefined result for <code>arctan(oo)</code>:</p>
<pre><code>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
</code></pre>
<p>What is wrong?</p>
https://ask.sagemath.org/question/8026/arctan-of-infinity-is-undefined/?answer=12226#post-id-12226The 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.Fri, 25 Mar 2011 23:13:12 +0100https://ask.sagemath.org/question/8026/arctan-of-infinity-is-undefined/?answer=12226#post-id-12226