incorrect limit

64 views
Skip to first unread message

Greg Marks

unread,
Apr 16, 2016, 8:39:07 PM4/16/16
to sage-support
Dear SAGE developers,

Strangely, SAGE gives this incorrect result:

   ┌────────────────────────────────────────────────────────────────────┐
   │ SageMath Version 7.1, Release Date: 2016-03-20                     │
   │ Type "notebook()" for the browser-based notebook interface.        │
   │ Type "help()" for help.                                            │
   └────────────────────────────────────────────────────────────────────┘
   sage: assume(x, 'real')
   sage: limit((x^(1/x)-1)*sqrt(x), x=infinity)
   +Infinity
   sage: limit(((1/x)^x-1)/sqrt(x), x=0, dir='+')
   +Infinity

Sincerely,
Greg Marks

    ------------------------------------------------
   | Greg Marks                                     |
   | Department of Mathematics and Computer Science |
   | St. Louis University                           |
   | St. Louis, MO 63103-2007                       |
   | U.S.A.                                         |
   |                                                |
   | Phone: (314)977-7206        Fax: (314)977-1452 |
   | PGP encryption public key ID: 0x53F269E8       |
   | Web: http://gmarks.org                         |
    ------------------------------------------------

kcrisman

unread,
Apr 16, 2016, 10:19:11 PM4/16/16
to sage-support, Robert Dodier

   sage: assume(x, 'real')
   sage: limit((x^(1/x)-1)*sqrt(x), x=infinity)
   +Infinity
   sage: limit(((1/x)^x-1)/sqrt(x), x=0, dir='+')
   +Infinity


Thanks.  In pure Maxima we get:

(%i3) limit((x^(1/x)-1)*sqrt(x),x,inf);
(%o3)                                 inf
(%i4) limit((x^(1/x)-1)*sqrt(x),x,0);
(%o4)                                 und
(%i5) limit((x^(1/x)-1)*sqrt(x),x,0,plus);
(%o5)                                  0
(%i6) limit((x^(1/x)-1)*sqrt(x),x,0,minus);
(%o6)                                 inf

From what I understand, the first of these is wrong, maybe also the last (should it be infinity (complex infinity) instead?).


Interestingly,

(%i7) domain:complex;
(%o7)                               complex
(%i10) limit((x^(1/x)-1)*sqrt(x),x,0,minus);

;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt

<lots of times>

Segmentation fault: 11

Robert, ever seen that one?  I also get this with
sage: limit(((1/x)^x-1)/sqrt(x), x=0)

I've reported this at http://trac.sagemath.org/ticket/20452 - not at the Maxima tracker yet, I'm afraid.

Greg Marks

unread,
Apr 17, 2016, 8:47:02 PM4/17/16
to sage-support
Dear SAGE developers,

On the other hand, we do get a correct result this way:


   ┌────────────────────────────────────────────────────────────────────┐
   │ SageMath Version 7.1, Release Date: 2016-03-20                     │
   │ Type "notebook()" for the browser-based notebook interface.        │
   │ Type "help()" for help.                                            │
   └────────────────────────────────────────────────────────────────────┘
   sage: import sympy
   sage: sympy.limit((x^(1/x)-1)*sqrt(x), x, infinity)
   0
   sage: sympy.limit(((1/x)^x-1)/sqrt(x), x, 0, '+')
   0

(If nothing else, users can be appropriately skeptical if Maxima and
SymPy are giving different answers.)


Sincerely,
Greg Marks

    ------------------------------------------------
   | Greg Marks                                     |
   | Department of Mathematics and Computer Science |
   | St. Louis University                           |
   | St. Louis, MO 63103-2007                       |
   | U.S.A.                                         |
   |                                                |
   | Phone: (314)977-7206        Fax: (314)977-1452 |
   | PGP encryption public key ID: 0x53F269E8       |
   | Web: http://gmarks.org                         |
    ------------------------------------------------

Robert Dodier

unread,
Apr 19, 2016, 4:00:39 PM4/19/16
to sage-s...@googlegroups.com
On 2016-04-17, kcrisman <kcri...@gmail.com> wrote:

> Thanks. In pure Maxima we get:
>
> (%i3) limit((x^(1/x)-1)*sqrt(x),x,inf);
> (%o3) inf
> (%i4) limit((x^(1/x)-1)*sqrt(x),x,0);
> (%o4) und
> (%i5) limit((x^(1/x)-1)*sqrt(x),x,0,plus);
> (%o5) 0
> (%i6) limit((x^(1/x)-1)*sqrt(x),x,0,minus);
> (%o6) inf
>
> From what I understand, the first of these is wrong, maybe also the last
> (should it be infinity (complex infinity) instead?).

I think the first and last are wrong -- last should infinity or und
(undefined), I think. I've opened bug reports for these:
https://sourceforge.net/p/maxima/bugs/3142/
https://sourceforge.net/p/maxima/bugs/3143/
and some other limit bugs I've run into while investigating these.

gruntz is better here --

(%i5) gruntz((x^(1/x)-1)*sqrt(x),x,inf, minus);
(%o5) 0
(%i6) gruntz((x^(1/x)-1)*sqrt(x),x,0, plus);
(%o6) 0
(%i7) gruntz((x^(1/x)-1)*sqrt(x),x,0, minus);
(%o7) gruntz(sqrt(x)*(x^(1/x)-1),x,0,minus)

gruntz is one of the methods called from limit. Putting gruntz first
(which I tried as an experiment) introduces its own problems though.
That exposes some bugs in gruntz, and also some results which are
different, so it would be necessary to trawl through them and verify
that they're correct.

best

Robert Dodier

Reply all
Reply to author
Forward
0 new messages