# Integral of product of two error complementary functions (erfc)

Could you please help me to show that the integral $$\int_0^{\infty} \mathrm{erfc}(ax) \, \mathrm{erfc}(bx)\, \mathrm{d}x$$ is equal to $$\frac{1}{ab\sqrt{\pi}} (a+b-\sqrt{a^2+b^2}),$$ where $$\mathrm{erfc}(y)=\frac{2}{\sqrt{\pi}} \int_y^{\infty} \exp(-t^2)\, \mathrm{d} t.$$ I have tried to expand the integral as $$\frac{4}{\pi }\int_0^{\infty} \int_{ax}^{\infty} \int_{bx}^{\infty} \exp(-t^2 -s^2) \, \mathrm{d}s \, \mathrm{d}t \, \mathrm{d} x$$ but I could not come up with the right change of variables. Any ideas on how to proceed? Thank you in advance!

• $s/ax=p, t/bx=q$ seems to be a good start Commented Jan 30, 2017 at 13:25
• yep afterwards you can integrate one Gaussian followed by two elementary integrations..QED Commented Jan 30, 2017 at 13:35
• As a general rule of thumb, functions that are defined by an integral can usually be integrated by parts. This is how the integral of $\ln{(x)}$ and $\arctan{(x)}$ and other such functions are derived. Commented Jan 30, 2017 at 14:10
• Thank you guys for all your answers and suggestions, special thanks to Jack.
– Mim
Commented Jan 30, 2017 at 18:09
• You are welcome.
– Did
Commented Apr 9, 2017 at 16:18

Use the probabilistic way, which shows this is a problem of geometry in the plane...

That is, first note that, for every $x$, $$\mathrm{erfc}(x)=2P(X\geqslant \sqrt2 x)$$ where $X$ is standard normal hence, considering $(X,Y)$ i.i.d. standard normal and assuming that $a$ and $b$ are positive, one sees that the integral to be computed is $$I=4\int_0^\infty P(A_x)dx$$ where $$A_x:=[X\geqslant ax\sqrt2,Y\geqslant bx\sqrt2]$$ Now, $$(X,Y)=(R\cos\Theta,R\sin\Theta)$$ where $(R,\Theta)$ is independent, $\Theta$ is uniform on $(0,2\pi)$ and $R\geqslant0$ is such that $$P(R\geqslant r)=e^{-r^2/2}$$ for every $r\geqslant0$, hence $A_x\subset A_0=[\Theta\in(0,\pi/2)]$ and, on the event $A_0$, $$P(A_x\mid\Theta)=P(R\cos\Theta\geqslant ax\sqrt2,R\sin\Theta\geqslant bx\sqrt2\mid\Theta)=e^{-x^2u(\Theta)^2}$$ with $$u(\theta):=\max\left(\frac{a}{\cos\theta},\frac{b}{\sin\theta}\right)$$ Thus, still on $A_0$, $$\int_0^\infty P(A_x\mid\Theta)dx=\int_0^\infty e^{-x^2u^2(\Theta)}dx=\frac{\sqrt{\pi}}{2u(\Theta)}$$ This proves that $$\sqrt\pi I=4\sqrt\pi E\left(\int_0^\infty P(A_x\mid\Theta)dx\right)=2\pi E\left(\frac1{u(\Theta)}\mathbf 1_{A_0}\right)$$ that is, $$\sqrt\pi I=2\pi E\left(\min\left(\frac{\cos\Theta}a,\frac{\sin\Theta}b\right)\mathbf 1_{A_0}\right)$$ which is, using the distribution of $\Theta$, $$\sqrt\pi I=\int_0^{\pi/2}\min\left(\frac{\cos\theta}a,\frac{\sin\theta}b\right)d\theta=\frac1b\int_0^{\vartheta(a,b)}\sin\theta d\theta+\frac1a\int_{\vartheta(a,b)}^{\pi/2}\cos\theta d\theta$$ where the angle $\vartheta(a,b)$ in $(0,\pi/2)$ is uniquely defined by the condition that $$\tan\vartheta(a,b)=b/a$$ hence $$\sqrt\pi I=\frac{1-\cos\vartheta(a,b)}b+\frac{1-\sin\vartheta(a,b)}a$$ Finally, $$\cos\vartheta(a,b)=\frac{a}{\sqrt{a^2+b^2}}\qquad\sin\vartheta(a,b)=\frac{b}{\sqrt{a^2+b^2}}$$ hence $$I=\frac1{\sqrt{\pi}ab}\left(a-\frac{a^2}{\sqrt{a^2+b^2}}+b-\frac{b^2}{\sqrt{a^2+b^2}}\right)=\frac1{\sqrt{\pi}ab}\left(a+b-\sqrt{a^2+b^2}\right)$$

