TITLE: Evaluate $\int x^2e^{x^2} dx$
QUESTION [6 upvotes]: Evaluate $\displaystyle\int x^2e^{x^2} dx$
Try($1$)(integral by parts)(unsuccessful)
$$\displaystyle\int x^2e^{x^2}dx=x^2\left(\int e^{x^2} dx\right)-2\int x\left(\int e^{x^2} dx\right)dx$$
I don't know how to calculate $\left(\displaystyle\int e^{x^2} dx\right)$, as well.
Try($2$)(integral by parts)(unsuccessful)
$$\displaystyle\int x^2e^{x^2}dx=e^{x^2}x^3/3-2/3\int x^4e^{x^2}dx $$$$\rightarrow$$$$\int x^4e^{x^2}dx=x^5e^{x^2}/5-2/5\int x^6e^{x^2}dx$$$$\vdots$$
Try($3$)(Integration by substitution)(unsuccessful)
$$x=\sqrt t$$$$\displaystyle\int x^2e^{x^2}dx=1/2\int \sqrt t\;e^t\; dt$$
Let's apply "integral by parts"
$$\int \sqrt t\;e^t\; dt=\sqrt t\;e^t-1/2\int\dfrac{e^t}{\sqrt t}dt$$$$\vdots$$
Try($4$)(Integration by substitution(trigonometric))(unsuccessful)
$$x=\sin u$$
$$\displaystyle\int x^2e^{x^2}dx=\int e^{\sin^2 u}\sin^2 u\cos u du$$

REPLY [4 votes]: There is not an elementary antiderivative, but you can use a special function to find an antiderivative.
After integration by part you get :
$$\dfrac{x\mathrm{e}^{x^2}}{2}-{\displaystyle\int}\dfrac{\mathrm{e}^{x^2}}{2}\,\mathrm{d}x$$
Now you will need to use the  imaginary error function.
$${\displaystyle\int}\dfrac{\mathrm{e}^{x^2}}{2}\,\mathrm{d}x=\class{steps-node}{\cssId{steps-node-1}{\dfrac{\sqrt{{\pi}}}{4}}}{\displaystyle\int}\dfrac{2\mathrm{e}^{x^2}}{\sqrt{{\pi}}}\,\mathrm{d}x=\dfrac{\sqrt{{\pi}}\operatorname{erfi}\left(x\right)}{4}$$
 Now you can finish easily.