I need to evaluate this integral: $$ I(t,a) = \int_{-\infty}^{t} e^{-(\tau+a)^2} \mathrm{erf}(\tau) \ \mathrm{d}\tau $$ where the $\mathrm{erf}(\tau)$ is the error function.

I can prove that this integral converges. By employing the python library

import numpy as np
from scipy.special import erf
import matplotlib.pyplot as plt
dtau = 0.01;p=[]
trange = np.arange(-20,20,0.1)
for t in trange:
    tau = np.arange(-20,t,dtau)
    I = np.exp(-(tau+a)**2)* erf(tau)

I got three graphs for different $a$ enter image description here

therefor one can speculate the behavior of the integral for $|a|\ll1$ is as a Bi-gaussian function and for $|a|\gg1$ is as an $\mathrm{erf}(t)$ function. therefore the answer is something like this $$ I(t,a) \sim \alpha(a) \ \mathrm{erf}(t+a) + \beta(a) \ e^{-(t\pm a)^2} $$

I would highly appreciate it if someone could help me to solve it.


if $t \rightarrow \infty$, the $I(\infty, a)$ is given by $$ I(t \rightarrow \infty,a) = \sqrt{\pi} \ \mathrm{erf} \Big(\dfrac{a}{\sqrt{2}} \Big) $$ this might be helpful.


If $a$ is small, we could expand the exponential as a Taylor series $$e^{-(\tau+a)^2} =e^{-\tau^2}\sum_{n=0}^p f_n(\tau)\,a^n$$ where the first coefficients are $$\left\{1,-2 \tau ,-1+2 \tau ^2,2 \tau -\frac{4 }{3}\tau ^3,\frac{1}{2}-2 \tau ^2+\frac{2 }{3}\tau ^4,-\tau +\frac{4 }{3}\tau ^3-\frac{4 }{15}\tau ^5,\cdots\right\}$$ and face a bunch of integrals $$I_n=\int_{-\infty}^t e^{-\tau ^2} \text{erf}(\tau ) \tau^n\,d\tau$$ which do not present much difficulties.

The first ones are $$I_0=\frac{1}{4} \sqrt{\pi } \left(\text{erf}(t)^2-1\right)$$ $$I_1=\frac{1}{4} \left(\sqrt{2} \left(\text{erf}\left(\sqrt{2} t\right)+1\right)-2 e^{-t^2} \text{erf}(t)\right)$$ $$I_2=\frac{1}{8} \left(-4 e^{-t^2} t \text{erf}(t)+\sqrt{\pi } \left(\text{erf}(t)^2-1\right)-\frac{2 e^{-2 t^2}}{\sqrt{\pi }}\right)$$ $$I_3=\frac{1}{16} \left(-8 e^{-t^2} \left(t^2+1\right) \text{erf}(t)+5 \sqrt{2} \left(\text{erf}\left(\sqrt{2} t\right)+1\right)-\frac{4 e^{-2 t^2} t}{\sqrt{\pi }}\right)$$

Limited to first order, this would give $$\frac{\sqrt{\pi }}{4} \left(\text{erf}(t)^2-1\right)+a \left(e^{-t^2} \text{erf}(t)+\frac{\text{erfc}\left(\sqrt{2} t\right)-2}{\sqrt{2}}\right)+O\left(a^2\right)$$ which perfectly matches your plot for $a=0.2$.

  • $\begingroup$ thanks, @claude-leibovici. However, if someone gives a more impact solution, would be great, due to I should insert this solution in a big equation and solve that on. for large $a$, do you have any solution? $\endgroup$ – Ghoti Sep 22 '20 at 13:05

$$I(t,a)=\int_{-\infty}^te^{-(\tau+a)^2}\operatorname{erf}(\tau)d\tau=\int_{-\infty}^{t+a}e^{-u^2}\operatorname{erf}(u-a)du$$ we know that: $$\operatorname{erf}(\tau)=\frac{2}{\sqrt{\pi}}\int_0^{\tau}e^{-\sigma^2}d\sigma$$ so we could break up the integral into: $$I(t,a)=\frac{2}{\sqrt{\pi}}\int_{-\infty}^0\int_0^{u-a}e^{-(u^2+\sigma^2)}d\sigma du+\frac{2}{\sqrt{\pi}}\int_0^{t+a}\int_0^{u-a}e^{-(u^2+\sigma^2)}d\sigma du$$ polar coordinates would be nice to use here but we have a rather ugly domain in the two regions: $$\exists S\in\{(u,\sigma):((-\infty,0]\times[0,u-a]\wedge[0,t+a]\times[0,u-a])\}$$ If we split up the first one and call it something else for ease: $$J_1=\int_{-\infty}^0\int_0^u e^{-(u^2+\sigma^2)}d\sigma du=\int_{5\pi/4}^{3\pi/2}\int_0^\infty re^{-r^2}drd\theta=\frac{\pi}{8}$$ $$J_2=\int_0^{t+a}\int_0^{u}e^{-(u^2+\sigma^2)}d\sigma du=\int_0^{\pi/4}\int_{\sec\theta}^{\sqrt{2}(t+a)}re^{-r^2}drd\theta$$ $$J_3=\int_{-\infty}^0\int_{u-a}^ue^{-(u^2+\sigma^2)}d\sigma du$$ $$J_4=\int_0^{t+a}\int_{u-a}^ue^{-(u^2+\sigma^2)}d\sigma du$$ Hopefully you will find a way of representing these nicely :)

  • $\begingroup$ thanks, @Henry. I tried to do it but could not. I got an expression that was wrong in comparison to the numerical method. why in the bound there is $\sec(\theta)$? $\endgroup$ – Ghoti Sep 23 '20 at 16:43
  • $\begingroup$ @Ghoti I believe I may have missed a term with the $\sec\theta$ but basically if you draw the domain it is a triangle shape, then you just use trig :) $\endgroup$ – Henry Lee Sep 23 '20 at 16:51
  • $\begingroup$ $I = \int_{-\infty}^{0} e^{-u^2} \mathrm{erf}(u-a) du + \int_{0}^{t+a} e^{-u^2} \mathrm{erf}(u-a) du = \dfrac{\pi}{4} \mathrm{erfc}(\dfrac{a}{\sqrt{2}})^2 + \dfrac{2}{\sqrt{\pi}} \int_{0}^{t+a} \int_{0}^{u} e^{-u^2-\sigma^2} d\sigma du+ \dfrac{2}{\sqrt{\pi}} \int_{0}^{t+a} \int_{u}^{u-a} e^{-u^2-\sigma^2} d\sigma du = \dfrac{\pi}{4} \mathrm{erfc}[\dfrac{a}{\sqrt{2}}]^2 + \dfrac{\pi}{4} \mathrm{erf}[t+a]^2+ \dfrac{2}{\sqrt{\pi}} \int_{0}^{t+a} \int_{u}^{u-a} e^{-u^2-\sigma^2} d\sigma du $ $\endgroup$ – Ghoti Sep 30 '20 at 12:55
  • $\begingroup$ .@Henry. I could not find the answer of $J_2$ using polar coordinates but got it from a different way. The last integration ($J_4$) left, and the domain is very strange, and the integration gets harder to solve. In your calculations, what is the domain of the $J_4$? $\endgroup$ – Ghoti Oct 5 '20 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.