# Hard integral that standard CAS get totally wrong

How to solve the following integral:

$$\int_{-\infty }^{\infty }\exp \left ( i\left ( ax^3+bx^2 \right ) \right )dx$$

Standard CAS seem to get it totally wrong, see: http://www.walkingrandomly.com/?p=5031

So what is the right ansatz and solution?

EDIT
There seems to be a problem with the way this question is posed... which I quite frankly don't get. To clarify I posted this follow-up question:
In which senses can an integral exist?

-
@Did: No need to downvote the question. Sorry, but I don't get it. What do you mean by "in what sense"? I have never seen this question posed when somebody asked a question about the value of an integral. Please reconsider downvoting - Thank you. – vonjd Jul 31 '13 at 15:30
You are asking to compute the value of a divergent integral. When asked to explain this conundrum, you evade it. Hence: "Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking." Do you get it now? – Did Jul 31 '13 at 15:38
Because I still don't know what the problem with this question might be, I posted a follow-up question: math.stackexchange.com/questions/456506/… – vonjd Jul 31 '13 at 15:44
See the definition of integrability. A function $f \, : \, \mathbb{R} \, \rightarrow \, \mathbb{C}$ is integrable on $\mathbb{R}$ if $\int_{\mathbb{R}} \vert f(x) \vert \: dx$ is finite. – jibounet Jul 31 '13 at 15:55
The most common usage of $\int_{-\infty}^{\infty}$ is for Riemann improper integral, not Lebesgue integral. The integral at hand is perfect fine and exists as a Riemann improper integral. – achille hui Jul 31 '13 at 16:09

The integral is slightly undefined in much the same way that the much simpler integral $$\int_{-\infty}^{\infty} e^{i a x}\,dx = 2\pi\delta(a)$$ is defined only in the sense of being a distribution.
To evaluate it in some acceptable sense, denote it by $I$ and write $$I = \int e^{i a x^3+i b x^2}\,dx = \int_0^\infty e^{i b x^2}(e^{i a x^3} + e^{-i a x^3})\,dx.$$ Consider the integral $$J(a) = \int_0^\infty e^{i a x^3 + i b x^2}\,dx,$$ and let $a$ have a positive imaginary part, which makes $J$ converge. Now expanding $e^{i b x^2}$ in power series and using a CAS to evaluate the integrals we can get $$J(a) = \sum_{n\geq0} \frac{(i b)^n}{n!} \int_0^\infty x^{2n}e^{i a x^3}\,dx = \sum_{n\geq0}\frac{(ib)^n}{n!}\frac{(-i a)^{-(1+2n)/3}}{3}\Gamma\left(\frac{1+2n}{3}\right).$$ The second integral making up $I$ has $-a$, so we can evaluate $J(-a)$ by letting $a$ have a negative imaginary part. All this leads to $$I = \sum_{n\geq0} \frac{(i b)^n}{n!}\frac{2}{3|a|^{(1+2n)/3}}\Gamma((1+2n)/3)\cos\left(\frac{(1+2n)\pi}{6}\right),$$ which evaluates to $$I = \frac{2\pi}{3^{1/3}|a|^{1/3}}e^{\frac{2i}{27}b^3/a^2}\mathop{\text{Ai}}\left(-\frac{b^2}{3^{4/3}|a|^{4/3}}\right),$$ where $\text{Ai}$ is an Airy function.
Just a small comment. If we forget for a while about convergence and well-definedness issues, then, making a linear change of variables $x=at+b$, we can achieve something like $it^3+\alpha t$ in the exponential (i.e. to trade quadratic term for a linear one). But then this is nothing but the integral representation of Airy functions. I hope this makes their appearance less misterious. – Start wearing purple Jul 31 '13 at 19:33