0

I

$$\frac{1}{\sigma\sqrt{2\pi}}\int^S _{-\infty} x \cdot\exp\left(\frac{-{\left(x-\mu \right)}^{2}}{2\sigma }\right)\cdot \operatorname{erf}\left(\frac{A(x-\mu )}{\sigma \sqrt{2}}\right)\mathrm dx$$

  • After rescaling, we have $I=\int dx \ x \exp(-(x-\mu)^2)\operatorname{erf}(a(x-\mu)))$. Let $y=x-\mu$, then we have $I=J+K$, where $J=\int dy \ e^{-y^2}\operatorname{erf}(ay)$, the general case is solved here here, but in this case $J=0$ as the integrand is odd. Then $I=K(a)=\int dy \ y e^{-y^2}\operatorname{erf}(ay)$. By taking the $a$ derivative then doing the $y$ integral: $K'(a)=(1+a^2)^{-3/2}$, this may be integrated wrt $a$ to find $K(a)=I=a(1+a^2)^{-1/2}$ – Sal Jun 25 '21 at 18:45
  • In that case, the result is not likely to be pretty (also, you should update your question to include the limits!). Using the expression for $J(\infty)-J(\beta)$ in the linked post we may find $\int^s dy e^{-y^2}\operatorname{erf}(ay)$, then to find the integral with an extra $y$ in the integrand, introduce an exponential: $\int^s dy \ e^{-y^2}e^{ky}\operatorname{erf}(ay)$, again this may be evaluated with the help of $J(\beta)$. Then differentiate wrt $k$ and set $k=0$. – Sal Jun 25 '21 at 20:46
  • I suspect the answer would be too long to fit in a comment, judging by the mess that comes from one evaluation of $J(\beta)$. I'll try and post a more explicit 'recipe' soon. – Sal Jun 26 '21 at 17:49
  • this is a gentle reminder to accept an answer if your question has been resolved. – Sal Jul 11 '21 at 00:08

1 Answers1

2

We will calculate

$$ I(a,b,c):=\int\limits_{-\infty}^c dx \ x e^{-(x-a)^2} \operatorname{erf}(b(x-a)) $$

Which is equivalent to your integral upon rescaling $x$. We will make use of the following results from here

$$ J(A,B,C,D)=\int\limits_D^\infty dx \ e^{-Cx^2} \operatorname{erf}(Ax+B)=2\sqrt{\frac{\pi}{C}} \ T(D\sqrt{2C},A/\sqrt{C},B\sqrt{2}) $$

Where $T$ is the 'generalized Owen T function' defined here. $J$ may be expressed in terms of elementary functions and the 'regular' Owen T function. When $D=-\infty$ we have

$$ J(A,B,C,-\infty)= \sqrt{\frac{\pi}{C}}\operatorname{erf} \left(B \sqrt{\frac{C}{A^2+C}}\right) $$

Now define $K$ as

$$ K(A,B,C,D):=J(A,B,C,-\infty) \ - \ J(A,B,C,D) $$

First let $x-a=y$

$$ \tag{*} I(a,b,c)=\int\limits_{-\infty}^{c-a} dy \ ye^{-y^2} \operatorname{erf}(by) +a\int\limits_{-\infty}^{c-a} dy \ e^{-y^2} \operatorname{erf}(by) $$

The second integral on the right is already in the form of $K$. We need to evaluate the first. Let

$$ L(b,c,\alpha):=\int\limits_{-\infty}^{c} dy \ e^{\alpha y}e^{-y^2} \operatorname{erf}(by) $$

So that the first integral on the right in (*) is given by $\partial_\alpha L(b,c-a,0)$. Complete the square in the exponents to find

$$ L(b,c,\alpha)=e^{\alpha^2/4}\int\limits_{-\infty}^{c} dy \ e^{-(y-\alpha/2)^2} \operatorname{erf}(by)=e^{\alpha^2/4}\int\limits_{-\infty}^{c-\alpha/2} dt \ e^{-t^2} \operatorname{erf}(bt+\alpha b/2) $$

The integral on the right is now again in terms of $K$

$$ L(b,c,\alpha)=e^{\alpha^2/4} K(b,\alpha b/2,1,c-\alpha/2) $$

Putting it all together we have

$$ I(a,b,c)=\partial_\alpha L(b,c-a,\alpha) \bigg|_{\alpha=0} + a K(b,0,1,c-a) $$

I hope they're no typos here! In any case, this is the strategy mentioned in the comments.

Sal
  • 4,822