Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two different results with same numeric integral #11493

Open
kcrisman opened this issue Jun 15, 2011 · 10 comments
Open

two different results with same numeric integral #11493

kcrisman opened this issue Jun 15, 2011 · 10 comments

Comments

@kcrisman
Copy link
Member

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.

Upstream: Reported upstream. No feedback yet.

CC: @orlitzky

Component: calculus

Stopgaps: #12732

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

@kcrisman
Copy link
Member Author

comment:1

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

@kcrisman

This comment has been minimized.

@kcrisman
Copy link
Member Author

comment:2

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)

@kcrisman
Copy link
Member Author

Upstream: Reported upstream. Little or no feedback.

@kcrisman
Copy link
Member Author

comment:3

This is now reported at this Maxima ticket.

@roed314
Copy link
Contributor

roed314 commented Mar 22, 2012

Stopgaps: #12732

@roed314
Copy link
Contributor

roed314 commented Jun 1, 2012

Changed upstream from Reported upstream. Little or no feedback. to Reported upstream. No feedback yet.

@kcrisman
Copy link
Member Author

comment:7

#13718 may be related.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@fchapoton
Copy link
Contributor

comment:10

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   

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@rwst
Copy link

rwst commented Jan 31, 2015

comment:13

Not working in 6.5rc0.

@rwst rwst changed the title Wrong integral computation two different results with same numeric integral Jan 31, 2015
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants