Evaluate the Cauchy Principal Value of $\int_{-\infty}^{\infty} \frac{\sin x}{x(x^2-2x+2)}dx$ Evaluate the Cauchy Principal Value of  $\int_{-\infty}^\infty \frac{\sin x}{x(x^2-2x+2)}dx$
so far, i have deduced that there are poles at $z=0$ and $z=1+i$ if using the upper half plane. I am considering the contour integral $\int_C \frac{e^{iz}}{z(z^2-2z+2)}dz$ I dont know how to input graphs here but it would be intended at the origin with a bigger R, semi-circle surrounding that. So, I have four contour segments. 
$\int_{C_R}+\int_{-R}^{-r}+\int_{-C_r}+\int_r^R=2\pi i\operatorname{Res}[f(z)e^{iz}, 1+i]+\pi iRes[f(z)e^{iz},o]$ I think.   Ok, so here is where I get stuck. Im not sure how to calculate the residue here, its not a higher pole, so not using second derivatives, not Laurent series. Which method do I use here?
 A: Write $\sin{x} = (e^{i x}-e^{-i x})/(2 i)$.  Then consider the integral
$$PV \oint_{C_{\pm}} dx \frac{e^{\pm i z}}{z (z^2-2 z+2)} $$
where $C_{\pm}$ is a semicircular contour of radius $R$ in the upper/lower half plane with a semicircular detour into the upper/lower half plane of radius $\epsilon$.  For $C_{+}$, we have
$$PV \oint_{C_{+}} dz \frac{e^{i z}}{z (z^2-2 z+2)} = \int_{-R}^{-\epsilon} dx \frac{e^{i x}}{x (x^2-2 x+2)}+ i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{e^{i \epsilon e^{i \phi}}}{\epsilon e^{i \phi} (\epsilon^2 e^{i 2 \phi} - 2 \epsilon e^{i \phi}+2)} \\+ \int_{\epsilon}^R dx \frac{e^{i x}}{x (x^2-2 x+2)}+ i R \int_0^{\pi} d\theta \, e^{i \theta} \frac{e^{i R e^{i \theta}}}{R e^{i \theta} (R^2 e^{i 2 \theta} - 2 R e^{i \theta}+2)} $$
For $C_-$, we have
$$PV \oint_{C_{-}} dz \frac{e^{-i z}}{z (z^2-2 z+2)} = \int_{-R}^{-\epsilon} dx \frac{e^{-i x}}{x (x^2-2 x+2)}+ i \epsilon \int_{-\pi}^0 d\phi \, e^{i \phi} \frac{e^{-i \epsilon e^{i \phi}}}{\epsilon e^{i \phi} (\epsilon^2 e^{i 2 \phi} - 2 \epsilon e^{i \phi}+2)} \\+ \int_{\epsilon}^R dx \frac{e^{-i x}}{x (x^2-2 x+2)}- i R \int_0^{\pi} d\theta \, e^{-i \theta} \frac{e^{-i R e^{-i \theta}}}{R e^{-i \theta} (R^2 e^{-i 2 \theta} - 2 R e^{-i \theta}+2)} $$
In both cases, we take the limits as $R \to \infty$ and $\epsilon \to 0$.  Note that, in both cases, the respective fourth integrals have a magnitude bounded by
$$\frac{2}{R^2} \int_0^{\pi/2} d\theta \, e^{-R \sin{\theta}} \le \frac{2}{R^2} \int_0^{\pi/2} d\theta \, e^{-2 R \theta/\pi}\le \frac{\pi}{R^3}$$
The respective second integrals of $C_{\pm}$, on the other hand, become equal to $\mp i \frac{\pi}{2} $.  Thus,
$$PV \oint_{C_{\pm}} dz \frac{e^{\pm i z}}{z (z^2-2 z+2)} = PV \int_{-\infty}^{\infty} dx \frac{e^{\pm i x}}{x (x^2-2 x+2)} \mp i \frac{\pi}{2}$$
On the other hand, the respective contour integrals are each equal to $\pm i 2 \pi$ times the sum of the residues of the poles inside their contours.  (For $C_-$, there is a negative sign because the contour was traversed in a clockwise direction.) The poles of the denominator are at $z_{\pm}=1 \pm i$.  Thus,
$$PV \int_{-\infty}^{\infty} dx \frac{e^{\pm i x}}{x (x^2-2 x+2)} \mp i \frac{\pi}{2} = \pm i 2 \pi \frac{e^{\pm i (1 \pm i)}}{(1 \pm i) (2) (\pm i)} $$
Taking the difference between the two results and dividing by $2 i$, we get that
$$\int_{-\infty}^{\infty} dx \frac{\sin{x}}{x (x^2-2 x+2)} = \frac{\pi}{2} \left (1+\frac{\sin{1}-\cos{1}}{e} \right ) $$
Note that we may drop the $PV$ because the difference between the integrals removes the pole at the origin.
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$

Zeros of $\ds{x^{2} - 2x + 2}$ are given by $\ds{r_{\pm} = 1 \pm \ic=\root{2}\exp\pars{\pm\ic\,{\pi \over 4}}}$.

\begin{align}&\color{#66f}{\large%
\int_{-\infty}^{\infty}{\sin\pars{x} \over x\pars{x^{2} - 2x + 2}}\,\dd x}
=\int_{-\infty}^{\infty}{1 \over x^{2} - 2x + 2}\,\
\overbrace{\half\int_{-1}^{1}\expo{\ic kx}\,\dd k}
^{\ds{=\ \dsc{\sin\pars{x} \over x}}}\ \,\dd x
\\[5mm]&=\half\,\Re\int_{-1}^{1}\int_{-\infty}^{\infty}
{\expo{\ic\verts{k}x} \over x^{2} - 2x + 2}\,\dd x\,\dd k
=\half\,\Re\int_{-1}^{1}2\pi\ic\lim_{x\ \to\ r_{+}}\bracks{\pars{x - r_{+}}
{\expo{\ic\verts{k}x} \over x^{2} - 2x + 2}}\,\dd k
\\[5mm]&=\pi\,\Re\int_{-1}^{1}
{\expo{\ic\verts{k}r_{+}} \over 2r_{+} - 2}\,\dd k
={\pi \over 2}\,\Re\bracks{%
\ic\int_{-1}^{1}{\expo{\pars{-1 + \ic}\verts{k}} \over \ic}\,\dd k}
=\pi\,\Re\bracks{%
\int_{0}^{1}\expo{\pars{-1 + \ic}k}\,\dd k}
\\[5mm]&=\pi\,\Re\bracks{\expo{\pars{-1 + \ic}}  - 1\over -1 + \ic}
=\pi\,\Re{\bracks{\expo{-1}\cos\pars{1}  - 1 + \expo{-1}\sin\pars{1}\ic}
\pars{-1 - \ic}\over 2}
\\[5mm]&={\pi \over 2}\bracks{-\expo{-1}\cos\pars{1}  + 1 + \expo{-1}\sin\pars{1}}
=\color{#66f}{\large%
{\pi \over 2}\bracks{1 + {\sin\pars{1} - \cos\pars{1} \over \expo{}}}}
\end{align}
