Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The following command gives 0 in Mathematica 9.0.1.

f[a_, b_] := Exp[I*(a*x^3 + b*x^2)];
Integrate[f[a, b], {x, -Infinity, Infinity}, Assumptions -> {a > 0, Element[b,Reals]}]

This seems to be wrong, see the following article:

Is this really a bug and if yes, is it known (is it perhaps even some instance of a bigger problem)?

share|improve this question
I get the same, but a simple rescaling gives a sensible result : int[p_, c_] = p Integrate[Exp[I*( x^3 + c*x^2)], {x, -Infinity, Infinity}, Assumptions -> {c \[Element] Reals}]. For instance, int[1/a^(1/3), b/a^(2/3)] /. {a -> 1/3, b -> 1} // N checks with the result in the link. –  b.gatessucks Jul 31 '13 at 14:39
Please don't use the bugs tag initially; it is meant to be added only once a consensus has been reached or a bug is recognized by WRI. –  Mr.Wizard Jul 31 '13 at 15:58
No problem. :-) –  Mr.Wizard Jul 31 '13 at 16:00
Looks like a clear bug to me. –  Jens Jul 31 '13 at 17:50
Have put in place a provisional fix. Now hoping nothing breaks as a result of that-- would be nice for the fix to survive until the next release. –  Daniel Lichtblau Aug 1 '13 at 2:50
show 2 more comments

2 Answers

up vote 9 down vote accepted

It appears that you can work around this problem by using ExpToTrig to rewrite your expression. That is, this produces a result that seems to check out:

f[a_, b_] := Exp[I*(a*x^3 + b*x^2)];
result = Integrate[ExpToTrig[f[a, b]], {x, -Infinity, Infinity}, 
Assumptions -> {a > 0, b  \[Element] Reals}]

Evaluating this returns:

(2 E^((2 I b^3)/(27 a^2)) \[Pi] Abs[b] (BesselJ[-(1/3), (2 Abs[b]^3)/(27 a^2)] + BesselJ[1/3, (2 Abs[b]^3)/(27 a^2)]))/(9 a)

Let's check the result at one spot in the parameter space:

result /. {a -> 21, b -> 1/3} // N

0.560793 + 3.48872*10^-6 I

This seems to check out:

NIntegrate[f[21, 1/3], {x, -Infinity, Infinity}]

0.560793 + 3.48872*10^-6 I

Given the above results, I think that is is pretty clear that the original result from Integrate (without TrigToExp) is not correct.

share|improve this answer
Moreover the complex exponential route has trouble in Slater convolution when it hits things like Exp[2*Log[I*a]], which it cannot discern from Exp[2*Log[-I*a]] (both show up because we integrate from -infinity to zero by negating and going 0 to infinity). An effort is made to unravel such things, but apparently this is not always getting it correct. –  Daniel Lichtblau Aug 1 '13 at 2:54
add comment

It looks like a bug to me because the zero result implies the integral is identically zero under the assumptions, but

With[{a = 1, b = 1}, Integrate[f[a, b], {x, -Infinity, Infinity}]]

which clearly satisfies the assumptions, gives

(2 E^((2 I)/27) \[Pi] AiryAi[-(1/(3 3^(1/3)))])/3^(1/3)

and has the numerical value of

1.79889 + 0.133495 I

share|improve this answer
add comment

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.