# integrals with error function

Can anyone help me to compute these integrals?

$$$$\int_0^t\frac{1}{x}\exp\left(-\frac{a^2}{x}\right) \operatorname{erf}\left(\frac{b}{\sqrt{x}}\right)\,dx$$$$

here $$\operatorname{erf}(\cdot)$$ is error function.

I have already tried to take this integral by a lot of means, but I have not succeeded...

There is one more (it is consequence of the first one): $$$$\int_0^b\frac{1}{\sqrt{a^2 + x^2}} \operatorname{erfc}\left(\sqrt{\frac{a^2 + x^2}{t}}\right)\,dx$$$$

Here $$\operatorname{erfc}(\cdot)$$ is complementary error function. Of course, I understand, that it is impossible to take them in elementary functions... But even with special functions I can't understand how to do it... Thanks in advance!

• A small passing comment: If you had $1/x^{3/2}$ instead of $1/x$, you'd have an integral roughly of the form $\int \frac{d}{dx} [F(\frac{1}{\sqrt{x}})]^2 dx$, where $F$ is the error function. (Just set $a=b=1$ for convenience.) – abnry Jun 24 '13 at 16:49

Sometimes just using the integral form of error function can save you.

$\int_0^t\dfrac{1}{x}e^{-\frac{a^2}{x}} \text{erf}\biggl(\dfrac{b}{\sqrt{x}}\biggr)~dx$

$=\dfrac{2}{\sqrt{\pi}}\int_0^t\dfrac{1}{x}e^{-\frac{a^2}{x}}\int_0^\frac{b}{\sqrt{x}}e^{-u^2}~du~dx$

$=\dfrac{2}{\sqrt{\pi}}\int_0^t\dfrac{1}{x}e^{-\frac{a^2}{x}}\int_0^1e^{-\left(\frac{bu}{\sqrt{x}}\right)^2}~d\biggl(\dfrac{bu}{\sqrt{x}}\biggr)~dx$

$=\dfrac{2}{\sqrt{\pi}}\int_0^t\dfrac{1}{x}e^{-\frac{a^2}{x}}\int_0^1\dfrac{b}{\sqrt{x}}e^{-\frac{b^2u^2}{x}}~du~dx$

$=\dfrac{2b}{\sqrt{\pi}}\int_0^t\int_0^1\dfrac{e^{-\frac{b^2u^2+a^2}{x}}}{x\sqrt{x}}du~dx$

$=\dfrac{2b}{\sqrt{\pi}}\int_0^1\int_0^t\dfrac{e^{-\frac{b^2u^2+a^2}{x}}}{x\sqrt{x}}dx~du$

$=\dfrac{4b}{\sqrt{\pi}}\int_0^1\int_0^t-e^{-\frac{b^2u^2+a^2}{x}}~d\biggl(\dfrac{1}{\sqrt{x}}\biggr)~du$

$=\dfrac{4b}{\sqrt{\pi}}\int_0^1\int_\infty^\frac{1}{\sqrt{t}}-e^{-(b^2u^2+a^2)x^2}~dx~du$

$=\dfrac{4b}{\sqrt{\pi}}\int_0^1\int_\frac{1}{\sqrt{t}}^\infty e^{-(b^2u^2+a^2)x^2}~dx~du$

$=\dfrac{4b}{\sqrt{\pi}}\int_0^1\int_0^\infty e^{-(b^2u^2+a^2)x^2}~dx~du-\dfrac{4b}{\sqrt{\pi}}\int_0^1\int_0^\frac{1}{\sqrt{t}}e^{-(b^2u^2+a^2)x^2}~dx~du$

$=2b\int_0^1\dfrac{1}{\sqrt{b^2u^2+a^2}}du-\dfrac{4b}{\sqrt{\pi}}\int_0^1\biggl[\sum\limits_{n=0}^\infty\dfrac{(-1)^n(b^2u^2+a^2)^nx^{2n+1}}{n!(2n+1)}\biggr]_0^\frac{1}{\sqrt{t}}~du$

$=2b\int_0^1\dfrac{1}{\sqrt{b^2u^2+a^2}}du-\dfrac{4b}{\sqrt{\pi}}\int_0^1\sum\limits_{n=0}^\infty\dfrac{(-1)^n(b^2u^2+a^2)^n}{t^{n+\frac{1}{2}}n!(2n+1)}du$

$=2b\int_0^1\dfrac{1}{\sqrt{b^2u^2+a^2}}du-\dfrac{4b}{\sqrt{\pi}}\int_0^1\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^nC_k^na^{2n-2k}b^{2k}u^{2k}}{t^{n+\frac{1}{2}}n!(2n+1)}du$

$=2b\biggl[\dfrac{\ln\left(b^2u+b\sqrt{b^2u^2+a^2}\right)}{b}\biggr]_0^1-\dfrac{4b}{\sqrt{\pi}}\biggl[\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^na^{2n-2k}b^{2k}u^{2k+1}}{t^{n+\frac{1}{2}}k!(n-k)!(2n+1)(2k+1)}\biggr]_0^1$

