# What is the integral of int (x^2)*e^(x^2) dx ?

Sep 24, 2016

$\frac{1}{2} x {e}^{{x}^{2}} - \frac{\sqrt{\pi}}{4} \text{erfi} \left(x\right)$

#### Explanation:

$\frac{d}{\mathrm{dx}} \left(x {e}^{{x}^{2}}\right) = 2 {x}^{2} {e}^{{x}^{2}} + {e}^{{x}^{2}}$

then

$\int {x}^{2} {e}^{{x}^{2}} \mathrm{dx} = \frac{1}{2} \left(x {e}^{{x}^{2}} - \int {e}^{{x}^{2}} \mathrm{dx}\right)$

but $\text{erfi} \left(x\right) = \frac{2}{\sqrt{\pi}} {\int}_{0}^{x} {e}^{{x}^{2}} \mathrm{dx}$ so

$\int {x}^{2} {e}^{{x}^{2}} \mathrm{dx} = \frac{1}{2} x {e}^{{x}^{2}} - \frac{\sqrt{\pi}}{4} \text{erfi} \left(x\right)$

NOTE:

$\text{erfi} \left(x\right)$ or error function is defined as

$\text{erfi} \left(x\right) = \frac{2}{\sqrt{\pi}} {\int}_{0}^{x} {e}^{- {\xi}^{2}} d \xi$