How to calculate this PV complex integral? $$P.V. \int_{-\infty}^{\infty}\frac{xe^{ix}}{x^2-\pi^2}.dx$$
I find this a challenging integral to solve. I tried solving by extending to the complex plane and integrating over a semicircle contour (real axis, but infinitesimally small hoops (radii $\rho$) around points $x=-\pi$ and $x=\pi$,  plus the arc $Re^{i\phi}$, $\phi \in [0,\pi]$), but this leads me nowhere as i find that the integral on all of the three arcs vanishes, in the limit $R->\infty$, $\rho ->0$ .
 A: You may define a contour that looks like $\mathcal{C}=[-R,-\varepsilon]\cup\varepsilon e^{i[-\pi-\varepsilon,-\pi+\varepsilon]}\cup \varepsilon e^{i[-\varepsilon,\varepsilon]}\cup\varepsilon e^{i[\pi-\varepsilon,\pi+\varepsilon]}\cup [\varepsilon,R]\cup Re^{i[-R,R]}$.
$$\oint_\mathcal{C}=\int_{-R}^{\varepsilon}+\int_{-\varepsilon}^{\varepsilon}+\int_{-\varepsilon}^{R}+\int_{-R}^{R}+\int_{-\pi-\varepsilon}^{-\pi+\varepsilon}+\int_{\pi-\varepsilon}^{\pi+\varepsilon}.$$
Note that the sum of the first and the third path intergals correspond your integral, wheras he second and the fourth one go to zero, if you let $R\to\infty$ and $\varepsilon\to0$. This can be easily proven by the ML-inequality and Jordans Lemma. Now you just have to find the other two semicircles that will give you $\pm i\pi$ if you parametrize them correctly:
with
$$x=\pm\pi+\varepsilon e^{i\varphi}.$$
Also not that the integral over $\mathcal{C}$ equals zero.
A: Problem resolved. As @Svyatoslav mentioned (thank you kindly), the integrals over the two hoops do not vanish.
These integrals can be evaluated by rewriting $f(z)$ (after coordinate transformation of $z'= z \pm \pi$)  as $\frac{1}{z} g(z)$, where $g(z)$ is analytic in the relevant domain and can therefore be written as a power series:
$$\int f(z) dz = \int \frac{1}{z}(a_0 + a_1z + a_2z^2 ... ) dz = \int \frac{a_0}{z}dz +\int (a_1 + a_2z + a_3z^2 ... ) dz  $$
In the limit of radius $\rho$ approaching $0$, the latter integral vanishes (as the begining point and end point of the path of integration overlap). The integral that remains can be easily evaluated:
$$\int \frac{a_0}{z} dz = i\int_{\pi}^{0} a_0 dt.$$