$=2\ln\left(b^2+b\sqrt{a^2+b^2}\right)-2\ln(|a|b)-\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^n4a^{2n-2k}b^{2k+1}}{\sqrt{\pi}t^{n+\frac{1}{2}}k!(n-k)!(2n+1)(2k+1)}$

$\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}\text{erfc}\left(\sqrt{\dfrac{a^2+x^2}{t}}\right)~dx$

$=\dfrac{2}{\sqrt{\pi}}\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}\int_\sqrt{\frac{a^2+x^2}{t}}^\infty e^{-u^2}~du~dx$

$=\dfrac{2}{\sqrt{\pi}}\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}\int_0^\infty e^{-u^2}~du~dx-\dfrac{2}{\sqrt{\pi}}\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}\int_0^\sqrt{\frac{a^2+x^2}{t}}e^{-u^2}~du~dx$

$=\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}dx-\dfrac{2}{\sqrt{\pi}}\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}\biggl[\sum\limits_{n=0}^\infty\dfrac{(-1)^nu^{2n+1}}{n!(2n+1)}\biggr]_0^\sqrt{\frac{a^2+x^2}{t}}~dx$

$=\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}dx-\dfrac{2}{\sqrt{\pi}}\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}\sum\limits_{n=0}^\infty\dfrac{(-1)^n(a^2+x^2)^{n+\frac{1}{2}}}{t^{n+\frac{1}{2}}n!(2n+1)}dx$

$=\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}dx-\dfrac{2}{\sqrt{\pi}}\int_0^b\sum\limits_{n=0}^\infty\dfrac{(-1)^n(a^2+x^2)^n}{t^{n+\frac{1}{2}}n!(2n+1)}dx$

$=\int_0^b\dfrac{1}{\sqrt{a^2+x^2}}dx-\dfrac{2}{\sqrt{\pi}}\int_0^b\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^nC_k^na^{2n-2k}x^{2k}}{t^{n+\frac{1}{2}}n!(2n+1)}dx$

$=\left[\ln\left(x+\sqrt{a^2+x^2}\right)\right]_0^b-\dfrac{2}{\sqrt{\pi}}\biggl[\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^na^{2n-2k}x^{2k+1}}{t^{n+\frac{1}{2}}k!(n-k)!(2n+1)(2k+1)}\biggr]_0^b$

$=\ln\left(b+\sqrt{a^2+b^2}\right)-\ln|a|-\sum\limits_{n=0}^\infty\sum\limits_{k=0}^n\dfrac{(-1)^n2a^{2n-2k}b^{2k+1}}{\sqrt{\pi}t^{n+\frac{1}{2}}k!(n-k)!(2n+1)(2k+1)}$

• You have done a really great work! But, I almost sure, that this approach is equivalent to series expansion of error function in initial integrand. – mechanician Jul 16 '13 at 9:36
• And now I wonder if series in final expression is some special function... – mechanician Jul 16 '13 at 9:39
• This is the most extravagant use of LaTex I've seen in a post... – jameselmore Jul 19 '13 at 13:12

\begin{eqnarray} \int\limits_0^t \frac{1}{x} \exp\left( -\frac{a^2}{x} \right) Erf\left( \frac{b}{\sqrt{x}}\right) dx=\\ 4 \int\limits_0^b \Phi^>(\sqrt{\frac{2}{t}} \sqrt{a^2+x^2}) \frac{1}{\sqrt{a^2+x^2}} dx=\\ 4 \int\limits_0^{arcsinh(b/a)} \Phi^>(\sqrt{\frac{2}{t}a \cosh(x)}) dx=\\ 4 arcsinh(\frac{b}{a}) - 4 \int\limits_0^{arcsinh(\frac{b}{a})} \Phi^<(\sqrt{\frac{2}{t}a \cosh(x)}) dx=\\ 2 arcsinh(\frac{b}{a}) - 4\left(\frac{1}{\sqrt{2 \pi}} \sum\limits_{n=1}^\infty (-\frac{1}{2})^{n-1} \frac{1}{(n-1)! (2n-1)} (\frac{2 a}{t})^{n-1/2} \int\limits_0^{arcsinh(\frac{b}{a})} [\cosh(x)]^{2n-1} dx\right) \end{eqnarray} In the first line we differentiated the integral with respect to $b$ then carried out the resulting integral by substituting for $1/\sqrt{x}$ and then integrated back again. In the second line we substituted $x\leftarrow a \sinh(x)$ and in the final line we expanded the CDF in a Taylor series . In order to finish the calculation it amounts to use the following result: $$\int [\cosh(x)]^n dx = \frac{1}{2^{n-1}} \sum\limits_{p=0}^{2n-1} \binom{2n-1}{p} \frac{1}{2n-1-2 p} \sinh((2n-1-2 p) x)$$