I want to solve:
$$ \int_{-\infty}^{\infty} \frac{e^{-x^2}}{(x + jp)^M (x - jp)^M } dx$$
where $M \in \mathbb{Z}_{++}$ is even. To start, I create a square contour $\Gamma$ in the upper-half plane: $[-R, R], [R, R+ja], [R+ja, -R+ja], [-R+ja, -R]$, where $a > p$ and $p \in \mathbb{R}_{++}$. Thus I have:
$$ \int_{\Gamma} f(z) dz = \int_{\Gamma} \frac{e^{-z^2}}{(z + jp)^M (z - jp)^M } dz = \left[ \int_{-R}^{R} + \int_{R}^{R + ja} + \int_{R+ja}^{-R + ja} + \int_{-R + ja}^{-R} \right] \frac{e^{-z^2}}{(z + jp)^M (z - jp)^M } dz$$
where $ \int_{\Gamma} f(z) dz = \text{Res}_{f(z)}\left( z = jp \right)$ and I will let $R \rightarrow \infty$.
It is easy to show that $ \left[ \int_{R}^{R + ja} + \int_{-R + ja}^{-R} \right] \left( \cdot \right) = 0 $. We just let $z = \pm r + jb$, respectively, for $b \in [0, a]$, and we get a $e^{-R^2}$ term in front of the integrals, which goes to zero as R goes to infinity.
I am having problems with the integral $\int_{R+ja}^{-R + ja} \frac{e^{-z^2}}{(z + jp)^M (z - jp)^M } dz$ however. Letting $z = r+ j\alpha$ for $r \in [-R, R]$ doesn't seem to do it.
Questions:
- How can I compute $\int_{R+ja}^{-R + ja} \frac{e^{-z^2}}{(z + jp)^M (z - jp)^M } dz$?
- Am I correct that I can use the residue theorem here, as I have done it?
Edit: I am a complete n00b so please be patient and explain like I am five.
Edit2: For the entire integral, mathematica gives me $\sqrt{\pi} \cdot \text{HypergeometricU}\left[M, M + \frac{1}{2}, p^2 \right]$
There's nothing to expect for the residue theorem to yield here (especially since a CAS reports special functions in the answer). But there is another (perhaps easier) approach: $$f_n(a):=\int_{-\infty}^\infty(a+x^2)^{-n-1}e^{-x^2}\,dx=\frac{(-1)^n}{n!}\frac{d^n}{da^n}f_0(a)$$ for $a>0$, and $f_0(a)=e^a g(a,1)$, where for $t\geqslant 0$
\begin{align*} g(a,t)&=\int_{-\infty}^\infty\frac{e^{-t(a+x^2)}}{a+x^2}\,dx=\int_{-\infty}^\infty\int_t^\infty e^{-y(a+x^2)}\,dy\,dx \\&=\int_t^\infty e^{-ay}\int_{-\infty}^\infty e^{-yx^2}\,dx\,dy=\sqrt\pi\int_t^\infty e^{-ay}\frac{dy}{\sqrt y} \\&=2\sqrt{\frac\pi a}\int_{\sqrt{at}}^\infty e^{-x^2}\,dx=\frac{\pi}{\sqrt a}\operatorname{erfc}\sqrt{at}. \end{align*}
The given integral is $f_{M-1}(p^2)$.