Opened 3 years ago

Last modified 6 weeks ago

#11493 new defect

Wrong integral computation

Reported by: kcrisman Owned by: burcin
Priority: major Milestone: sage-6.4
Component: calculus Keywords:
Cc: mjo Merged in:
Authors: Reviewers:
Report Upstream: Reported upstream. No feedback yet. Work issues:
Branch: Commit:
Dependencies: Stopgaps: #12732

Description (last modified by kcrisman)

Reported by Nicolas Privault via Rado Kirov:

sage: integrate(x^(0.5)*e^(-x-x^2),x,0,infinity).n()
0.886226925452758

sage: integrate(x^(1/2)*e^(-x-x^2),x,0,infinity).n()
0.32015709036013135

which give two different results, and the second one is correct.

Change History (12)

comment:1 Changed 3 years ago by kcrisman

Here is what is going on.

(%i16) integrate(x^(1/2)*%e^(-x-x^2),x,0,inf);
                           inf
                          /                 2
                          [              - x  - x
(%o16)                    I    sqrt(x) %e         dx
                          ]
                          /
                           0

(%i18) integrate(x^(.5)*%e^(-x-x^2),x,0,inf);
<snip lots of these>
rat: replaced 0.5 by 1/2 = 0.5
                                   sqrt(%pi)
(%o18)                             ---------
                                       2

comment:2 Changed 3 years ago by kcrisman

  • Description modified (diff)

The other thing was correct, I believe, so I'm not sure what the poster thought was wrong with it.

sage: numerical_integral(x^(0.5)*e^(-x),0,100000)
(0.88622692749267307, 4.3485198683228606e-07)

comment:3 Changed 3 years ago by kcrisman

  • Report Upstream changed from N/A to Reported upstream. Little or no feedback.

This is now reported at this Maxima ticket.

comment:4 Changed 2 years ago by roed

  • Stopgaps set to #12732

comment:5 Changed 2 years ago by mjo

  • Cc mjo added

comment:6 Changed 2 years ago by roed

  • Report Upstream changed from Reported upstream. Little or no feedback. to Reported upstream. No feedback yet.

comment:7 Changed 22 months ago by kcrisman

#13718 may be related.

comment:8 Changed 13 months ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:9 Changed 8 months ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:10 Changed 7 months ago by chapoton

Still not working in 6.2.beta3. Moreover one also gets

sage: integrate(e^(-x-x^2+log(x)/2),x,0,infinity)
integrate(e^(-x^2 - x + 1/2*log(x)), x, 0, +Infinity)
sage: integrate(e^(-x-x^2+log(x)/RDF(2)),x,0,infinity)
  ____
\/ pi 
------
  2   

comment:11 Changed 5 months ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:12 Changed 6 weeks ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.