Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]).

share|improve this question
possible duplicate of Incorrect result from Integrate – DumpsterDoofus Aug 12 '14 at 16:02
Actually, I asked this exact question last year! It's a bug, according to Daniel Lichtblau. See link above. – DumpsterDoofus Aug 12 '14 at 16:03
@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. – leopold.talirz Aug 12 '14 at 16:45
Ah, you're right, this is different. – DumpsterDoofus Aug 12 '14 at 16:46
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). – Daniel Lichtblau Aug 12 '14 at 19:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.