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.
 A: \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.)
A: Using algebra
Consider the more general case of
$$I=\int_{-\infty}^{+\infty} \frac{\sin(t)}{(t-a)(t-b)} \, dt$$ where $(a,b)$ are complex numbers.
Using partial fraction decomposition
$$I=\frac 1{a-b}\left(\int_{-\infty}^{+\infty}\frac{\sin (t)}{t-a}\,dt-\int_{-\infty}^{+\infty}\frac{\sin (t)}{t-b}\,dt\right)$$ So, we have two integrals of the form
$$J_c=\int_{-\infty}^{+\infty}\frac{\sin (t)}{t-c}\,dt$$ A natural change of variable $(t=x+c)$ and the expansion of the sine gives
$$K_c=\int\frac{\sin (t)}{t-c}\,dt=\sin(c)\int \frac{\sin (x)}{x}\,dx+\cos(c)\int \frac{\cos (x)}{x}\,dx$$
$$K=\sin (c)\, \text{Ci}(x)+\cos (c)\, \text{Si}(x)$$ Back to $t$ and $I$ and using the bounds, then $\cdots\cdots\cdots$
A: Complex Analysis approach: Let $$f(z)=\frac{e^{iz}}{z^2+2z+2}$$Note that $Imm(f(z))=\frac{sin(z)}{z^2+2z+2}$.
$f$ has 2 simple pole with order 1. The pole are $z_1=-1+i$ and $z_2=-1-i$ wich are the roots of $p(z)=z^2+2z+2$.
So $f(z)=\frac{e^{iz}}{(z-z_1)(z-z_2)}$.
Writing $f(z)=\frac{1}{z-z_1}h(z)$ note that $h(z_1)\not=0$ and $h(z)$ olomorphic in $z_1$ we have $Res(f,z_1)=h(z_1)=\frac{e^{iz_1}}{(z_1-z_2)}=\frac{e^{i(-1+i)}}{(2i)}$
Analogue for $z_2$.
Now consider $\phi(t):[-R,R]\to \Bbb C,\phi(t)=t$ and $\tau_R(t):[0,\pi]\to \Bbb C,\tau_R(t)=Re^{it}$. Be $\Gamma=$
$$ \int_{\Gamma} f(z) \ dt = \int_{\phi} f(z) \ dz  + \int_{\tau_R} f(z) \ dz = 2 \pi i Res(f,z_1) $$Noticing that z_1 is the only pole in $\Gamma$.
$$ \lim_{R\to \infty} \int_{\Gamma} f(z) \ dt = \lim_{R\to \infty}\int_{\phi} f(z) \ dz  +\lim_{R\to \infty} \int_{\tau_R} f(z) \ dz =2 \pi i Res(f,z_1)$$. Noticing that the second integral$\to 0$ as $R \to\infty$, you consider the first integral with now is in $\Bbb R$ and splitting it in the real part and the imaginary part  then, you conclude.
