I need help to solve the following integral:
$$\lim_{R\mapsto\infty}\int_{-R}^{+R}\frac{1}{x+i}\text{d}x.$$
None of the explicit formulas (with residues) of my course seems to apply directly. Can somebody help me please? Is the result simply $2\pi i$ by Cauchy’s integral formula? Thanks for your help!
\begin{align} \int_{-R}^R\frac 1{x+i}\mathrm dx &=\int_{-R}^R\frac{x-i}{x^2+1}\mathrm dx\\ &=\frac 12\int_{-R}^R\frac{2x}{x^2+1}\mathrm dx-i\int_{-R}^R\frac 1{x^2+1}\mathrm dx\\ &=\frac 12\left[\log(1+x^2)\right]_{-R}^R-i\left[\arctan(x)\right]_{-R}^R\\ &=-2i\arctan(R)\\ &\xrightarrow{R\to+\infty}-i\pi \end{align}