Complex Integration poles real axis In class my professor said that
$$
\int_{-\infty}^{\infty}\frac{e^{iax}}{x^2 - b^2}dx = -\frac{2\pi}{b}\sin(ab)
$$
where $a,b &gt; 0$.
However, since the poles are on the real axis, isn't the integral equal to
$$
\pi i\sum_{\text{real axis}}\text{Res}(f(z); z_j)\mbox{?}
$$
If that is the case, the integral is
$$
-\frac{\pi}{b}\sin(ab).
$$
Define

$$f(z):=\frac{e^{iaz}}{z^2-b^2}\;,\;a,b\in\Bbb R^+\;,$$

$$C_R:=[-R,-b-\epsilon]\cup\gamma_{-b,\epsilon}\cup[-b+\epsilon,b-\epsilon]\cup\gamma_{b\epsilon}\cup[b+\epsilon,R]\cup\Gamma_R$$

with

$$\gamma_{r,s}:=\{r+se^{it}\;;\;0\le t\le \pi\}\;,\;r,s\in\Bbb R^+\;,\;\Gamma_R:=\{Re^{it}\;;\;0\le t\le \pi\}\;,\;\;R\in\Bbb R^+$$

Since $\;f(z)\;$ analytic on and within $\;C_R\;$ , we get

$$\oint\limits_{C_R}f(z)\,dz=0$$

By the corollary to the lemma in the second answer here we get

$$\begin{align*}\lim_{\epsilon\to 0}\int\limits_{\gamma_{-b,\epsilon}}f(z)dz&amp;=i\pi\,\text{Res}\,(f)_{z=-b}=i\pi\frac{e^{-iab}}{-2b}=-\frac{\pi i}{2b}e^{-iab}\\
\lim_{\epsilon\to 0}\int\limits_{\gamma_{b,\epsilon}}f(z)dz&amp;=i\pi\,\text{Res}\,(f)_{z=b}=i\pi\frac{e^{iab}}{2b}=\frac{\pi i}{2b}e^{iab}\end{align*}$$

And applying Jordan's Lemma the integral on $\;\Gamma_R\;$ goes to zero when $\;R\to \infty\;$ , so in the end

$$0=\lim_{R\to\infty\,,\,\epsilon\to 0}\oint\limits_{C_R}f(z)dz=\int\limits_{-\infty}^\infty f(x)dx-\frac{\pi i}{2b}\left(e^{iab}-e^{-iab}\right)\implies$$

$$\implies \int\limits_{-\infty}^\infty f(x)dx=-\frac\pi b\frac{e^{iab}-e^{-iab}}{2i}=-\frac\pi b\sin(ab)$$

and I get the same as you did...
This integral is unsolvable in real domain, because the singularities are not removable so integral should diverge.but you can take contours in complex plane which connect negative and positive infinitis and then you get the above result.