# How to deal with the integral of $e^x e^{x^2}$?

I'm struggling with the integral

$$\int e^x e^{x^2} \mathrm{d}x$$

how can you possibly integrate that?

• Indefinite? definite? – tilper Jan 27 '17 at 18:46
• Maybe you mean $(e^x)^2$ which is much easier. – MathematicsStudent1122 Jan 27 '17 at 19:01
• @MathematicsStudent1122 I don't really think that he meant that... – Von Neumann Jan 27 '17 at 19:02

If you want to integrate $e^x \cdot e^{x^2}$ over all of $\Bbb R$, then you can complete the square. First:

$$e^x \cdot e^{x^2} = e^{x + x^2}$$

Then:

$$x + x^2 = \left(x + \frac12\right)^2 - \frac14$$

Therefore: $$e^x \cdot e^{x^2} = e^{\left(x+\frac12\right)^2 - \frac14} = e^{\left(x+\frac12\right)^2} e^{-\frac14}$$

And so:

$$\int_{\Bbb R} e^x \cdot e^{x^2} \, dx = \int_{\Bbb R} e^{\left(x+\frac12\right)^2} e^{-\frac14} \, dx$$

$e^{-1/4}$ is just a constant. Factor it out, then use substitution and a well-known formula to handle the rest.

• @AlanTuring, I did study your answer. You refer to the imaginary error function and then you provide a link with information about it. In that link it says $\displaystyle\operatorname{erfi}(x) = \dfrac2{\sqrt{\pi}} \int_0^x e^{t^2} \, dt$. So, I ask again, why it is not ok to for me to assume $\displaystyle\int_{-\infty}^{+\infty}$ even if I explicitly state it, but it is ok for you to assume $\displaystyle\int_0^x$ when (at the time) you didn't explicitly state it? – tilper Jan 27 '17 at 19:24
• Would the second downvoter mind explaining? – tilper Jan 28 '17 at 1:13
• I downvoted. This doesn't answer the question. When a question asks to "integrate a function" and no bounds are specified, that's generally taken to mean "find the antiderivative (+$C$) for that function". – MathematicsStudent1122 Jan 28 '17 at 1:34
• @MathematicsStudent1122, please read the edit history on the question. OP was unclear about whether the integral was definite or not. The indefinite integral is an assumption made by an editor. – tilper Jan 28 '17 at 1:42

It's not a trivial integral, if its limits are undefined.

I mean: if you know a bit about special functions, then it's trivial because its result is in the form of the Imaginary Error Function, and it is:

$$\int e^x e^{x^2}\ \text{d}x = \frac{\sqrt{\pi } \text{erfi}\left(x+\frac{1}{2}\right)}{2 \sqrt{e}} + C$$

I'll write some detail later.

More on error function:

https://en.wikipedia.org/wiki/Error_function

• I've never really liked using the error function as an "answer" to these, because the error function is basically defined to be an integral of $\exp(-x^2)$ - so the answer is basically a definition massaged in the right way. – Cameron Williams Jan 27 '17 at 19:06
• The integral is undefined, hence this answer is the most correct one. I know that is a quite circular thing, but as long as we don't have limits in the integral... – Von Neumann Jan 27 '17 at 19:07
• Yeah that's fair. It's just a personal opinion. Same goes for the W function with me. – Cameron Williams Jan 27 '17 at 19:11
• This is clearly the better answer. Don't understand the downvotes. – MathematicsStudent1122 Jan 27 '17 at 22:31
• @MathematicsStudent1122 Don't worry, I'm used to random people who randomly dowvote just because. The down vote problem is a frequent problem over here. Down votes shall be applied for wrong answers or bad and useless one. This is not. Maybe is not the best one but it's correct. Anyway, still :) Thank you for your appreciation nay! – Von Neumann Jan 27 '17 at 22:33