Expressing $\int_0^{+ \infty}\frac{\mathrm{e}^{- t^2} \mathrm{d} t}{z^2 - t^2}$ with the error function (complex analysis or Fubini theorem ?) I would like to show the following (Abrahomitz et Stegun) for any $z\in\mathbb{C}, \Im(z)>0$,
$$
     \mathrm{e}^{- z^2} \left( 1 + \frac{2 i}{\sqrt{\pi}} \int_0^z
     \mathrm{e}^{t^2} \mathrm{d} t \right) = \frac{2 iz}{\pi} \int_0^{+ \infty}
     \frac{\mathrm{e}^{- t^2} \mathrm{d} t}{z^2 - t^2} \quad, \Im (z) > 0\\
$$
I tried two methods so far:

*

*Evaluating the integral on the right with the help of complex analysis, I didn't manage to make this work as I couldn't use Jordan Lemma because of divergence of $\mathrm{e}^{-R^2(\cos(2\theta)+i\sin(2\theta))}$ for large $R$


*Expressing the integrand in RHS$\times \mathrm{e}^{z^2}$ as an integral and applying Fubuni theorem:
\begin{align} \int_0^{+ \infty} \int_{- \infty}^1 \mathrm{e}^{- a (t^2 - z^2)} \mathrm{d} a
     \mathrm{d} t = \int_{- \infty}^1 \mathrm{e}^{az^2} \int_0^{+ \infty} \mathrm{e}^{-
     at^2} \mathrm{d} t \mathrm{d} a \end{align}
Then using expression for Gaussian integral and splitting the $]-\infty;1]$ into $]-\infty;0]$ and $]0;1]$:
\begin{align} \frac{1}{2} \int_{- \infty}^1 \mathrm{e}^{az^2} \sqrt{\frac{\pi}{a}} \mathrm{d} a
     = \frac{\sqrt{\pi}}{2} \left( \int_{- \infty}^0
     \frac{\mathrm{e}^{az^2}}{\sqrt{a}} \mathrm{d} a + \int_0^1
     \frac{\mathrm{e}^{az^2}}{\sqrt{a}} \mathrm{d} a \right) \end{align}
With substitution and using Gaussian formula again I get the good result, but then I realized ... there is a problem in writing:
$$   \frac{\mathrm{e}^{- (t^2 - z^2)}}{z^2 - t^2} = \int_{- \infty}^1 \mathrm{e}^{- a
     (t^2 - z^2)} \mathrm{d} a $$ as we don't have:
$$   \lim_{a \rightarrow - \infty} \mathrm{e}^{- a (t^2 - z^2)} = 0 $$
How can I conclude ? Thanks.
 A: Long comment, hints, trials.
The method I suggest is to use Parseval-Plancherel's identity, that is:
$$\int_{-\infty}^{+\infty} f(t) g(t)\ \text{d}t = \int_{-\infty}^{+\infty}\hat{f(t)}\hat{g(t)}\ \text{d}t$$
Where the hat means Fourier Transform.
Notice the integrand is even, so you can write it as
$$\frac{iz}{\pi}\int_{-\infty}^{+\infty} e^{-t^2}\frac{1}{z^2-t^2}\ \text{d}t$$
Now it's suitable to use the above identity. There will be some calculation to do, but I think you will be able to perform it on your own. First of all:
$$\hat{f(t)} = \text{Fourier Transform of} \quad e^{-t^2} \longrightarrow \frac{e^{-\frac{s^2}{4}}}{\sqrt{2}}$$
This wa easy. The hardest part is the other one.
$$\hat{g(t)} = \text{Fourier Transform of} \quad \frac{1}{z^2-t^2} \longrightarrow -\frac{i \sqrt{\frac{\pi }{2}} e^{-i s z} \text{sgn}(\Im(z)) \left(\theta (-s\ \text{sgn}(\Im(z)))+e^{2 i s z} \theta (s\ \text{sgn}(\Im(z)))\right)}{z}$$
$\theta$ stands for Heaviside generalised function; $\text{sgn}$ is the signum function. Since the imaginary part of $z$ is positive, the signum function is defined, and this term is rather simple in the end, but I will leave it written for the sake of completeness.
This brings us to
$$- \frac{iz}\pi \int_{-\infty}^{+\infty}\frac{e^{-\frac{s^2}{4}}}{\sqrt{2}}\cdot \frac{i \sqrt{\frac{\pi }{2}} e^{-i s z} \text{sgn}(\Im(z)) \left(\theta (-s\ \text{sgn}(\Im(z)))+e^{2 i s z} \theta (s\ \text{sgn}(\Im(z)))\right)}{z}\ \text{d}s$$
The integral itself gives
$$ e^{-z^2} (1+i \text{erfi}(z)) \quad \Im(z)>0 $$
Where $\text{erfi}$ is the imaginary error function:
$$\text{erfi}(z) = -i\ \text{erf} (iz) = \frac{2}{\sqrt{\pi}} \int_0^{z} e^{t^2}\ \text{d}t$$
From which the wanted result.
