how can the answer be the same even though the integral isn't? Is there a mistake in the following? I think there is because for $a>0$ $I(a)$ equals to the expression which includes $e^{-a}$ but for $b>0$ it is still $e^{-b}$ even though in the integral there is $e^{-ib \xi}$. So the answer is same even though the integral being evaluated isn't. 

 A: Note that with $I(a)=\int_{-\infty}^\infty \frac{e^{ia\xi}}{\xi^2-2\xi+2}\,d\xi$, then $\overline{I(a)}=\int_{-\infty}^\infty \frac{e^{-ia\xi}}{\xi^2-2\xi+2}\,d\xi$, which for $a<0$ can be expressed as 
$$\overline{I(a)}=\int_{-\infty}^\infty \frac{e^{-i|a|\xi}}{\xi^2-2\xi+2}\,d\xi\tag1$$
The right-hand side of $(1)$ can be evaluated using contour integration by closing the contour in the upper-half plane.  The result for $a<0$ is 
$$\begin{align}
\int_{-\infty}^\infty \frac{e^{i|a|\xi}}{\xi^2-2\xi+2}\,d\xi&=2\pi i \text{Res}\left(\frac{e^{i|a|\xi}}{\xi^2-2\xi+2}, \xi=z_2=1+i\right)\\\\
&=2\pi i \frac{e^{-|a|}(\cos(|a|)+i\sin(|a|))}{2i}\\\\
&=\pi e^{-|a|} (\cos(|a|)+i\sin(|a|))\\\\
&=\pi e^{-|a|} (\cos(a)+i\sin(a))\\\\
\end{align}$$
whence exploiting the fact that the sine function is odd, we find that  
$$I(a)=\pi e^{-|a|}(\cos(a)+i\sin(a))$$ 
as was to be shown.

Alternatively, for $a<0$, we close the contour in the lower-half plane and find  
$$\begin{align}
\int_{-\infty}^\infty \frac{e^{ia\xi}}{\xi^2-2\xi+2}\,d\xi&=-2\pi i \text{Res}\left(\frac{e^{ia\xi}}{\xi^2-2\xi+2}, \xi=z_2=1-i\right)\\\\
&=-2\pi i \frac{e^{a}(\cos(a)+i\sin(a))}{-2i}\\\\
&=\pi e^a (\cos(a)+i\sin(a))\\\\
&=\pi e^{-|a|} (\cos(a)+i\sin(a))\\\\
\end{align}$$
as expected!
