# Does $\int_{-\infty}^{\infty}{\frac{\mathrm{exp}(-t^2)}{t-iz} dt}=i \sqrt{\pi} e^{z^2} \mathrm{erfc}(z)$ hold for all $z$?

I have been working on a calculation that involves the following type of integral:

$$f(z)={\frac{1}{i\sqrt{\pi}}}\int_{-\infty}^{\infty}{\frac{e^{-t^2}}{t-iz} dt} \hspace{1.5cm} z \in \Bbb{C} \hspace{3cm} \rm{[1]}$$

typically this integral is represented as

$$f(z)=e^{z^2}(1-\mathrm{erf}[z]) \hspace{5cm} \rm{[*]}$$

But is this representation valid for any $z$?

Here are the results I have obtained thus far.

One can find that the integral (1) satisfies this ODE:

$$\frac{\partial f}{\partial z}=-2+2zf \hspace{4cm} \rm{[2]}$$

So, if this ODE has a unique solution, an expression for $f(z)$ will be found by integrating it and applying the appropriate initial condition.

[2] has a solution

$$f(z)=e^{z^2} \left( e^{-z_0 ^2} f(z_0) -2\int_{z_0}^{z}{e^{-t^2} dt} \right) \hspace{3cm} \rm{[3]}$$

Now, what I am less confident about is how to calculate the initial conditions from 1. But here are my attempts:

(a) take $z_0=0$ ; in that case I get $f(0)=2\sqrt{\pi}$ leading to

$$f(z)=\sqrt{\pi}e^{z^2}(2-\mathrm{erf}[z]) \hspace{4cm} \rm{[4a]}$$

which is not the same as [$*$]

(b) If letting $|z_0| \rightarrow -\infty$ implies $e^{-z_0^2}f(z_0)\rightarrow 0$ then [3] becomes

$$f(z)=\sqrt{\pi}e^{z^2}(1-\mathrm{erf}[z]) \hspace{4cm} \rm{[4b]}$$

which is more similar to [$*$] but still different to a factor of $\sqrt{\pi}$

So what is the problem? is [$*$] in fact incorrect? Which one (of [4a] and [4b]) is correct? And is any of them valid for all $z$?

Okay, I think I've got it. The solution to your integral is likely $$f(z)=\sqrt{\pi}e^{z^2}(\operatorname{sgn}(\operatorname{Re}(z)) - \operatorname{erf}(z) ).$$ To see this, let first $\operatorname{Im}(z)=:v> 0$ and denote $z=u+iv$.

First, note that $$\int_{-\infty}^\infty \frac{e^{-t^2}dt}{t+z}= e^{-z^2} \int_{-\infty+iv}^{\infty+iv} \frac{e^{-t^2+2t(u+iv)}dt}{t}=:e^{-z^2} I(u,v)$$ via substitution. Differentiating $I(u,v)$ with respect to $u$ yields $$\frac{\partial I(u,v)}{\partial u} = 2\int_{-\infty+iv}^{\infty+iv} e^{-t^2+2t(u+iv)}dt=2e^{-v^2+2iuv}\int_{-\infty}^{\infty} e^{-t^2+2ut}dt$$ via substition. Using the fact that $\int_{-\infty}^\infty e^{-t^2+2at}dt = \sqrt{\pi} e^{a^2}$, it follows that $$\frac{\partial I(u,v)}{\partial u}=2\sqrt{\pi}e^{(u+iv)^2}.$$ Therefore, $$I(u,v)=2\sqrt{\pi}\int_0^u e^{(t+iv)^2}dt + g(v)=2\sqrt{\pi}\int_{iv}^{u+iv} e^{t^2}dt + g(v).$$ (Note that $g$ may depend on $v$.)

