Skip to main content
7 of 9
same result in version 7 under Windows
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

Why does Mathematica report that $\int_1^\infty\frac{\sin(\sqrt{x})}{\sqrt{x}}dx$ = $2\cos(1)$?

Bug introduced in 7.0 or earlier and persisting through 10.3.1 or later


Mathematica 10 gives the following very odd result,

Integrate[Sin[Sqrt[x]]/Sqrt[x], {x, 1, ∞}]
(* 2 Cos[1] *)

which seems unintuitive. The integrand has an easy to find antiderivative,

Integrate[Sin[Sqrt[x]]/Sqrt[x], x]
(* -2 Cos[Sqrt[x]] *)

When we evaluate this at the limits of integration, nothing surprising,

Function[x, -2 Cos[Sqrt[x]]] /@ {∞, 1}
(* {Interval[{-2, 2}], -2 Cos[1]} *)

And it isn't that Mathematica can't handle the difference between an Interval object and a number,

Differences@%
(* {Interval[{-2 - 2 Cos[1], 2 - 2 Cos[1]}]} *)

So why does it seem so confident that the answer is 2 Cos[1]?

Edit

We can even go further to see that this is wrong by making the substitution $u^2=x$ ($2u \mathrm{d}u=\mathrm{d}x$)

Integrate[2*u*(Sin[u]/u), {u, 1, Infinity}]

During evaluation of Integrate::idiv:Integral of Sin[u] does not converge on {1,∞}. >>

(* Integrate[2*Sin[u], {u, 1, Infinity}] *)

And just to drive this home even further, we try with NIntegrate, which after spitting out error messages gives an answer on the order of $10^{114}$

JEM
  • 1.2k
  • 6
  • 15