# Have I found a bug in Integrate?

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:
http://www.walkingrandomly.com/?p=5031

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

• 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.gates.you.know.what 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

## 2 Answers

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.

• Moreover the complex exponential route has trouble in Slater convolution when it hits things like Exp[2*Log[Ia]], which it cannot discern from Exp[2*Log[-Ia]] (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

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