# Steps in evaluating the integral of complementary error function?

Could you please check the below and show me any errors? $$\int_ x^ \infty {\rm erfc} ~(t) ~dt ~=\int_ x^ \infty \left[\frac{2}{\sqrt\pi} \int_ t^ \infty e^{-u^2} du \right]\ dt$$ If I let dv=dt and u equal the term inside the bracket, and do integration by parts, $$\int u ~dv ~=uv - \int v~ du$$ v=t and du becomes $$-\frac{2}{\sqrt\pi} e^{-t^2}$$ This was obtained from using the Leibniz rule below, $$\frac {d} {dt} \left[ \int_ a^ b f(u)du \right]\ = \int_ a^ b \frac {d} {dt} f(u) du + f \frac {db} {dt} - f \frac {da} {dt}$$

Then, $$\frac {d} {dt} \left[\frac{2}{\sqrt\pi} \int_ t^ \infty e^{-u^2} du \right]\ = \frac{2}{\sqrt\pi} \left[ \int_ t^ \infty \frac {d} {dt} \left( e^{-u^2} \right) du + e^{-\infty ^2} * 0 - e^{-t^2}*1 \right]= \frac{2}{\sqrt\pi} \left[0~+~0~- e^{-t^2} \right]$$ Is the first and second term going to zero correct? The upper limit b=infinity, and is db/dt=0 in the second term correct?
The integral becomes $$\left[~ t~ \frac{2}{\sqrt\pi} \int_ t^ \infty e^{-u^2} du ~\right] _{x}^\infty + \int_ x^ \infty t \left[\frac{2}{\sqrt\pi} e^{-t^2} \right]\ dt =$$ $$\left[~ t~ \frac{2}{\sqrt\pi} \int_ t^ \infty e^{-u^2} du ~\right] _{x}^\infty - \left[\frac{1}{\sqrt\pi} e^{-t^2} \right] _{x}^\infty =$$ $$\left[ 0 - ~ x~ \frac{2}{\sqrt\pi} \int_ x^ \infty e^{-u^2} du ~\right] - \left[ 0 - \frac{1}{\sqrt\pi} e^{-x^2} \right] =$$ (Is the first limit going to zero OK? infinity times 0 = 0). The above becomes $$-x~ {\rm erfc}~(x) + \frac{1}{\sqrt\pi} e^{-x^2}$$ Is everything correct here? Could you please give explanation to the questions I listed?

-

## migrated from meta.math.stackexchange.comFeb 11 '12 at 11:24

This question came from our discussion, support, and feature requests site for people studying math at any level and professionals in related fields.

This is the second time you are posting a math question here on the meta site. Please post such questions on the main site, which has colours, and not on meta, which is grey! – Rahul Feb 11 '12 at 10:54
Looks right to me. – J. M. Feb 11 '12 at 11:53

You can also achieve this result by an interchange of the integrals as follows. $$\int_x^\infty {\rm erfc}(t)\,dt = {2\over\sqrt{\pi}}\int_x^\infty\left(\int_t^\infty e^{-u^2}\,du\right)dt = \iint_{x<t<u} e^{-u^2}\,dudt.$$ Now interchange the order of integration to get $$\int_x^\infty {\rm erfc}(t)\,dt ={2\over\sqrt{\pi}}\int_x^\infty\left( \int_x^udt\right) e^{-u^2}\,du = {2\over\sqrt{\pi}}\int_x^\infty (u-x)e^{-u^2}\,du,$$ hence $$\int_x^\infty {\rm erfc}(t)\,dt= {1\over{\sqrt{\pi}}}e^{-x^2} - x{\rm erfc}(x).$$
Since you are integrating over $x < t < u < \infty$, to reverse, you write the inequalities $x < t < u$ for the inner $dt$ integral and $x < u < \infty$ for the outer $du$ integral. – ncmathsadist Feb 11 '12 at 14:58
Added some missing $dt$ symbols, and got rid of the conflict of notation between $x$ the limit of the integral and $x$ the dummy variable in the same integral. – Did Feb 14 '12 at 14:03