I need to show that
$$\int_{-\infty}^\infty\frac{\sin^2(x)}{x^2+1}dx=\frac{\pi}{2}\left(1-\frac{1}{e^2}\right)$$
but I don't really know why I'm not getting the result using contour integration (I'm not supposed to use the residue theorem).
Can't I use Cauchy's integral formula this way:
$$\int_{\gamma_r} \dfrac{\frac{\sin^2(z)}{z+i}}{z-i}dz =2\pi i\frac{\sin^2(i)}{2i}$$
along boundary of the upper semicircle of radius r? The other path would be 0 (the boundary without the path along the real axis). What's the problem with this approach?