<s>[INST] Calculating $\int_{-\infty}^{\infty} \frac{\sin(t)}{t^2+2t+2} \ dt$ My attempt: We have $$ \int_{\Gamma} f(z) \ dt = \int_{\gamma} f(z) \ dz  + \int_{\sigma} f(z) \ dz = 2 \pi i \sum_{z_0 \text{ pole inside } \Gamma} \mathrm{res}_{z_0}(f) $$ where $\Gamma$ is contour of the upper semi-circle of radius $r$, $\gamma$ is the real line segment going from $-r$ to $r$, $\sigma$ is the semi-circle, and $f(z) = \frac{sin(z)}{z^2 + 2z +2}$.
We have $$ \frac{\sin(t)}{t^2+2t+2} = \frac{\sin(t)}{(t+1 -i)(t+1+i)} $$ so the function has simple poles at $z = -1 \pm i$, and therefore
$$ \int_{-r}^r \frac{\sin(t)}{t^2+2t+2} \ dt = - \int_0^{ \pi} \frac{\sin(re^{i \theta} )ri e^{i \theta}}{(re^{i \theta})^2 + 2 re^{i \theta} + 2} \ d\theta + \pi \sin(-1+i). $$
By taking the limit on both sides we get
$$ \int_{-\infty}^{\infty} \frac{\sin(t)}{t^2+2t+2} \ dt = - \lim_{r \to \infty} \int_0^{ \pi} \frac{\sin(re^{i \theta}) ri e^{i \theta}}{(re^{i \theta})^2 + 2 re^{i \theta} + 2} \ d\theta + \pi \sin(-1+i) $$
but I don't know how to simplify the right hand side.
 [/INST] \begin{align*}I & =\int_{-\infty}^\infty\frac{\sin x}{(x+1)^2+1}dx=\int_{-\infty}^{\infty}\frac{\sin(x-1)}{x^2+1}dx \\ & =\cos(1)\int_{-\infty}^\infty\frac{\sin x}{x^2+1}dx-\sin(1)\int_{-\infty}^\infty\frac{\cos x}{x^2+1}dx \\ &=-2\sin(1)\int_{0}^\infty\frac{\cos x}{x^2+1}dx=-2\sin(1)\frac{\pi}{2e}=\frac{-\pi\sin(1)}{e}. \end{align*}
(See here.)
</s>