Prove that $\int\limits_{0}^{\infty} \frac{\sin x}{x(1+x^2)^2}dx = \frac{\pi(2e-3)}{4e}$.
There goes an extension of Cauchy's residue theorem that states if a finite number of poles lie directly on the contour $C$, then $\oint_C f(z)dz = 2\pi i \sum R^+ + \pi i \sum R^0$, where $\sum R^+$ denotes sum of residues at poles on the positive side of the contour and $\sum R^0$ denotes sum of residues at poles lying directly on the contour.
Here at the problem, at first I converted the integral $\oint_C \frac{e^{iz}}{z(z^2+1)^2}$ where $C$ is positive semicircular contour indented at $0$. Clearly the pole directly on the contour is $z=0$ and that one on the positive side being $z=i$ which is of order $2$. So calculating the residues at those poles and using the above extension and comparing imaginary parts on both sides should give us the correct result. But this isn't. Can someone explain why?