sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.35k stars 461 forks source link

bug in simple limit #27311

Open GMS103 opened 5 years ago

GMS103 commented 5 years ago

I have found the following bug in limit:

sage: version()
'SageMath version 8.6, Release Date: 2019-01-15'
sage: f=exp(-2*x^2)-cos(2*x);f
-cos(2*x) + e^(-2*x^2)
sage: g=x*(sin(x))^3;g
x*sin(x)^3
sage: lim(f/g,x=0) # this is wrong
und
sage: lim(f/g,x=0,dir='-'),lim(f/g,x=0,dir='+') # the second result is wrong
(4/3, +Infinity)
sage: taylor(f/g,x,0,3) # this is right
-26/45*x^2 + 4/3
sage: lim(f/x^4,x=0) # this is right too
4/3

(I am on OS X El Capitan (10.11.6).)

This seems to be a very old bug: The results are the same for

sage: version()
'SageMath Version 6.10, Release Date: 2015-12-18'

Component: calculus

Keywords: limit

Issue created by migration from https://trac.sagemath.org/ticket/27311

embray commented 5 years ago
comment:1

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

embray commented 5 years ago
comment:2

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).

embray commented 4 years ago
comment:4

Ticket retargeted after milestone closed

mkoeppe commented 4 years ago
comment:5

Moving tickets to milestone sage-9.2 based on a review of last modification date, branch status, and severity.

mkoeppe commented 4 years ago
comment:6

still the same in 9.2.beta10

GMS103 commented 4 years ago
comment:7

Yes, you are right.

Anything I could do? I am only a not very experienced user of SageMath.

ninja18 commented 3 years ago
comment:8

This problem occurs only with maxima. With fricas it works as expected. But these are some of the other cases where the result is ambiguous.

sage: f = (1+1/x)^x
sage: lim(f,x=0.5)
und
sage: lim(f,x=1/2)
sqrt(3)
sage: lim(f,dir='+',x=0.5)
1.7320508075688774
sage: lim(f,dir='-',x=0.5)
1.7320508075688772
sage: lim(f,dir='-',x=3/2)
5/9*sqrt(5)*sqrt(3)
sage: lim(f,x=3/2)
und
sage: lim(f,x=1.5)
fchapoton commented 3 years ago

Changed keywords from none to limit

mkoeppe commented 3 years ago
comment:11

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review.