Bug introduced in 9.0 and persisting through 11.0.1 or later

I would like to convolute the inverse square root on the interval [0,inf] with a Gaussian function, like so:

f[x_] := 1/Sqrt[x]
g[x_, sigma_] := Exp[-x^2/(2 sigma^2)]
conv[x_, sigma_] := Integrate[f[y] g[x - y, sigma], {y, 0, \[Infinity]}, Assumptions -> {sigma > 0}]

The result from Mathematica (9) reads

Exp[-x^2/(4 sigma^2)] Sqrt[-x] BesselK[1/4, x^2/(4 sigma^2)]/Sqrt[2]

which is purely imaginary for x>0.

This is certainly not the answer to the question I had in mind, which should be a positive real-valued function for all real-valued x (correct?).

Please tell me what is going wrong and (if possible) what I need to change to get the result I am looking for.

P.S. Adding assumptions like x>0 also doesn't seem to help (it simply will replace Sqrt[-x] by I Sqrt[x]).

  • $\begingroup$ possible duplicate of Incorrect result from Integrate $\endgroup$ – DumpsterDoofus Aug 12 '14 at 16:02
  • $\begingroup$ Actually, I asked this exact question last year! It's a bug, according to Daniel Lichtblau. See link above. $\endgroup$ – DumpsterDoofus Aug 12 '14 at 16:03
  • $\begingroup$ @DumpsterDoofus It is indeed almost identical, except for the fact that here I am using the inverse square root. In the answer given to your question the assumption n>0 needs to be removed, then it seems to provide the correct result also here. $\endgroup$ – leopold.talirz Aug 12 '14 at 16:45
  • $\begingroup$ Ah, you're right, this is different. $\endgroup$ – DumpsterDoofus Aug 12 '14 at 16:46
  • 3
    $\begingroup$ It's a bug, which I will report. If you use x^e instead of 1/Sqrt[x], specify e>-1, and substitute e->-1/2 at the end, you might get a more reliable result (at least it worked for a simpler case that has the same problem). $\endgroup$ – Daniel Lichtblau Aug 12 '14 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.