Skip to main content

calculus and analysis - Strange behaviour of integrals with Cos, Sin, and Exp


Bug introduced in 8.0.4 or earlier and persisting through 11.0.1




During the study of the problem How to solve this integration? I have discovered a strange behaviour of some integrals.


I would consider it a bug.


$Version

(* Out[39]= "10.1.0 for Microsoft Windows (64-bit) (March 24, 2015)" *)


Consider these integrals


c = 
Integrate[E^-Sqrt[u/2] Cos[ Sqrt[u/2] - u z], {u, 0, ∞}, Assumptions -> {z > 0}]

(*
Out[34]= (E^(-(1/4)/z) Sqrt[π])/(2 z^(3/2))
*)

s =
Integrate[E^-Sqrt[u/2] Sin[ Sqrt[u/2] - u z], {u, 0, ∞}, Assumptions -> {z > 0}]


(*
Out[35]= -(1/z) + (E^(-(1/4)/z) Sqrt[π] Erfi[1/(2 Sqrt[z])])/(2 z^(3/2))
*)

Now form cs = c + I s which can be written, using Euler's fomula, as


cs = 
Integrate[E^-Sqrt[u/2] Exp[I (Sqrt[u/2] - u z)], {u, 0, ∞},
Assumptions -> {z > 0}] (* wrong *)


(*
Out[36]= (I (-Sqrt[z] + DawsonF[1/(2 Sqrt[z])]))/z^(3/2)
*)

FunctionExpand[%]

(*
Out[4]= (I (-Sqrt[z] + 1/2 E^(-(1/4)/z) Sqrt[π] Erfi[1/(2 Sqrt[z])]))/z^(3/2)
*)


But this result is wrong because it "forgets" the real part and gives only the imaginary part I s. The same happens with the assumptions of real z.


Dropping the assumptions completely we get the result


Integrate[E^-Sqrt[u/2] Exp[I (Sqrt[u/2] - u z)], {u, 0, ∞}]

(*
Out[38]=
ConditionalExpression[
-(I/z) + (E^(-(1/4)/z) Sqrt[π] (1 + I Erfi[1/(2 Sqrt[z])]))/(2 z^(3/2)),
Im[z] < 0]
*)


which is correct only if we neglect the generated condition.




Comments