Setting $u=0$, it is clear that $$g(v)=I(0,v)=\int_{-\infty+iv}^{\infty+iv} \frac{e^{-t^2+2tiv}dt}{t}.$$ Using again differentation under the integral (while being cautious that the limit involves $v$, which is no big deal since it vanishes in the limit), we arrive at $$\frac{\partial I(0,v)}{\partial v}=2i\sqrt{\pi}e^{-v^2}.$$ Thus, $$g(v)= 2i\sqrt{\pi}\int_0^v e^{-t^2}dt + C,$$ and $$I(u,v)=2\sqrt{\pi}\int_{iv}^{u+iv} e^{t^2}dt +2i\sqrt{\pi}\int_0^v e^{-t^2}dt + C$$ where $C$ is some constant. Via substitution, $$I(u,v)=2\sqrt{\pi}i\left(\int_{v}^{v-iu} e^{-t^2}dt + \int_0^v e^{-t^2}dt\right) + C =2\sqrt{\pi}\int_0^{u+iv} e^{t^2}dt+C.$$

We now have to calculate the value of $C$. First, note that $$\lim_{v\to\infty} I(0,v)=\lim_{v\to\infty} \pi i \operatorname{erf}(v)+C=\pi i + C.$$ Second, $$\lim_{v\to\infty} I(0,v)= \lim_{v\to\infty} \int_{-\infty}^{\infty} \frac{e^{-(t^2+v^2)}dt}{t+iv}=0.$$ Thus, $C=-\pi i$ and, finally, $$I(u,v)=2\sqrt{\pi}\int_0^{u+iv} e^{t^2}dt - \pi i.$$

For $\operatorname{Im}(z)=v< 0$, the derivation is completely analogous except $$\lim_{v\to -\infty} I(0,v)=\lim_{v\to -\infty} \pi i \operatorname{erf}(v)+C=-\pi i + C.$$ In this case $C=-\pi i$.

For $\operatorname{Im}(z)=v= 0$, note that the Cauchy principal value of $g(0)=0$. Analogous reasoning as above yields $C=0$.

To sum up, it follows that $$I(u,v)=2\sqrt{\pi}\int_0^{u+iv} e^{t^2}dt - \operatorname{sgn}(v) \pi i,$$ and $$\int_{-\infty}^\infty \frac{e^{-t^2}dt}{t+z}=e^{-z^2}\left(2\sqrt{\pi}\int_0^{z} e^{t^2}dt - \operatorname{sgn}(\operatorname{Im}(z)) \pi i\right).$$

Finally, turning to your integral: \begin{align} \frac{1}{i\sqrt{\pi}} \int_{-\infty}^\infty \frac{e^{-t^2}dt}{t-iz}&= -i e^{z^2} \left(2\int_0^{-iz} e^{t^2}dt - \operatorname{sgn}(\operatorname{Im}(-iz)) \sqrt{\pi} i\right)\\ &= -e^{z^2} \left(\sqrt{\pi} \operatorname{erf}(z) - \operatorname{sgn}(\operatorname{Re}(z)) \sqrt{\pi}\right)\\ &= e^{z^2} \sqrt{\pi} \left( \operatorname{sgn}(\operatorname{Re}(z)) - \operatorname{erf}(z))\right) \end{align}

This is quite similar to your original conjecture that $f(z)=e^{z^2} \left(1 - \operatorname{erf}(z))\right)$. Obviously, the answer seems to be that your your formula (despite the missing $\pi$) holds for all $z$ with $\operatorname{Re}(z)>0$.

• Interesting, I will have a closer look. I generally followed the method given in here but then I arrive at contradictory results, which implies that something must be wrong. – JMK Jul 21 '14 at 17:56
• @JMK I totally revised my result and gave a new proof. This time, it seems to be correct, I guess. – Dumdi44 Jul 23 '14 at 17:36
• Yes, I was going to say that it seemed conspicuous that in the original answer the substitution didn't shift the integration limits on the complex plane - it seems fine now though. I did btw take the original formula from Abramowitz & Stegun and also DMLF , so I didn't just pull it out of a hat - or rather I used some 'reputable' sources. But for this and other related functions, there seems to be differences in the formulae on different quadrants of the complex plane, and I wanted to gt to the bottom of them :) – JMK Jul 23 '14 at 19:39