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?
the poles of $ x^{2}+1 $ are $ i $ and $-i $ expand the sine function and apply residue theorem to
$$ \int_{-\infty}^{\infty}dx \frac{e^{2ix}}{x^{2}+1} $$
remmeber $ sin^{2}(x)= \frac{e^{2ix}+e^{-2ix}-2}{-4} $ and $ \int_{-\infty}^{\infty}dx \frac{1}{x^{2}+1}= \frac{\pi}{2} $