At first, we may remove the useless extra parameter, then study $$I(a) = \int_{0}^{+\infty}\text{erfc}(ax)\,\text{erfc}(x)\,dx$$ through differentiation under the integral sign. Assuming $a>0$ we have $$I'(a) = \frac{1}{\sqrt{\pi}}\int_{0}^{+\infty}-2x e^{-a^2 x^2}\text{erfc}(x)\,dx \stackrel{pp}{=}\frac{1}{a^2\sqrt{\pi}}-\frac{2}{\pi a^2}\int_{0}^{+\infty}e^{-(a^2+1)x^2}\,dx$$ from which: $$I'(a) = \frac{1}{\sqrt{\pi}}\left(\frac{1}{a^2}-\frac{1}{a^2\sqrt{1+a^2}}\right)$$ and: $$I(a) = \frac{1}{\sqrt{\pi}}\left(\frac{\sqrt{1+a^2}-1}{a}\right).$$ Through a substitution, if $a,b>0$ we get: $$\int_{0}^{+\infty}\text{erfc}(ax)\,\text{erfc}(bx)\,dx = \color{red}{\frac{a+b-\sqrt{a^2+b^2}}{ab\sqrt{\pi}}}$$ as wanted.

• And this should solve the issue! Great answer!
– Mim
Commented Jan 30, 2017 at 17:52
• @Mim: thank you, you're welcome. Commented Jan 30, 2017 at 18:12

A multiple integral approach. Since $$\int_{0}^{\infty}x^2 e^{-\alpha x^2}\mathrm{d}x \overset{\alpha x^2 \to x}{=} \frac{1}{2\alpha^{\frac{3}{2}} }\int_{0}^{\infty} x^{\frac{3}{2}-1}e^{-x} \mathrm{d}x = \frac{1}{2\alpha^{\frac{3}{2}} } \Gamma\left(\frac{3}{2}\right) = \frac{\sqrt{\pi}}{4\alpha^{\frac{3}{2}} }$$ We get \begin{align} \int_0^\infty \operatorname{erfc}(ax) \operatorname{erfc}(bx)\, \mathrm{d}x & =\int_0^\infty \left( \frac{2}{\sqrt{\pi}}\int_1^\infty ax e^{-a^2x^2z^2} \, \mathrm{d}z\right)\left( \frac{2}{\sqrt{\pi}}\int_1^\infty bx e^{-b^2x^2y^2}\, \mathrm{d}y\right) \mathrm{d}x\\ & =\frac{4ab}{\pi} \int_1^\infty \int_1^\infty \int_0^\infty x^2 e^{-(a^2z^2 +b^2y^2)x^2} \, \mathrm{d}x\, \mathrm{d}z\, \mathrm{d}y\\ & =\frac{ab}{\sqrt{\pi}} \int_1^\infty \int_1^\infty \frac{1}{\left(a^2z^2 +b^2y^2 \right)^{\frac32}} \, \mathrm{d}z\, \mathrm{d}y\\ & \overset{z\to \tan(\theta)by/a}{=}\frac{ab}{\sqrt{\pi}} \int_1^\infty \frac{1}{ab^2y^2} - \frac{1}{y^2b^2\sqrt{y^2b^2+a^2}} \, \mathrm{d}y\\ & =\frac{ab}{\sqrt{\pi}}\left(\frac{1}{ab^2} - \frac{1}{b^2}\int_1^\infty \frac{1}{y^2\sqrt{b^2y^2+a^2}} \, \mathrm{d}y\right)\\ & \overset{y\to\tan(\varphi)a/b }{=}\frac{a}{b\sqrt{\pi}}\left(\frac{1}{a} - \frac{\sqrt{a^2+b^2} - b}{a^2} \right)\\ & = \frac{a+b - \sqrt{a^2+b^2}}{ab\sqrt{\pi}} \end{align}

