$\int_{-\infty}^{+\infty} dx \, \frac{e^{-x^2}}{x-i} $ I want to know how to compute the following integral:
$$\int_{-\infty}^{+\infty} dx \, \frac{e^{-x^2}}{x-i} \, .$$
Mathematica gives
$$i \, e \, \pi \, \text{erfc(1)} \, ,$$
but I don't know how to calculate it. I think contour integral does not work, because $e^{−z^2}$ does not vanish at $\pm i \infty$. One could take $e^{−|z|^2}$, but then it's not holomorphic. One can expand the exponential in series, but then each of the integrals one gets is divergent. Any ideas?
 A: Since $\frac{1}{x-i} = \frac{x}{x^2+1}+ i\frac{1}{x^2+1}$  and $ \frac{xe^{-x^2}}{x^2+1}$ is odd we get
$$
\int_{-\infty}^{\infty}  \frac{e^{-x^2}}{x-i} \, \mathrm{d}x =i \int_{-\infty}^{\infty}  \frac{e^{-x^2}}{x^2+1} \, \mathrm{d}x
$$
and using that $\int_{-\infty}^{\infty} \frac{e^{-x^2}}{x^2 + \xi}\, \mathrm{d}x =\frac{\pi}{\sqrt{\xi}} e^{\xi} \mathrm{erfc}\left(\sqrt{\xi}\right), \, \text{for} \, \xi >0\,
$  your result follows.
A: You can also use the Parseval–Plancherel identity to get the answer. If we define Fourier transform as $\displaystyle \hat f(k)=\int_{-\infty}^\infty f(x)e^{ikx}dx$, then
$$I=\int_{-\infty}^\infty f(x)g^*(x)dx=\frac{1}{2\pi}\int_{-\infty}^\infty \hat f(k)\hat g^*(k)dk$$
In our case $\displaystyle f(x)=\frac{1}{x-ia} \,(a>0); \,\,g(x)=e^{-x^2}$
$$\hat f(k)=\int_{-\infty}^\infty \frac{e^{ikx}}{x-ia}dx$$
For $k>0$ we close the contour in the upper half-plane
$$\hat f(k)=2\pi i \underset{x=ia}{\operatorname{Res}}\frac{e^{ikx}}{x-ia}=2\pi ie^{-ka}$$
For $k<0$ we close the contour in the lower half-plane and get zero (there are no poles there)
$$\hat f(k)=0;\,\, k<0$$
$$\hat g(k)=\int_{-\infty}^\infty e^{-x^2}e^{ikx}dx=\int_{-\infty}^\infty e^{-(x-ik/2)^2}e^{-k^2/4}dx=\sqrt\pi e^{-\frac{k^2}{4}}$$
Then
$$I(a)=\frac{2\pi i\sqrt\pi}{2\pi}\int_0^\infty e^{-\frac{k^2}{4}-ka}dk\overset{k=2t}{=}2i\sqrt\pi\int_0^\infty e^{-(t+a)^2}e^{a^2}dt=\pi ie^{a^2}\operatorname{erfc}(a)$$
