0

I have the following code in Mathematica 9.0

In[8]:= funkcja[a_] =Integrate[Sqrt[z]*1/Sqrt[2*Pi] Exp[-((z - a)^2/2)], {z, 0,Infinity}]    

Out[8]= (E^(-(a^2/4)) Sqrt[\[Pi]/2] (-a^2 BesselI[-(1/4), a^2/4] + (2 + a^2) BesselI[
 1/4, a^2/4] + a^2 (-BesselI[3/4, a^2/4] + BesselI[5/4, a^2/4])))/(4 Sqrt[-a])    

In[9]:= Assuming[Element[a, Reals], Simplify[funkcja[a]]]    

Out[9]= (E^(-(a^2/4)) Sqrt[\[Pi]/2] (-a^2 BesselI[-(1/4), a^2/4] + (2 + a^2) BesselI[
 1/4, a^2/4] + a^2 (-BesselI[3/4, a^2/4] + BesselI[5/4, a^2/4])))/(4 Sqrt[-a])   

In[11]:= funkcja[1.0]    

Out[11]= 0. - 0.104154 I        

Could anyone explain me why this formula produce a complex number? Integration is over real domain and also I demand for a to be Real.

Darek
  • 1
  • 2
  • Tottaly off-topic: it's amazing how I can understand programming and algorithms, but totally hate mathematics and/or mathematical expressions. On-Topic: Have you tried to reproduce the results using some other tools like math-lab or some programming language? In other terms, it might not be Mathematica 9.0 's fault... it can very be a typo or something like this? I dk.. I'm just saying – Ares Draguna Oct 30 '14 at 15:03
  • This might be off-topic for Stack Overflow. It may need to be posted here: https://mathematica.stackexchange.com/. – Jeff B Oct 30 '14 at 15:11

0 Answers0