limit evaluation bug

3 views
Skip to first unread message

Dan Drake

unread,
Sep 18, 2008, 12:04:14 AM9/18/08
to sage-...@googlegroups.com
I found a bug in a limit evaluation:

sage: f = sqrt(1-x^2)
sage: g = diff(f, x); g
-x/sqrt(1 - x^2)
sage: limit(g, x=1, dir='below')
+Infinity

It's a semicircle, so the derivative should go to negative infinity on
the right side.

I'd file a trac ticket, but I'm not sure if this is known, or if there's
much we can do about it. (I'm guessing it's a Maxima bug, which might be
fixed in a newer version.)

Dan

--
--- Dan Drake <dr...@mathsci.kaist.ac.kr>
----- KAIST Department of Mathematical Sciences
------- http://math.kaist.ac.kr/~drake

signature.asc

William Stein

unread,
Sep 18, 2008, 12:06:22 AM9/18/08
to sage-...@googlegroups.com
On Wed, Sep 17, 2008 at 9:04 PM, Dan Drake <dr...@mathsci.kaist.ac.kr> wrote:
> I found a bug in a limit evaluation:
>
> sage: f = sqrt(1-x^2)
> sage: g = diff(f, x); g
> -x/sqrt(1 - x^2)
> sage: limit(g, x=1, dir='below')
> +Infinity
>
> It's a semicircle, so the derivative should go to negative infinity on
> the right side.
>
> I'd file a trac ticket, but I'm not sure if this is known, or if there's
> much we can do about it. (I'm guessing it's a Maxima bug, which might be
> fixed in a newer version.)

I'm sure that it's a maxima bug and even so you should
definitely create a trac ticket about it.

William

Robert Dodier

unread,
Sep 18, 2008, 10:58:45 AM9/18/08
to sage-devel, max...@math.utexas.edu
Dan Drake wrote:

> sage: f = sqrt(1-x^2)
> sage: g = diff(f, x); g
> -x/sqrt(1 - x^2)
> sage: limit(g, x=1, dir='below')
> +Infinity
>
> It's a semicircle, so the derivative should go to negative infinity on
> the right side.

Hmm. Did you mean the left side? I'm probably missing something.

There are 2 things going on here.
(1) Maxima (current cvs version) has trouble with this problem.
(2) Maxima returns the symbol infinity for this limit (and others)
which represents complex infinity, as opposed to real positive
or negative infinity, which are inf and minf, respectively.

About (1),
(1a) limit (-x/sqrt(1 - x^2), x, 1); => limit(...) (just rephrased)
(1b) limit (-x/sqrt(1 - x^2), x, 1, minus); => infinity
(1c) limit (-x/sqrt(1 - x^2), x, 1, plus); => limit(...) (just
rephrased)

(1a) seems OK although in similar situations sometimes limit
returns und (undefined). I guess (1b) isn't incorrect but it could be
more precise (namely minf). As for (1c) I would expect infinity.

I hope someone from the Maxima project can weigh in on the correct
results to be expected from 1a, 1b, and 1c.

About (2), if Sage's Maxima interface doesn't distinguish infinity
from
inf, probably it should. Maybe it does already.

If someone can post a bug report to the Maxima bug tracker for this
problem, that would be great.

HTH

Robert Dodier
Reply all
Reply to author
Forward
0 new messages