Ticket #11737 (closed defect: fixed)
"integrate" fails to integrate a convergent integral (sin(x^2)/x^2).
| Reported by: | lfousse | Owned by: | burcin |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
| Component: | calculus | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Fixed upstream, in a later stable release. | Reviewers: | Dmitrii Pasechnik, Karl-Dieter Crisman |
| Authors: | Merged in: | ||
| Dependencies: | #13364 | Stopgaps: |
Description (last modified by dimpase) (diff)
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
Change History
comment:3 Changed 21 months ago by kcrisman
- Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.
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.
comment:4 Changed 21 months ago by kcrisman
- Report Upstream changed from Not yet reported upstream; Will do shortly. to Reported upstream. Little or no feedback.
This is tracked at this Maxima bug artifact.
comment:5 Changed 21 months ago by lfousse
The absolute value of the function is dominated by 1/x^2, which is integrable on this particular interval.
comment:7 Changed 18 months ago by zimmerma
Karl-Dieter, please can you check the bug is fixed upstream? Laurent (Fousse) says it was caused by commit 59775311e53ef8a8fb5a3ad067a6c1cc153075d2 of maxima.
Paul
comment:8 Changed 18 months ago by kcrisman
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.
comment:9 follow-up: ↓ 10 Changed 18 months ago by zimmerma
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
comment:10 in reply to: ↑ 9 Changed 18 months ago by kcrisman
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.
comment:11 Changed 12 months ago by kcrisman
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)
comment:12 Changed 12 months ago by zimmerma
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
comment:13 Changed 12 months ago by kcrisman
- Report Upstream changed from Reported upstream. Little or no feedback. to Fixed upstream, in a later stable release.
It's in the latest stable release, 5.27.0. Probably it will be easiest to just upgrade.
comment:14 Changed 5 months ago by dimpase
- Description modified (diff)
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.
comment:15 Changed 5 months ago by kcrisman
- Status changed from new to needs_review
- Reviewers set to Dmitrii Pasechnik
This is fixed (and doctested) at #13364.
comment:16 Changed 5 months ago by kcrisman
- Status changed from needs_review to positive_review
- Reviewers changed from Dmitrii Pasechnik to Dmitrii Pasechnik, Karl-Dieter Crisman
- Milestone changed from sage-5.6 to sage-duplicate/invalid/wontfix
comment:18 Changed 4 months ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed
