I don't really understand how I solve ii) in the problem linked. I'm quite sure that it involves splitting up the integral in i) to parts over $C_R$ and $[-R,R]$, but I don't know how to solve the latter. Since it's just along the real axis, I can take the real part of the integral and get $$\int_{-R}^{R}\frac{e^{i\pi x}}{x^2+2x+2}dx.$$
Taking the limit as $R \rightarrow \infty$ (if what I'm thinking is correct) should give me the same answer as i), but I'm not sure how to evaluate this integral.
Thanks.
Note that we can write for $R>2$
$$\begin{align} \left|\int_{C_R}\frac{e^{iz}}{z^2+2z+2}\,dz\right|&\overbrace{=}^{z=Re^{i\theta}}\left|\int_0^\pi \frac{e^{iRe^{i\theta}}}{(Re^{i\theta})^2+2Re^{i\theta}+2}\,iRe^{i\theta}\,d\theta\right|\\\\ &\le \int_0^\pi \frac{\left|e^{-R\sin(\theta)}e^{iR\cos(\theta)}\right|}{|(Re^{i\theta}+1)^2+1|}\,\,\left|iRe^{i\theta}\right|\,d\theta\\\\ &\le\int_0^\pi \frac{Re^{-R\sin(\theta)}}{||Re^{i\theta}+1|^2-1|}\,d\theta\\\\ &\le \int_0^\pi \frac{e^{-R\sin(\theta)}}{R-2}\,d\theta \\\\ &= \frac{2}{R-2}\int_0^{\pi/2} e^{-R\sin(\theta)}\,d\theta\\\\ &\le \frac{2}{R-2}\int_0^{\pi/2}e^{-2R\theta/\pi}\,d\theta\\\\ &=\frac{\pi(1-e^{-R})}{R(R-2)} \end{align}$$
which clearly approaches $0$ as $R\to \infty$. And we are done!