Ticket #4142 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

limit bug: should be -Infinity, but gives +Infinity

Reported by: ddrake Owned by: burcin
Priority: major Milestone: sage-4.3.1
Component: calculus Keywords:
Cc: Work issues:
Report Upstream: Fixed upstream, in a later stable release. Reviewers: Dan Drake
Authors: Karl-Dieter Crisman Merged in: sage-4.3.1.alpha0
Dependencies: Stopgaps:

Description

As discussed in  http://groups.google.com/group/sage-devel/browse_thread/thread/7afc9f414413906 , some limits are not evaluated correctly:

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

The last command should give -Infinity, of course, since f is a semicircle. At the other endpoint, the limit is correct (+Infinity).

Attachments

trac_4142-limit-sqrt.patch Download (838 bytes) - added by kcrisman 3 years ago.
Based on 4.3.alpha1

Change History

comment:1 Changed 4 years ago by kcrisman

As it happens, this is still a problem in Sage 4.1.x - but the problem is somewhat more subtle than just some Maxima bug, or Sage incorrectly parsing Maxima output:

(%i1) limit(-x/sqrt(1-x^2),x,1,minus);
(%o1)                                            infinity

BUT Maxima's infinity is not Sage's infinity; it is the complex infinity! If the answer is +infinity, Maxima would return 'inf'. I've asked the Maxima list about this, so we'll see what happens.

comment:2 Changed 4 years ago by kcrisman

This is fixed in the latest Maxima CVS version, so whenever we upgrade again, this one will hopefully be closed.

Maxima 5.19post http://maxima.sourceforge.net
using Lisp SBCL 1.0.24
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/sqrt(1-x^2),x,1,minus);
(%o1)                                minf

comment:3 Changed 3 years ago by kcrisman

  • Report Upstream set to N/A

This is now correct in Maxima 5.20.1, so it just needs a doctest once the new spkg is merged.

comment:4 Changed 3 years ago by kcrisman

  • Status changed from new to needs_review
  • Report Upstream changed from N/A to Fixed upstream, in a later stable release.
  • Authors set to Karl-Dieter Crisman

The patch here depends on the spkg at #7745 to work properly. It also depends on the patch there, and at #6423, but will probably still apply if someone forgot to apply them first.

Changed 3 years ago by kcrisman

Based on 4.3.alpha1

comment:5 Changed 3 years ago by ddrake

  • Status changed from needs_review to positive_review
  • Reviewers set to Dan Drake

The spkg and patch at #7745 fix this problem, and the doctest passes. Positive review; this can be merged as soon as #7745 is in.

comment:6 Changed 3 years ago by mhansen

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.3.1.alpha0
Note: See TracTickets for help on using tickets.