# Integral involving error function

Could someone help me in evaluating this integral please? :

$$\int_{0}^x t^2\exp(-t^2) dt$$

I spliced the integrand into $t\cdot t\cdot \exp(-t^2)$ then doing integral by parts I arrived to $-\frac{x}{2}\exp(-x^2)+\frac{1}{2}\text{erf}(x)$

But in my problem set the result is given by $-\frac{x}{2}\exp(-x^2) + \frac{\sqrt{\pi}}{4}\text{erf}(x)$

• The usual definition is $\text{erf}(x)=\frac{2}{\sqrt{\pi}}\int_0^x \exp(-t^2)dt$ Commented Dec 5, 2016 at 20:29
Rewriting the given integral, we have \begin{align*} \int_{0}^x t^2 e^{-t^2} \;\mathrm{d}t & = -\frac{1}{2}\int_{0}^x t \;\mathrm{d}\left(e^{-t^2}\right) \\ & = -\frac{1}{2}\left\{\left[t e^{-t^2}\right]\Bigg{|}_{0}^x - \int_{0}^x e^{-t^2} \; \mathrm{d}t\right\} \\ & = -\frac{x}{2}e^{-x^2}+\frac{1}{2}\int_{0}^x e^{-t^2} \; \mathrm{d}t \\ & = -\frac{x}{2}e^{-x^2}+\frac{1}{2} \times \frac{\sqrt{\pi}}{2}\operatorname{erf}(x) \\ & = \frac{x}{2}e^{-x^2} + \frac{\sqrt{\pi}}{4}\operatorname{erf}(x). \end{align*}