# How to integrate $e^{2x^2}\cos x$

I'm stuck on how to integrate the following: $$e^{2x^2}\cos x$$ I tried integration by parts twice but it doesn't make it any simpler. Is there something I am missing?

• I'm fairly certain this cannot be expressed in terms of elementary functions unless you consider $\operatorname{erf}(x)=\int_{0}^{x}e^{-x^2}\text{d}x$ to be an elementary function. – Teh Rod Apr 4 '17 at 12:47
• This is hard to parse. do you mean $e^{2x^2}\cos\,x$? – lulu Apr 4 '17 at 12:48
• Yeah that was what I meant – Sarah Apr 4 '17 at 12:57
• @TehRod. To me, it is always a question. What is the limit of elementary functions ? – Claude Leibovici Apr 4 '17 at 13:11
• @ClaudeLeibovici Upon a brief Wikipedia read $\operatorname{erf}(x)$ is not an elementary function – Teh Rod Apr 4 '17 at 13:13

Consider $$I=\int e^{2 x^2} \cos (x)\,dx=\frac 12\int e^{2 x^2}(e^{ix}+e^{-ix})\,dx=\frac 12\int e^{2 x^2+ix}\,dx+\frac 12\int e^{2 x^2-ix}\,dx$$
Now, complete the square $$2x^2+ix=2\left(x^2+\frac i2x\right)=2\left(\left(x+\frac i4\right)^2-\frac{i^2}{16}\right)=2\left(x+\frac i4\right)^2+\frac 18$$ So change variable $$\sqrt 2\left(x+\frac i4\right)=t$$ and you will end with a rather "classical" integral.