## #2258 sin(x^2)/(x^2) improper integral incorrect?

closed
5
2011-12-20
2011-08-24
Anonymous
No

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

defint: integral is divergent.

This used to just return the integral as a nounform. Numerical approximation says it's about 0.2862504407259549. Thanks!

## Discussion

• Raymond Toy - 2011-08-24

What version are you using? The current version returns

-%i*gamma_incomplete(-1,2*%i)/2+%i*gamma_incomplete(-1,-2*%i)/2+1/2

This is approximately .6734567682657728. quad_qagi also says the integral is approximately 0.67335.

Marking this as pending/worksforme

• Raymond Toy - 2011-08-24
• status: open --> pending

• Comment has been marked as spam.
Undo

You can see all pending comments posted by this user  here

Anonymous - 2011-12-02

I was using 5.25.0.

And

***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC.
***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED
* ABNORMAL RETURN
* ERROR NUMBER = 1
*
***END OF MESSAGE

(%o3) [.2852680980196833, .007186678748743569, 5985, 1]

And Wolfram Alpha gives, for input

integrate(sin(x^2)/x^2,x,1,inf)

sqrt(pi/2) (1-2 C(sqrt(2/pi)))+sin(1)~~0.285737

where C is a Fresnel integral.

• Comment has been marked as spam.
Undo

You can see all pending comments posted by this user  here

Anonymous - 2011-12-02
• status: pending --> open

• Comment has been marked as spam.
Undo

You can see all pending comments posted by this user  here

Anonymous - 2011-12-02

According to Laurent Fousse, it was caused by commit 59775311e53ef8a8fb5a3ad067a6c1cc153075d2 (see http://trac.sagemath.org/sage_trac/ticket/11737\)

• Dan Gildea - 2011-12-04

Seems to be caused by the following problem with limit:

(%i2) limit( gamma_incomplete(-1/2, -%i*x^2), x, inf);
(%o2) gamma_incomplete(-1/2,infinity)

• Dan Gildea - 2011-12-20
• assigned_to: nobody --> dgildea
• status: open --> closed

• Dan Gildea - 2011-12-20

Fixed by adding case for complex infinity to
routine simplim%gamma_incomplete in gamma.lisp.

(%i2) limit( gamma_incomplete(-1/2, -%i*x^2), x, inf);
(%o2) 0
(%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)
(%i4) float(%);
(%o4) -.1767766952966368*(.2733129188747918*%i-.5348723621187728)*%i
+.1767766952966368*(-.2733129188747918*%i-.5348723621187728)*%i
-.1767766952966368*(.2733129188747918*%i-.5348723621187728)
-.1767766952966368*(-.2733129188747918*%i-.5348723621187728)
(%i5) rectform(%);
(%o5) .2857366463228523