# Integration of Erf function

Let $f(x) = \int^\sqrt{x}_1 e^{-t^2}dt$. Find $\int^1_0 \frac{f(x)}{ \sqrt{x}}dx$.

Could anyone give me any hint how to start? The Erf function $f(x)$ seems not to be easily integrated.

• There is a document titled "A table of integrals of the error functions" by edward W. Ng and Murrey Geller. I think that could be helpful to you. – Frank Moses Nov 8 '16 at 0:56
• The answer, as a side note, is $\frac{1}{e}-1$ according to 1 minute of using Wolfram Alpha – Brevan Ellefsen Nov 8 '16 at 0:57
• @FrankMoses This is a test question so I could not possibly refer to any docimentation. – user122049 Nov 8 '16 at 0:57
• Try integration by parts and apply fundamental theorem of calculus. – ℵ_ϵ Nov 8 '16 at 0:57
• As Brevan Ellefsen found, the result is $1/e -1$, according to Mathematica. – David G. Stork Nov 8 '16 at 0:58

You want to find
$$\int_0^1\frac{\int_1^{\sqrt{x}}e^{-t^2}dt}{\sqrt{x}}dx=\int_0^1\frac{f(x)}{\sqrt{x}}dx$$
This should SCREAM integration by parts, as we somehow want to differentiate the numerator. Let's try it. We note that $u' = \frac{e^{-x}}{2\sqrt{x}}$ and $v=2\sqrt{x}$ $$=2\sqrt{x}f(x)\bigg|_0^1 -\int_0^1 \frac{e^{-x}2\sqrt{x}}{2\sqrt{x}}$$ $$=2f(1) -\int_0^1 \frac{e^{-x}2\sqrt{x}}{2\sqrt{x}}$$ $$=\left(2\int_1^{1}e^{-t^2}dt\right) -\int_0^1 e^{-x}$$ $$=\frac{1}{e}-1$$

• All too easy .... +1 – Mark Viola Nov 8 '16 at 2:39

Brevan Ellefsen's solution is the most straightforward and efficient. Here is an alternative solution.

$$f(x) = \int\limits_{1}^{\sqrt{x}} \mathrm{e}^{-t^{2}} dt \label{eq:161108-1} \tag{1}$$ $$\int\limits_{0}^{1} \frac{f(x)}{\sqrt{x}} dx \label{eq:161108-2} \tag{2}$$

We need the following result $$\int \mathrm{erf}(x) dx = x\,\mathrm{erf}(x) + \frac{\mathrm{e}^{-x^{2}}}{\sqrt{\pi}} \label{eq:161108-3} \tag{3}$$ Proof: Integrate by parts \begin{align} \int \mathrm{erf}(x) dx &= x\,\mathrm{erf}(x) -\frac{2}{\sqrt{\pi}} \int x\,\mathrm{e}^{-x^{2}} dx \\ &= x\,\mathrm{erf}(x) + \frac{\mathrm{e}^{-x^{2}}}{\sqrt{\pi}} \end{align} we used the substitution $u=x^{2}$.

Now we evaluate equation \eqref{eq:161108-1} $$f(x) = \frac{\sqrt{\pi}}{2} \mathrm{erf}(x) \Big|_{1}^{\sqrt{x}} = \frac{\sqrt{\pi}}{2} [\mathrm{erf}(\sqrt{x}) - \mathrm{erf}(1)] \label{eq:161108-4} \tag{4}$$

Substitute equation \eqref{eq:161108-4} into equation \eqref{eq:161108-2} and evaluate the following two integrals.

\begin{align} I_{1} &= \int\limits_{0}^{1} \frac{\mathrm{erf}(\sqrt{x})}{\sqrt{x}} dx \\ &= 2\int\limits_{0}^{1} \mathrm{erf}(z) dz \\ &= 2\,\mathrm{erf}(1) + \frac{2}{\mathrm{e}\sqrt{\pi}} - \frac{2}{\sqrt{\pi}} \end{align} we used the substitution $z=\sqrt{x}$.

$$I_{2} = \int\limits_{0}^{1} \frac{1}{\sqrt{x}} dx = 2$$

Putting all of the pieces together yields our final result \begin{align} \int\limits_{0}^{1} \frac{f(x)}{\sqrt{x}} dx &= \frac{\sqrt{\pi}}{2} \left(2\,\mathrm{erf}(1) + \frac{2}{\mathrm{e}\sqrt{\pi}} - \frac{2}{\sqrt{\pi}} - 2\,\mathrm{erf}(1) \right) \\ &= \frac{1}{\mathrm{e}} - 1 \end{align}

• I like this answer a lot. Really shows why the integral simplifies so much. The solution I posted expresses this by-way-of the fractions all simplifying a lot, but yours is definitely the winner in regards to showing how the non-elementary parts cancel – Brevan Ellefsen Nov 8 '16 at 14:09