Opened 4 years ago

Closed 2 years ago

#26060 closed defect (fixed)

Wrong limit(x / (x + 2^x + cos(x)), x=-oo)

Reported by: Peleg Michaeli Owned by:
Priority: major Milestone: sage-9.2
Component: calculus Keywords: limit, maxima
Cc: Samuel Lelièvre Merged in:
Authors: Samuel Lelièvre Reviewers: Karl-Dieter Crisman
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: 7f96496 (Commits, GitHub, GitLab) Commit: 7f964965cc53474166342bcf9a1146233d9fc42b
Dependencies: #26625 Stopgaps:

Status badges

Description (last modified by Samuel Lelièvre)

Up to Sage 8.7 this limit returns "und" for "undefined":

sage: limit(x / (x + 2^x + cos(x)), x=-infinity)
und

while it should clearly be 1.

SymPy returns the correct result:

sage: limit(x / (x+2^x + cos(x)), x=-infinity, algorithm='sympy')
1

Reported to Maxima on 2018-08-15 as Maxima bug 3459, fixed there by Maxima commit 0c5c018 on 2018-08-30, fix included in Maxima 5.42.2 to which we upgrade in #26625, merged in Sage 8.8.beta7.

In Sage >= 8.8 we get the correct value for this limit:

sage: limit(x / (x + 2^x + cos(x)), x=-infinity)
1

This ticket adds a doctest for that limit computation.

Change History (19)

comment:1 Changed 4 years ago by Karl-Dieter Crisman

Report Upstream: N/AReported upstream. No feedback yet.

Apparently yes.

$ sage --maxima
<snip>
Maxima 5.41.0 http://maxima.sourceforge.net
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(x / (x+2^x+cos(x)),x,-inf)       ;
(%o1)                                 und

I've reported this at Maxima bug 3459.

comment:2 Changed 4 years ago by Karl-Dieter Crisman

Report Upstream: Reported upstream. No feedback yet.Reported upstream. Developers acknowledge bug.

comment:3 Changed 4 years ago by Karl-Dieter Crisman

Report Upstream: Reported upstream. Developers acknowledge bug.Fixed upstream, but not in a stable release.

comment:4 Changed 4 years ago by Karl-Dieter Crisman

(That was pretty fast work!)

comment:5 Changed 4 years ago by Samuel Lelièvre

Cc: Samuel Lelièvre added
Dependencies: #26625
Description: modified (diff)
Keywords: limit,maximalimit, maxima
Milestone: sage-8.4sage-8.7
Report Upstream: Fixed upstream, but not in a stable release.Fixed upstream, in a later stable release.

After the upgrade to Maxima 5.42.2 in #26625, we should add a doctest here.

comment:6 Changed 4 years ago by Erik Bray

Milestone: sage-8.7sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

comment:7 Changed 3 years ago by Erik Bray

Milestone: sage-8.8

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

comment:8 Changed 2 years ago by Matthias Köppe

Milestone: sage-duplicate/invalid/wontfix
Status: newneeds_review

Works in 9.2.beta10

comment:9 Changed 2 years ago by Karl-Dieter Crisman

Status: needs_reviewneeds_work

Doctest

comment:10 Changed 2 years ago by Samuel Lelièvre

Branch: public/ticket/26060
Commit: 7f964965cc53474166342bcf9a1146233d9fc42b
Description: modified (diff)
Status: needs_workneeds_review

Doctest added. Please review.


New commits:

7f9649626060: doctest for limit after Maxima upgrade

comment:11 Changed 2 years ago by Samuel Lelièvre

Milestone: sage-duplicate/invalid/wontfixsage-9.2

comment:12 Changed 2 years ago by Samuel Lelièvre

Description: modified (diff)

comment:13 Changed 2 years ago by Samuel Lelièvre

Summary: Wrong limit calculationWrong limit(x / (x + 2^x + cos(x)), x=-oo)

comment:14 Changed 2 years ago by Karl-Dieter Crisman

Looks fine to me (assuming patchbot says it's fine), though all the other changes in typesetting could have occurred on another ticket. Thanks for doctesting!

comment:15 Changed 2 years ago by Karl-Dieter Crisman

Status: needs_reviewpositive_review

comment:16 Changed 2 years ago by Karl-Dieter Crisman

Authors: Samuel Lelievre
Reviewers: Karl-Dieter Crisman

comment:17 Changed 2 years ago by Samuel Lelièvre

Authors: Samuel LelievreSamuel Lelièvre

comment:18 Changed 2 years ago by Karl-Dieter Crisman

Sorry! Haven't been keeping "Trac" as much lately.

comment:19 Changed 2 years ago by Volker Braun

Branch: public/ticket/260607f964965cc53474166342bcf9a1146233d9fc42b
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.