Let \begin{align*} I(a) & = \int_0^{\infty} \operatorname{erfc}(ax) \, \operatorname{erfc}(bx)\, \mathrm{d}x = \int_0^{\infty} \operatorname{erfc}(bx)\, \left(\frac{2}{\sqrt{\pi}}\int_{ax}^{\infty}e^{-t^{2}} \; \mathrm{d}t \right) \, \mathrm{d}x \end{align*} Differentiating with respect to $$a$$ using Leibniz rule, we have \begin{align*} I^{\prime}(a) & = \int_0^{\infty} \, \operatorname{erfc}(bx)\, \mathrm{d}x \frac{2}{\sqrt{\pi}}\left(\left[e^{-t^2}\right]\Bigg{|}_{t \to \infty} \frac{\mathrm{d}}{\mathrm{d} a}\left(\infty\right) - \left[e^{-t^2}\right]\Bigg{|}_{t=ax} \frac{\mathrm{d}}{\mathrm{d} a}\left(ax\right)+ \int_{ax}^{\infty} \frac{\partial}{\partial a}\left[e^{-t^2}\right]\; \mathrm{d}t \right) \\ & = -\frac{2}{\sqrt{\pi}} \int_0^{\infty} \, xe^{-a^{2}x^{2}}\,\operatorname{erfc}(bx)\, \mathrm{d}x \\ & = \frac{1}{a^{2}\sqrt{\pi}}\int_0^{\infty} \,\operatorname{erfc}(bx)\,\mathrm{d}\left(e^{-a^{2}x^{2}}\right) \\ & = \frac{1}{a^{2}\sqrt{\pi}}\left\{\left.\left[e^{-a^{2}x^{2}}\,\operatorname{erfc}(bx)\right]\right|_0^{\infty} - \int_0^{\infty}\,e^{-a^{2}x^{2}}\frac{\mathrm{d}}{\mathrm{d} x}{[\operatorname{erfc}(bx)]} \, \mathrm{d}x \right\} \text{ (integration by parts)}\\ & = \frac{1}{a^{2}\sqrt{\pi}}\left\{-1 + \int_0^{\infty} b\frac{2}{\sqrt{\pi}} e^{-\left(a^{2}+b^{2}\right)x^{2}}\mathrm{d}x\right\} \\ & = \frac{1}{a^{2}\sqrt{\pi}}\left\{-1 + \frac{2}{\sqrt{\pi}} \times \frac{b}{\sqrt{a^{2}+b^{2}}}\int_0^{\infty}e^{-r^{2}}\mathrm{d}r\right\} \;\;\left(\because \;\; r=x\sqrt{a^{2}+b^{2}}\right) \\ & = \frac{1}{a^{2}\sqrt{\pi}}\left\{-1 + \frac{b}{\sqrt{a^{2}+b^{2}}}\right\} \\ & = \frac{1}{\sqrt{\pi}}\left\{\frac{b}{a^{2}\sqrt{a^{2}+b^{2}}}-\frac{1}{a^{2}}\right\}. \end{align*} Integrating with respect to $$a$$, we have \begin{align*} I(a) & = \frac{1}{\sqrt{\pi}}\left\{\frac{1}{a} - b \times \frac{1}{b^{2}}\frac{\sqrt{a^{2}+b^{2}}}{a}\right\} + C \quad \left(\because \;\; \int \frac{\mathrm{d}a}{a^{2}\sqrt{a^{2}+b^{2}}} = -\frac{1}{b^{2}}\frac{\sqrt{a^{2}+b^{2}}}{a} \right)\\ & = \frac{1}{\sqrt{\pi}}\left\{\frac{1}{a} - \frac{\sqrt{a^{2}+b^{2}}}{ab}\right\} + C. \end{align*} In the given integral if $$a \to \infty$$, we have $$I(\infty)=0$$. Therefore, we have \begin{align*} \lim\limits_{a \to \infty} I(a) = 0 & = \lim\limits_{a \to \infty} \frac{1}{\sqrt{\pi}}\left\{\frac{1}{a} - \frac{\sqrt{a^{2}+b^{2}}}{ab}\right\} + C \\ & = \lim\limits_{a \to \infty} \frac{1}{\sqrt{\pi}}\left\{\frac{1}{a} - \frac{1}{b}\sqrt{1+\frac{b^{2}}{a^{2}}}\right\} + C \\ & = C - \frac{1}{b\sqrt{\pi}} \\ \Rightarrow \quad C & = \frac{1}{b\sqrt{\pi}}. \end{align*} Substituting the value of $$C$$, we have \begin{align*} I(a) & = \frac{1}{\sqrt{\pi}}\left\{\frac{1}{a} - \frac{\sqrt{a^{2}+b^{2}}}{ab}\right\} + \frac{1}{b\sqrt{\pi}} \\ & = \frac{1}{\sqrt{\pi}}\left\{\frac{1}{a} + \frac{1}{b} - \frac{\sqrt{a^{2}+b^{2}}}{ab}\right\} \\ & = \frac{1}{ab\sqrt{\pi}} \left(a+b-\sqrt{a^2+b^2}\right),\;\; a,\;b > 0. \end{align*}