TITLE: Contour integration problem
QUESTION [5 upvotes]: I am to evaluate $\displaystyle\int_0^{\infty} \dfrac{\sin x}{x(x^2+1)}dx$ via contour integration.
Now I used an indented semicircular contour, and the parts lying on the real line and the big arc were no problem, but the small arc is being resistant, and I'm not sure what to do. Usually, on the small arc from $-\varepsilon$ to $\varepsilon$ I can take a laurent expansion of the integrand, and consider integrating its principle part over the arc, letting the rest go to zero in the limit $\varepsilon \to 0$ as the "holomorphic part". My issue is this particular integrand doesn't have a principle part...
The end result is $\dfrac{(e-1)\pi}{2e}$, and so far I have the integral over the whole contour as $\dfrac{-\pi i}{e}$ (I'm not sure why this came out imaginary..) so this part is going to have to contribute something. What should I do to get something out?

REPLY [3 votes]: Define
$$f(z)=\frac{e^{iz}}{z(z^2+1)}\;,\;\;C_R:=[-R,-\epsilon]\cup\gamma_\epsilon\cup[\epsilon,R]\cup\gamma_R\;\;,\;\;\text{with}$$
$$\gamma_a:=\{z=ae^{it}\;,\;\;a,t\in\Bbb R_+\;,\;\;0<t<\pi\}$$
Then the function has one simple pole within the domain defined by the above contour:
$$\text{Res}_{z=i}(f):=\lim_{z\to i}\,(z-i)f(z)=\lim_{z\to i}\frac{e^{iz}}{z(z+i)}=\frac{e^{-1}}{-2}=-\frac1{2e}$$
Thus, by Cauchy's theorem:
$$-\frac{\pi i}e=-2\pi i \frac1{2e}=\oint\limits_{C_R}f(z)dz=\int\limits_{-R}^{-\epsilon}f(x)dx-\int\limits_{\gamma_\epsilon}f(z)dz+\int\limits_\epsilon^Rf(x)dx+\int\limits_{\gamma_R}f(z)dz$$
By Jordan's Lemma, the last integral above tends to zero when $\;R\to\infty\;$ , while the second equals $\;\pi i\;$ when $\;\epsilon\to 0\;$ by the corollary below the lemma in the answer here:Definite integral calculation with poles at 0 and $\pm i\sqrt{3}$  and because
$$\text{Res}_{z=0}(f):=\lim_{z\to 0}\,zf(z)=\lim_{z\to 0}\frac{e^{iz}}{(z^2+1)}=1$$
Thus, we get passing to the limit $\;R\to\infty\;,\;\;\epsilon\to 0\;$ :
$$-\frac{\pi i}e=\int\limits_{-\infty}^\infty\frac{e^{ix}}{x(x^2+1)}dx-\pi i\implies\ldots$$
Now just take imaginary parts and take into account the real integrand function is even.