# Integral of product of exponential function and two complementary error functions (erfc)

I found the following integral evaluation very interesting to me:

Integral of product of two error functions (erf)

and I hoped that I could use that result to evaluate the following integral: $$\int_{-\infty}^{\infty}\exp\left(-t^{2}\right)\,\mathrm{erfc}\left(t-c\right)\,\mathrm{erfc}\left(d-t\right)\,\mathrm{d}t=\frac{4}{\pi}\int_{-\infty}^{\infty}\exp\left(-t^{2}\right)\int_{t-c}^{\infty}\int_{d-t}^{\infty}\exp\left(-u^{2}-v^{2}\right)\,\mathrm{d}u\,\mathrm{d}v\,\mathrm{d}t$$

So I note that $u\geq t-c$, $v\geq d-t$,
thus $t\leq u+c$ and $t\geq d-v$,
thus $d-v\leq t\leq u+c$ and $u+v\geq d-c$.

Hence $$\frac{4}{\pi}\int_{-\infty}^{\infty}\exp\left(-t^{2}\right)\int_{d-t}^{\infty}\int_{t-c}^{\infty}\exp\left(-u^{2}-v^{2}\right)\,\mathrm{d}u\,\mathrm{d}v\,\mathrm{d}t=$$ $$\qquad\qquad =\frac{4}{\pi}\int\!\int_{u+v>d-c}\exp\left(-u^{2}-v^{2}\right)\,\int_{d-v}^{u+c}\exp\left(-t^{2}\right)\,\mathrm{d}t\,\mathrm{d}u\,\mathrm{d}v$$

I know that $$\int_{d-v}^{u+c}\exp\left(-t^{2}\right)\,\mathrm{d}t=\frac{1}{2}\sqrt{\pi}\left(\mathrm{erf}\left(u+c\right)-\mathrm{erf}\left(d-v\right)\right)$$

but I don't quite understand how I should deal with $$\frac{4}{\pi}\int\!\int_{u+v>d-c}\exp\left(-u^{2}-v^{2}\right)\mathrm{d}u\,\mathrm{d}v\,.$$ What limits of integration I should use there? Thanks for any suggestions.

-

You can rotate coordinates. To do so, apply the following change of variables: $$\begin{cases} x = \frac{1}{\sqrt{2}} (u - v) \\ y = \frac{1}{\sqrt{2}} (u+v) \end{cases}$$ This leads to nicer integral: $$\int\int_{u+v > d-c} e^{-(u^2 + v^2)} \, du\,dv = \int_{\frac{1}{\sqrt{2}}(d-c)}^\infty \int_{-\infty}^{+\infty} e^{-x^2 - y^2} \, dx \,dy$$

-

Ok, so after some manipulations and using the integral $$\int_{-\infty}^{\infty}\exp\left(-b^{2}(x-c)^{2}\right)\mathrm{erf}\left(a\left(x-d\right)\right)\,\mathrm{d}x=\frac{\sqrt{\pi}}{b}\mathrm{erf}\left(\frac{ab\left(c-d\right)}{\sqrt{a^{2}+b^{2}}}\right), \quad b>0$$

I ended with

$$\int_{-\infty}^{\infty}\exp\left(-t^{2}\right)\,\mathrm{erfc}\left(t-c\right)\,\mathrm{erfc}\left(d-t\right)\,\mathrm{d}t=$$

$$=2\int_{\frac{1}{\sqrt{2}}\left(d-c\right)}^{\infty}\exp\left(-y^{2}\right)\left[\mathrm{erf}\left(\frac{1}{\sqrt{3}}\left(y+\sqrt{2}c\right)\right)+\mathrm{erf}\left(\frac{1}{\sqrt{3}}\left(y-\sqrt{2}d\right)\right)\right]\,\mathrm{d}y.$$

I checked it numerically and it's correct!

The last thing I need to do is to find an evaluation of a general integral $$\int_{z}^{\infty}\exp\left(-y^{2}\right)\mathrm{erf}\left(m\left(y-n\right)\right)\,\mathrm{d}y.$$

but unfortunately I don't know how.

EDIT

And incidentally

$$\int_{-\infty}^{\infty}\exp\left(-t^{2}\right)\,\mathrm{erfc}\left(t-c\right)\,\mathrm{erfc}\left(d-t\right)\,\mathrm{d}t=$$ $$=2\int_{\frac{1}{\sqrt{2}}\left(d-c\right)}^{\infty}\exp\left(-y^{2}\right)\left[\mathrm{erf}\left(\frac{1}{\sqrt{3}}\left(y+\sqrt{2}c\right)\right)+\mathrm{erf}\left(\frac{1}{\sqrt{3}}\left(y-\sqrt{2}d\right)\right)\right]\,\mathrm{d}y =$$ $$= -2\int_{-\infty}^{\frac{1}{\sqrt{2}}\left(c-d\right)}\exp\left(-y^{2}\right)\left[\mathrm{erf}\left(\frac{1}{\sqrt{3}}\left(y-\sqrt{2}c\right)\right)+\mathrm{erf}\left(\frac{1}{\sqrt{3}}\left(y+\sqrt{2}d\right)\right)\right]\mathrm{d}y=$$ $${\small = 2\int_{0}^{\infty}\exp\!\left(-\left(y-\frac{1}{\sqrt{2}}\left(c-d\right)\right)^{2}\right)\left[\mathrm{erf}\!\left(\frac{1}{\sqrt{3}}\left(y+\frac{1}{\sqrt{2}}\left(c+d\right)\right)\right)+\mathrm{erf}\!\left(\frac{1}{\sqrt{3}}\left(y-\frac{1}{\sqrt{2}}\left(c+d\right)\right)\right)\right]\mathrm{d}y }$$

$${\small = -2\int_{-\infty}^{0}\exp\!\left(-\left(y+\frac{1}{\sqrt{2}}\left(c-d\right)\right)^{2}\right)\left[\mathrm{erf}\!\left(\frac{1}{\sqrt{3}}\left(y+\frac{1}{\sqrt{2}}\left(c+d\right)\right)\right)+\mathrm{erf}\!\left(\frac{1}{\sqrt{3}}\left(y-\frac{1}{\sqrt{2}}\left(c+d\right)\right)\right)\right]\mathrm{d}y. }$$

-