This limit seems to be wrong

47 views
Skip to first unread message

Peleg Michaeli

unread,
Jan 22, 2017, 10:14:07 AM1/22/17
to sage-support
Hi,

sage: ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity)
-Infinity

This is a wrong answer. It should be 2.

Replacing 3/2 in the power by 1, 2, or 3 (at least) gives correct answers (2, inf, inf).  Replacing it by 5/2 given a wrong answer again.

Is this related to a known bug?


Thanks,
Peleg.

William Stein

unread,
Jan 22, 2017, 11:13:53 AM1/22/17
to sage-support
I don't know if it is known - - you can try searching
https://trac.sagemath.org/, which lists all bugs we know of.

This is actually a bug in **MAXIMA**, which Sage calls to do this
limit: http://maxima.sourceforge.net/

If you call sympy instead it gets the right answer:

sage: ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity,
algorithm="sympy")
2

sage: ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity,
algorithm="maxima_taylor")
-Infinity

sage: ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity,
algorithm="maxima")
-Infinity



>
>
> Thanks,
> Peleg.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

Dima Pasechnik

unread,
Jan 22, 2017, 12:37:50 PM1/22/17
to sage-support


On Sunday, January 22, 2017 at 4:13:53 PM UTC, William wrote:
On Sun, Jan 22, 2017 at 7:14 AM, Peleg Michaeli <free...@gmail.com> wrote:
> Hi,
>
> sage: ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity)
> -Infinity
>
> This is a wrong answer. It should be 2.
>
> Replacing 3/2 in the power by 1, 2, or 3 (at least) gives correct answers
> (2, inf, inf).  Replacing it by 5/2 given a wrong answer again.
>
> Is this related to a known bug?

I don't know if it is known - - you can try searching
https://trac.sagemath.org/, which lists all bugs we know of.

This is actually a bug in **MAXIMA**, which Sage calls to do this
limit: http://maxima.sourceforge.net/

no, it's not in Maxima 5.39.0 (see https://trac.sagemath.org/ticket/18920 and give it a positive review :-))
called with its default settings.

$ sage --maxima
;;; Loading #P"/home/dima/Sage/sage-dev/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/dima/Sage/sage-dev/local/lib/ecl/sockets.fas"
;;; Loading #P"/home/dima/Sage/sage-dev/local/lib/ecl/defsystem.fas"
;;; Loading #P"/home/dima/Sage/sage-dev/local/lib/ecl/cmp.fas"
using Lisp ECL 16.1.2
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) limit((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x),x,inf);
(%o1)                                  2

Although calling this version of Maxima as  
sage: ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity)

gives -Infinity, still, as it's not called with default settings, but with something
that breaks it sometimes.

Peleg Michaeli

unread,
Jan 22, 2017, 3:49:57 PM1/22/17
to sage-support
So... I couldn't really follow: should I open a new ticket, or should it be solved by integrating the new maxima?

William Stein

unread,
Jan 22, 2017, 4:24:05 PM1/22/17
to sage-s...@googlegroups.com
I think Dima very very confusingly actually agreed that this is a bug in maxima that is in the newest version. 

I think your options are:
  - use the sympy option, or
  - fix the bug in maxima, or
  - change what sage uses by default, or
  - wait
Sent from my massive iPhone 6 plus.

Robert Dodier

unread,
Jan 22, 2017, 4:27:26 PM1/22/17
to sage-s...@googlegroups.com
On 2017-01-22, Dima Pasechnik <dim...@gmail.com> wrote:

> (%i1) limit((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x),x,inf);
> (%o1) 2
>
> Although calling this version of Maxima as
> sage: ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity)
>
> gives -Infinity, still, as it's not called with default settings, but with
> something that breaks it sometimes.

With Maxima 5.39.0 I find that domain=complex seems to tickle the bug.

(%i1) domain;
(%o1) real
(%i2) limit((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x),x,inf);
(%o2) 2
(%i3) domain:complex $
(%i4) limit((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x),x,inf);
(%o4) minf

I've opened https://sourceforge.net/p/maxima/bugs/3279/ for this and
also https://sourceforge.net/p/maxima/bugs/3280 for a related bug.

HTH

Robert Dodier


Reply all
Reply to author
Forward
0 new messages