It is clear that there is something missing in the step from the third to the fourth line in the derivation above. Let analyze that step carefully now.
We need to solve a following improper integral:
\begin{equation}
f(x):= \int\limits_{\imath A_1 x}^\infty \frac{1}{2} \operatorname{erf}\left[ \frac{\imath \xi + \imath A_3 x}{\sqrt{2}}\right] \cdot \frac{e^{-\frac{\xi^2}{2}}}{\sqrt{2\pi}} d\xi \tag{1}
\end{equation}
where $A_1 \in {\mathbb R}$ and $A_3 \in {\mathbb C}$ and $Re[A_3] < 0 $.
Let us differentiate the function above. We have:
\begin{eqnarray}
\frac{d f(x)}{d x} =
-(\imath A_1 ) \cdot \frac{1}{2} \operatorname{erf} \left[ \frac{-A_1 x + \imath A_3 x}{\sqrt{2}}\right] \cdot \frac{e^{\frac{1}{2} A_1^2 x^2}}{\sqrt{2\pi}} +
\frac{1}{2\pi \imath x} e^{\frac{1}{2} A_3 (2 \imath A_1 + A_3) x^2} \cdot 1_{Re[A_3] <0 } \tag{2}
\end{eqnarray}
Here the first term in the right hand side is just the value of the integrand at the lower limit times the negated derivative of the internal function. The second term is the improper integral from the partial derivative of the integrand. Here it is important to note that the second term only exists if $Re[A_3] <0 $.
Now, the only thing we need to do is to find the anti-derivatives of the terms above. It is not hard to see that the following holds true:
\begin{eqnarray}
f(x) = -T\left[ \imath A_1 x, - \imath - A_3/A_1\right] + \frac{1}{4\pi \imath} \operatorname{Ei}\left[ \frac{1}{2} A_3 (2 \imath A_1 + A_3) x^2\right] + C \tag{2a}
\end{eqnarray}
Here the first and the second terms in the right hand side in $(2a)$ correspond to the first and the second terms in $(2)$. Now we evaluate $(2a)$ at $x= 1$ and at $x = - \imath \operatorname{sign}[A_1] M$ and subtract both sides from each other. Then we take the limit $M \rightarrow \infty$ and we get:
\begin{eqnarray}
f(1) = T\left[ \imath A_1, \imath + \frac{A_3}{A_1} \right] +
\frac{1}{4\pi \imath} \operatorname{Ei}\left[ \frac{1}{2} A_3 (2 \imath A_1 + A_3)\right] - \frac{1}{4} \operatorname{sign}\left[ Im[\frac{1}{2} A_3 (2 \imath A_1 + A_3)(-1)]\right] \tag{3}
\end{eqnarray}
Here we used the fact that the Owen's T function is odd in the second argument and we also used the fact that $\lim\limits_{M\rightarrow \infty} \frac{1}{4 \pi \imath} Ei((a+\imath b) M) = sign(b) \cdot \frac{1}{4} \cdot 1_{a<0} + \infty \cdot 1_{a>0}$.
Up to this point everything was rigorous but when we test the formula $(3)$ we realize that there is something missing there. From numerical tests we have figured out that the correct version of formula $(3)$ is given below:
\begin{eqnarray}
f(1) &=& T\left[ \imath A_1, \imath + \frac{A_3}{A_1} \right] +
\frac{1}{4\pi \imath} \operatorname{Ei}\left[ \frac{1}{2} A_3 (2 \imath A_1 + A_3)\right] - \frac{1}{4} \operatorname{sign}\left[ Im[\frac{1}{2} A_3 (2 \imath A_1 + A_3)(-1)]\right] + \\
&&
\left( -\frac{1}{2} \cdot 1_{A_1 <0} + \frac{1}{2} \cdot 1_{A_1 > Im[-A_3]} \right) \cdot 1_{Im[A_3] <0 } + \\
&&
\left( +\frac{1}{2} \cdot 1_{A_1 >0} - \frac{1}{2} \cdot 1_{A_1 < Im[-A_3]} \right) \cdot 1_{Im[A_3] >0 }
\tag{3a}
\end{eqnarray}
A numerical test of the formula $(3a)$ is below:
In[180]:=
ll = {};
Do[
A1 = RandomReal[{-3, 3}, WorkingPrecision -> 50];
A3 = -RandomComplex[{1/2 (1 + I), 2 (1 + I)},
WorkingPrecision -> 50];
If[ii > 500, A3 = Re[A3] - I Im[A3]];
t1 = NIntegrate[
1/2 Erf[(I xi + I A3 1)/Sqrt[2]] Exp[-xi^2/2]/Sqrt[2 Pi], {xi,
I A1 1, Infinity}, WorkingPrecision -> 15];
t2 = (OwenT[I A1 1, I + A3/A1] +
1/(4 Pi I) (ExpIntegralEi[1/2 A3 (2 I A1 + A3) 1]) -
1/4 Sign[Im[1/2 A3 (2 I A1 + A3) (-1)]] +
If[Im[A3] < 0, Which[A1 < 0, -1/2, A1 > Im[-A3], +1/2, True, 0],
0] +
If[Im[A3] > 0, Which[A1 > 0, +1/2, A1 < Im[-A3], -1/2, True, 0],
0]);
ll = Join[ll, {{A1, A3, t2 - t1}}];
, {ii, 1, 1000}];
Mean[Abs[Chop[(#[[3]] & /@ ll)]]]
Out[182]= 1.00328*10^-13
Now, if we use formula $(3a)$ and go back to our derivation of the original integral we get the following:
\begin{eqnarray}
&&{\mathfrak J}^{(A)}_{B,C}(t) = \\
&&\frac{\pi}{2 B} e^{(A - \imath C/B)^2 \cdot t} \left[ \right. \\
%
&&\left.
\imath \operatorname{erf}[(A - \imath C/B) \sqrt{t}] \operatorname{erfc}[-\imath A \sqrt{t}] + \right. \\
&&\left.
-4 \imath T[\imath A \sqrt{2 t},\imath + \frac{C}{A B}] + \right. \\
&&\left.
-\frac{1}{\pi} \operatorname{Ei}[\frac{t}{B^2} \left(-\operatorname{Im}[C](2 A B + \operatorname{Im}[C])+\operatorname{Re}[C]^2 + 2 \imath \operatorname{Re}[C] (A B + \operatorname{Im}[C]) \right)] \right. \\
&&\left.
-\imath \operatorname{sign}[(A B + \operatorname{Im}[C])\operatorname{Re}[C]] \right. \\
&&\left. +
-4 \imath \left(
\left[ -\frac{1}{2} 1_{-A <0} + \frac{1}{2} 1_{-A > Im[C/B]}\right] \cdot 1_{Im[C] >0} +
\left[ +\frac{1}{2} 1_{-A >0} - \frac{1}{2} 1_{-A < Im[C/B]}\right] \cdot 1_{Im[C] <0}
\right)
\right. \\
&& \left.
\right] \tag{4}
\end{eqnarray}
Again, the code below demonstrates that the result is correct.
In[183]:=
(*Some identity to be used below.*)
ll = {}; mm = 30;
Do[
A = RandomReal[{-2, 2}, WorkingPrecision -> mm];
{t, B} = RandomReal[{1, 2}, 2, WorkingPrecision -> mm];
(*First quarter.*)
CC = RandomComplex[{1/2 (1 + I), 3 (1 + I)}, WorkingPrecision -> mm];
(*Fourth quarter.*)
If[ which > 500, CC = Re[CC] - I Im[ CC]];
val0 = NIntegrate[
Exp[-t (beta - I A)^2] 1/(B beta + CC), {beta, 0, Infinity},
WorkingPrecision -> 15];
Sqrt[Pi]/(B) NIntegrate[
Exp[xi^2 + (-I A - CC/B) 2 Sqrt[t] xi] (Erfc[
xi - I A Sqrt[t]]), {xi, 0, Infinity}];
h =.; b =.; b1 =.; b2 =.; M = 100;
Sqrt[Pi]/(B) 1/2 E^(((A B - I CC)^2 t)/B^2)
Sqrt[\[Pi]] (I Erf[( A B - I CC )/B Sqrt[t]] Erfc[- I A Sqrt[t]] -
I 4 NIntegrate[
1/2 Erf[(I (-Sqrt[2] CC/B Sqrt[t] + xi))/Sqrt[2]] (
E^(-1/2 (+xi)^2))/Sqrt[\[Pi] 2], {xi, -I A Sqrt[t] Sqrt[2],
Infinity}]);
(*+-I {-1,1}*)
val1 = Pi 1/(2 B)
E^((A -
I CC/B)^2 t) (I Erf[(A - I CC/B) Sqrt[t]] Erfc[- I A Sqrt[
t]] + -4 I OwenT[I A Sqrt[2 t], I + CC/(A B)] + -1/
Pi ExpIntegralEi[(
t (-Im[CC] (2 A B + Im[CC]) + Re[CC]^2 +
I 2 Re[CC] (A B + Im[CC])))/B^2] -
I Sign[(A B + Im[CC]) Re[CC]] - 4 I (
If[Im[CC] > 0,
Which[-A < 0, -1/2, -A > Im[CC/B ], 1/2, True, 0], 0] +
If[Im[CC] < 0,
Which[-A > 0, +1/2, -A < Im[CC/B ], -1/2, True, 0], 0]));
tmp = {val0, val1};
ll = Join[ll, {tmp}];
, {which, 1, 1000}];
Mean[Abs[Chop[((#[[2]] - #[[1]]) & /@ ll)]]]
Out[185]= 0
Update:
As a sanity check let us look at the limit of equation $(4)$ when $B \rightarrow 0_+ $. We have:
\begin{eqnarray}
&&{\mathfrak J}^{(A)}_{B,C}(t) \stackrel{B \rightarrow 0_+}{\longrightarrow}
\frac{\pi}{2 B} e^{- \frac{C^2}{B^2} \cdot t} \cdot \left[ \right.\\
&& \left.
\imath \operatorname{erf}\left[ - \imath \frac{C}{B} \sqrt{t} \right]\operatorname{erfc}\left[ -\imath A \sqrt{t}\right] + \right. \\
&& \left. - 4 \imath T\left[ \imath A \sqrt{2 t}, \frac{C}{A B}\right] + \right. \\
&& \left. -\frac{1}{\pi} \operatorname{Ei}\left[\frac{t}{B^2} C^2 \right]\right. \\
&& \left.
\right] \tag{5}
\end{eqnarray}
Now, we are going to argue that it is only the top term that matters in the limit, the two remaining terms disappear. Indeed we have:
First term:
\begin{eqnarray}
\imath \operatorname{erf}\left[ - \imath \frac{C}{B} \sqrt{t} \right]=
\operatorname{erfi}\left[ \frac{C}{B} \sqrt{t}\right] =
\frac{e^{\frac{C^2}{B^2} t}}{\sqrt{\pi} C \sqrt{t}} B (1 + O(B)) \tag{5a}
\end{eqnarray}
Here in the last step we used the asymptotic expansion of the imaginary error function.
Second term:
\begin{eqnarray}
(-4 \imath) T\left[\imath A \sqrt{2 t}, \frac{C}{A B} \right] &=&
(-4 \imath) \frac{e^{A^2 t}}{2 \pi} \cdot \frac{\sqrt{\pi/2}}{\imath A \sqrt{2 t}} \operatorname{erf}\left[ \imath \frac{C}{B} \sqrt{t}\right] \cdot \frac{A^2 B^2}{C^2} (1 + O(\frac{A B}{C})) \\
&=&
(-4 \imath) \frac{e^{A^2 t}}{2 \pi} \cdot \frac{\sqrt{\pi/2}}{ A \sqrt{2 t}} \operatorname{erfi}\left[ \frac{C}{B} \sqrt{t}\right] \cdot \frac{A^2 B^2}{C^2} (1 + O(\frac{A B}{C})) \\
&=&
(-4 \imath) \frac{e^{A^2 t}}{2 \pi} \cdot \frac{\sqrt{\pi/2}}{ A \sqrt{2 t}}
%
%\operatorname{erfi}\left[ \frac{C}{B} \sqrt{t}\right]
\frac{e^{\frac{C^2}{B^2} t}}{\sqrt{\pi} C \sqrt{t}}
%
\cdot \frac{A^2 B^3}{C^2} (1 + O(\frac{A B}{C})) \tag{5b}
\end{eqnarray}
Here in the first step we used the asymptotic expansion of the Owen's T function, i.e. the one that is obtained by integrating by parts the definition $T(h,a)=\frac{1}{2\pi}\int_{0}^{a} \frac{e^{-\frac{1}{2} h^2 (1+x^2)}}{1+x^2} dx$ where $v = 1/(1+x^2)$ and $u^{'} = e^{-\frac{1}{2} h^2 x^2}$. Then in the second step we introduced the imaginary error function and in the last step we used the asymptotic expansion of the later function.
Third term:
\begin{eqnarray}
-\frac{1}{\pi} \operatorname{Ei}\left[\frac{t}{B^2} C^2\right] &=&
-\frac{1}{\pi} \cdot \frac{e^{\frac{C^2}{B^2} t}}{t C^2} B^2 (1 + O(B)) \tag{5c}
\end{eqnarray}
Here we used the asymptotic expansion of exponential integral .
As we can see the first, the second and the third term are of the order one, three and two in the variable $B$ respectively and as such it is only the first term that survives.
Bringing everything together we get:
\begin{eqnarray}
&&{\mathfrak J}^{(A)}_{B,C}(t) \stackrel{B \rightarrow 0_+}{\longrightarrow}
\frac{\sqrt{\pi}}{2 C \sqrt{t}} \cdot \operatorname{erfc}\left[ - \imath A \sqrt{t} \right]
\end{eqnarray}
as expected.
Update 1:
The formula $(4)$ given above is only valid for $Re[C] >0 $. Below, we give the result in case $Re[C] <0 $. The derivation is very similar to the one given in the body of the question except that the first step, i.e. the step from the first to the second line, slightly differs. The result reads:
\begin{eqnarray}
&&{\mathfrak J}^{(A)}_{B,C}(t) = \frac{\pi}{2 B} \cdot e^{(A- \imath \frac{C}{B})^2 t} \left[ \right.\\
%
&&
\left(
\text{erfc}\left(i \sqrt{t} \left(A+i
b_*\right)\right)
-\text{erfc}\left(i A \sqrt{t}\right)\right)
\text{erfi}\left(\frac{\sqrt{t} (C+i A
B)}{B}\right)
-\text{erfc}\left(\sqrt{t} \left(b_*-i
A\right)\right) \text{erfi}\left(\frac{\sqrt{t} (-C-i A
B)}{B}\right)+ \\
%
&&\left.
+T\left[(\imath A - b_*) \sqrt{2 t}, \imath, \imath (b_* + \frac{C}{B}) \sqrt{2 t} \right] +
\right. \\
&& \left.
-T\left[\imath A \sqrt{2 t}, \imath, \imath \frac{C}{B} \sqrt{2 t} \right] +
\right. \\
&& \left.
-T\left[(-\imath A + b_*) \sqrt{2 t}, \imath, \imath (-b_* - \frac{C}{B}) \sqrt{2 t} \right]
\right. \\
&&\left.
\right]
\end{eqnarray}
where $b_* := -\operatorname{Re}[C]/B$ and $T\left[h,a,b\right]$ is the generalized Owen's T function as defined in here. That function in question reduces, in this particular case, to the ordinary Owen's T function, the exponential integral and a sign term as expounded in the link above.
In[1030]:= (*Now we find the formula in question when Re[C] < 0 *)
mm = 30; mm1 = 10;
A = RandomReal[{-2, 2}, WorkingPrecision -> mm];
{t, B} = RandomReal[{1, 2}, 2, WorkingPrecision -> mm];
(Third or Second quarter.)
CC = -RandomComplex[{1/2 (1 + I), 3 (1 + I)}, WorkingPrecision -> mm];
bs = -Re[CC]/B;
ll = {};
Do[
CC = Re[CC] + eta I Im[CC];
val0 = NIntegrate[
Exp[-t (beta - I A)^2] 1/(B beta + CC), {beta, 0, Infinity},
WorkingPrecision -> mm1];
(*
1/(beta B + CC) = - Integrate[Exp[xi (beta B+CC)],{xi,0,
Infinity}] 1_{beta < bs} + Integrate[Exp[-xi (beta B+CC)],{xi,0,
Infinity}] 1_{beta > bs}
)
val1 = Sqrt[[Pi]] /
B NIntegrate[
E^((2 (I A B + CC) Sqrt[t] xi)/B +
xi^2) (Erfc[I A Sqrt[t] + xi] -
Erfc[I A Sqrt[t] - bs Sqrt[t] + xi]) +
E^((2 (-I A B - CC) Sqrt[t] xi)/B +
xi^2) (Erfc[-I A Sqrt[t] + bs Sqrt[t] + xi]), {xi, 0,
Infinity}, WorkingPrecision -> mm1];
(By parts.*)
val2 = [Pi] /(2 B)
E^((A -
I CC/B)^2 t) (-Erfc[(-I A + bs) Sqrt[
t]] Erfi[((-I A B - CC) Sqrt[t])/
B] + (-Erfc[I A Sqrt[t]] +
Erfc[I (A + I bs) Sqrt[t]]) Erfi[((I A B + CC) Sqrt[t])/B] +
(*T[(I A -bs) Sqrt[2t],I,I (bs+CC /B)Sqrt[2t]]*)
4 I NIntegrate[
1/2 Erf[I (bs + CC /B) Sqrt[t] + I xi/Sqrt[2]] E^(-((+xi)^2/
2))/Sqrt[2 Pi], {xi, (I A - bs) Sqrt[2 t], Infinity},
WorkingPrecision -> mm1] +
(*-T[(I A) Sqrt[2t],I,I (CC /B)Sqrt[2t]]*)
4 I NIntegrate[ - (1/2) Erf[I (CC Sqrt[t])/B + I xi/Sqrt[2]] (
E^(-((+ xi)^2/2)))/Sqrt[2 Pi], {xi, I A Sqrt[2 t], Infinity},
WorkingPrecision -> mm1] +
(*-T[(-I A +bs) Sqrt[2t],I,I (-bs-CC /B)Sqrt[2t]]*)
4 I NIntegrate[ - (1/2) Erf[
I (-bs - CC /B) Sqrt[t] + I xi/Sqrt[2]] E^(-((+xi)^2/2))/
Sqrt[2 Pi], {xi, (-I A + bs) Sqrt[2 t], Infinity},
WorkingPrecision -> mm1]);
ll = Join[ll, {{Abs[val0/val1 - 1], Abs[val1/val2 - 1]}}];
, {eta, -1, 1, 2}];
ll
Out[1037]= {{2.010^-8, 2.010^-8}, {2.010^-8, 2.010^-8}}
\operatorname{name}
to get the proper font and spacing for operators like $\operatorname{Re}, \operatorname{Im}, \operatorname{erfc}, \ldots$. – joriki Jan 09 '23 at 20:48