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

"integrate" fails to integrate a convergent integral (sin(x^2)/x^2). #11737

Closed
sagetrac-lfousse mannequin opened this issue Aug 24, 2011 · 22 comments
Closed

"integrate" fails to integrate a convergent integral (sin(x^2)/x^2). #11737

sagetrac-lfousse mannequin opened this issue Aug 24, 2011 · 22 comments

Comments

@sagetrac-lfousse
Copy link
Mannequin

sagetrac-lfousse mannequin commented Aug 24, 2011

sage: N(integrate(sin(x^2)/(x^2), x, 1, infinity))
[...]
ValueError: Integral is divergent.

This worked fine until v4.5.3, fails from v4.6.1 onward.
The expected output (with Maxima 5.29.1) is:

0.285736646322858

Depends on #13364

Upstream: Fixed upstream, in a later stable release.

Component: calculus

Reviewer: Dmitrii Pasechnik, Karl-Dieter Crisman

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

@sagetrac-lfousse sagetrac-lfousse mannequin added this to the sage-5.6 milestone Aug 24, 2011
@sagetrac-lfousse sagetrac-lfousse mannequin assigned burcin Aug 24, 2011
@sagetrac-lfousse sagetrac-lfousse mannequin added the t: bug label Aug 24, 2011
@zimmermann6

This comment has been minimized.

@kcrisman
Copy link
Member

comment:3

This is in Maxima. In the latest:


(%i1) integrate(sin(x^2)/(x^2),x,1,inf);

defint: integral is divergent.

It used to just return the integral.


(%i1) integrate(sin(x^2)/(x^2),x,1,inf);
                                 inf
                                /         2
                                [    sin(x )
(%o1)                           I    ------- dx
                                ]       2
                                /      x
                                 1

I think this integral should converge, right? By the p-test (well, with absolute values) for p=2? And numerical_integral agrees with your thing. This is probably a bug in Maxima, I'll put it there.

@kcrisman
Copy link
Member

Upstream: Not yet reported upstream; Will do shortly.

@kcrisman
Copy link
Member

Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. Little or no feedback.

@kcrisman
Copy link
Member

comment:4

This is tracked at this Maxima bug artifact.

@sagetrac-lfousse
Copy link
Mannequin Author

sagetrac-lfousse mannequin commented Aug 24, 2011

comment:5

The absolute value of the function is dominated by 1/x^2, which is integrable on this particular interval.

@kcrisman
Copy link
Member

comment:6

You say potato, I say potahto :)

@zimmermann6
Copy link

comment:7

Karl-Dieter, please can you check the bug is fixed upstream? Laurent (Fousse) says it was caused by commit 59775311e53ef8a8fb5a3ad067a6c1cc153075d2 of maxima.

Paul

@kcrisman
Copy link
Member

kcrisman commented Dec 2, 2011

comment:8

As far as I can tell, it's not fixed upstream - I have 5.25.1. The bug report had a resolution but it was something where they apparently typed in the wrong integral.

I am ignorant of how to use git and I can't do a text search for that commit line, unfortunately, so I'll take Laurent's word for it. I've put that info on the bug tracker as well.

@zimmermann6
Copy link

comment:9

Laurent tested with both 5.24.0 and the last git maxima version (commit 01679c735de525a39fa1d893f9e1d9f86bd65f91) and he got:

    % ./maxima-local
    Maxima 5.25post/branch-5_25-base-231-g01679c7
    http://maxima.sourceforge.net
    using Lisp CLISP 2.49 (2010-07-07)
    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) integrate(sin(x^2)/(x^2),x,1,inf);
    defint: integral is divergent.
     -- an error. To debug this try: debugmode(true);

Please can you add this to the maxima bug tracker?

Paul

@kcrisman
Copy link
Member

kcrisman commented Dec 3, 2011

comment:10

Please can you add this to the maxima bug tracker?

I think that you may have missed the fact that I already did so in comment:4 three months ago. The person from Maxima who first looked at it must have tried something else incorrect, and I updated it yesterday with your information about the commit in question.

@kcrisman
Copy link
Member

comment:11

This is now fixed upstream.

(%i1) display2d:false;
(%o1) false
(%i2) float(integrate(sin(x^2)/(x^2),x,1,inf));
(%o2) -.1767766952966368*(.2733129188747918*%i-.5348723621187719)*%i
 +.1767766952966368*(-.2733129188747918*%i-.5348723621187719)*%i
 -.1767766952966368*(.2733129188747918*%i-.5348723621187719)
 -.1767766952966368*(-.2733129188747918*%i-.5348723621187719)
(%i3) integrate(sin(x^2)/(x^2),x,1,inf);
(%o3) %i*gamma_incomplete(-1/2,%i)/2^(5/2)
 -gamma_incomplete(-1/2,%i)/2^(5/2)-%i*gamma_incomplete(-1/2,-%i)/2^(5/2)
 -gamma_incomplete(-1/2,-%i)/2^(5/2)

@zimmermann6
Copy link

comment:12

Karl-Dieter, do you know in which release of Maxima this will be fixed?
Or is there a simple patch we can integrate in Sage?

Paul

@kcrisman
Copy link
Member

comment:13

It's in the latest stable release, 5.27.0. Probably it will be easiest to just upgrade.

@kcrisman
Copy link
Member

Changed upstream from Reported upstream. Little or no feedback. to Fixed upstream, in a later stable release.

@dimpase
Copy link
Member

dimpase commented Dec 29, 2012

comment:14

Both new Maxima and Wolfram Alpha give the value about 0.2857367, and not 0.28625044 (what you see in the ticket description). Changing the latter to reflect the reality.

@dimpase

This comment has been minimized.

@kcrisman
Copy link
Member

kcrisman commented Jan 3, 2013

Reviewer: Dmitrii Pasechnik

@kcrisman
Copy link
Member

kcrisman commented Jan 3, 2013

comment:15

This is fixed (and doctested) at #13364.

@kcrisman
Copy link
Member

kcrisman commented Jan 3, 2013

Changed reviewer from Dmitrii Pasechnik to Dmitrii Pasechnik, Karl-Dieter Crisman

@kcrisman kcrisman removed this from the sage-5.6 milestone Jan 3, 2013
@jdemeyer
Copy link

Dependencies: #13364

@rwst
Copy link

rwst commented Aug 9, 2014

comment:19

Replying to @dimpase:

Both new Maxima and Wolfram Alpha give the value about 0.2857367, and not 0.28625044 (what you see in the ticket description). Changing the latter to reflect the reality.

The value was still off in the last digit given in the test. Fixed in #16697

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

6 participants