1
|
13146 Views
|
11 Replies
|
7 Total Likes
View groups...
Share
GROUPS:

# Definite integral of gaussian times sqare root of x gives wrong result

Posted 9 years ago
 Definite integrals of the type gaussian distribution times sqare root of x from 0 to inf give imaginary results whereas the functions are real valued in this interval. int [sqrt(x)*exp(-(x-1)**2),x,0,inf] ? -0.07..i int [x**(-1/2)*exp(-(x-1)**2),x,0,inf] ? 0.4..i  By the way I would love to know the correct symbolic integral but not only does wolfram alpha struggle but maxima and me as well. Edit: I was not specific in that I would like to know the symbolic integral.
11 Replies
Sort By:
Posted 9 years ago
 OK thank you all - the conclusion is: The bug is known and fixed, just not in the version we were using.For future reference the solution is: int [ exp(-(x-m)**2/s)/sqrt(x) , {x,0,inf}] = pi/2 * ( BesselI(1/4,m**2/(2*s))+BesselI(-1/4,m**2/(2*s)) ) * sqrt(m) * exp( - m**2/(2*s)) 
Posted 9 years ago
 I had no such expectations. I was just hopeful/naïve that requesting the indefinite integral might provide more information. (And it did ... in a way.)
Posted 9 years ago
 Oh, I see now. The incorrect result in Wolfram|Alpha is computed (by Integrate) in Mathematica version 9, while the correct approximate answers seem to use NIntegrate. The issue has been resolved in later versions of Mathematica, and hopefully Alpha will catch up soon.
Posted 9 years ago
 But I don't think it's completely fixed in Mathematica 10.0.2 (Windows): In:= \!$$\*SubsuperscriptBox[\(\[Integral]$$, $$0$$, $$\[Infinity]$$]$$\*FractionBox[\(1$$, $$\*SqrtBox[\(x$$] Exp[$$(x - 1)$$^2]\)] \[DifferentialD]x\)\) Out= (I BesselK[1/4, 1/2])/Sqrt[2 E] This does not give a real result.
Posted 9 years ago
 Some day... In:= i1 = Integrate[1/(Sqrt[x]*Exp[(x - 1)^2]), {x, 0, Infinity}] N[i1] Out= (\[Pi] (BesselI[-(1/4), 1/2] + BesselI[1/4, 1/2]))/(2 Sqrt[E]) Out= 1.97373215009 So it seems to be repaired in what will become the next released version.
Posted 9 years ago
 The second example has also been fixed in the current development version and release candidates. In:= int2 = Integrate[(1/Sqrt[x]) Exp[-(x - 1)^2], {x, 0, Infinity}] Out= (\[Pi] (BesselI[-(1/4), 1/2] + BesselI[1/4, 1/2]))/(2 Sqrt[E]) In:= N[int2, 50] Out= 1.9737321500898237789841487512373971273398502283395 
Posted 9 years ago
 Why would you expect the indefinite integral to have a closed form? In:= int = Integrate[Sqrt[x] Exp[-(x - 1)^2], {x, 0, Infinity}] Out= (Gamma[3/4] Hypergeometric1F1[3/4, 1/2, 1] + 2 Gamma[5/4] Hypergeometric1F1[5/4, 3/2, 1])/(2 E) In:= N[int, 50] Out= 1.6436165407874952730553651165549411806023882736885 
Posted 9 years ago
 I get the same thing - the numerical integration is fine, but the symbolic integration seems to be broken.
Posted 9 years ago
 It is curious. If I enter the indefinite integral into Wolfram Alpha Integrate[Sqrt[x] Exp[-(x - 1)^2]] I get the following output: I am hoping for an enlightening answer from Daniel Lichtblau.
Posted 9 years ago
 Thanks for your reply,I know that you can compute the numeric integral which is real and positive. But this is sadly not satisfactory: It highlights even more that there is an error I wold like to know the symbolic integral
Posted 9 years ago
 I don't know the syntax for Wolfram Alpha but in Mathematica: In:= NIntegrate[Sqrt[x] Exp[-(x - 1)^2], {x, 0, Infinity}] NIntegrate[x^(-1/2)*Exp[-(x - 1)^2], {x, 0, Infinity}] Out= 1.64362 Out= 1.97373 Added comment: I just now entered your equation into Wolfram Alpha and it does recognize your formula as you intended. Sorry, don't know what to say.