Evaluate an integral along a semicircle.

Let $\gamma$ be the semicircle $[-R,R]\cup\{z\in\mathbb{C}:|z|=R\ and\ Im{z}>0\}$ traced in the positive direction, and let $R>1$. Evaluate $$\int_\gamma\frac{dz}{(z^2+1)^2}.$$

I want to say that since neither of the poles of the function $f(z):=1/(z^2+1)^2$, namely $i$ and $-i$, are inside the semicircle, we can use the General Closed Curve Theorem here to deduce that the value of the integral is zero. Or am I missing something, and need to use Residue Theorem?

• You sure that $i$ isn't inside? Commented Apr 16, 2015 at 23:33
• I'm sorry, I made a typo. It should be $R<1$. Commented Apr 16, 2015 at 23:34
• Ah, well, in that case the answer is 0, as you suggested. Commented Apr 16, 2015 at 23:42
• But it's not a closed curve.
– zhw.
Commented Apr 17, 2015 at 1:00
• @zhw.: Why not? And by the way, nonremovable, write $\operatorname{Im}(z)$ ($\operatorname{Im}(z)$) or at least $Im(z)$, since $Imz$ looks like a product of $I,m,z$. Commented Apr 17, 2015 at 1:09

By Cauchy's theorem, it equals $-\int_{-R}^R \frac{dx}{(1+x^2)^2}.$ We're now back in calculus, and I'm getting $-(\arctan R +\frac{R}{1+R^2})$ for the answer (better check that).

• His 'semicircle' includes the diameter. Commented Apr 17, 2015 at 1:10
• Ah, you're right. Sorry, about that. I'll let it stand.
– zhw.
Commented Apr 17, 2015 at 1:14