Improper integral; exponential divided by polynomial How can I evaluate $$\int_{-\infty}^\infty {\exp(ixk)\over -x^2+2ixa+a^2+b^2} dx,$$ where $k\in \mathbb R, a>0$? Would Fourier transforms simplify anything? I know very little about complex analysis, so I am guessing there is a rather simple way to evaluate this? Thanks.
 A: You can evaluate this using the residue theorem. The integrand has simple poles at $x_\pm=\mathrm ia\pm b$ (which you can find by setting the denominator zero and solving the quadratic equation). You can find the residues at the poles by multiplying the integrand by $x-x_\pm$ and then substituting $x_\pm$, which yields
$$\left.-\frac{\exp(\mathrm ixk)}{x-(\mathrm ia\mp b)}\right|_{x=\mathrm ia\pm b}=\mp\exp(-ka)\frac{\exp(\pm\mathrm ikb)}{2b}\;.$$
If $k\gt 0$, You can complete the integral by a half circle at infinity in the upper half-plane (which contains the poles), since the integrand decays quadratically with $x\to\pm\infty$ and exponentially with $x\to\mathrm i\infty$, so the contribution from this half circle vanishes. Thus by the residue theorem the given integral is $2\pi\mathrm i$ times the sum of the residues, that is,
$$2\pi\mathrm i\left(-\exp(-ka)\frac{\exp(\mathrm ikb)}{2b}+\exp(-ka)\frac{\exp(-\mathrm ikb)}{2b}\right)=2\pi\exp(-ka)\frac{\sin(kb)}b\;.$$
If $k\le0$, you can complete the integral by a half circle at infinity in the lower half-plane, since the integrand decays quadratically (or exponentially for $k\lt0$) and the perimeter of the half circle increases linearly. There are no poles in the lower half-plane, so in this case the integral is zero.
A: Assume $b \neq 0$ and $k\neq 0$. 
Write
 $\dfrac{\exp(ixk)}{-x^2+2iax+a^2+b^2}= \dfrac{\exp(ixk)}{-(x-ia)^2+b^2}=\dfrac{\exp(i(x-ia)k)}{-(x-ia)^2+b^2} \exp(-ak)$ hence 
the integral becomes $I=\int_{-\infty}^\infty \dfrac{\exp(i(x-ia)k)}{-(x-ia)^2+b^2} \exp(-ak)dx=\int_{-\infty-ia}^{\infty -ia} \dfrac{\exp(izk)}{-z^2+b^2} \exp(-ak)dz$ on the contour the straight line parallel the $x$-axis and intercepting the $y$-axis (imaginary) at $-ia$.
 We need to close the contour by a great semicircle in the upper half plane if $k>0$ and in this case there are two poles at $z=b$ and $z=-b$ enclosed in the contour. 
Now we will use the residue theorem. The poles of the fraction $\dfrac{\exp(izk)}{-z^2+b^2}$ are $-b,+b$ and then the integral will be $I=(2\pi i)\exp(-ak)\lbrace Res(z=b)\exp(ibk)+Res(z=-b)\exp(-ibk)\rbrace$.
 Now observe that $Res(z=b)=1/2b$ and $Res(z=-b)=-1/2b$ hence $I=2 \pi i \exp(-ak) \frac{\sin bk}{b}$.
 If $k<0$ then we close the contour by a semicircle in the lower halfplane and in this case there are no poles enclosed and so the integral becomes zero.
Now assume $b=0$ and $K\neq 0$: in this case the residue (at $z=0$) becomes $-ik$ and the integral becomes $2\pi k$ (if $k>0$) and $0$ if $k<0$.
Finally let $k=0$: then in this case the result will be easy and I leave it for you as an exersice.
