Find $\displaystyle{\int_C \left(1+ \frac{2}{z}\right) dz}$ along the contour $C(\theta)=e^{i\theta}, 0 \le \theta \le \pi$, that is $C$ is the unit half-circle in the upper plane center at $0$.
I think the solution rely on the choice of an appropriate branch of the logarithmic function and the answer should be $-2+i2\pi$.
I obtain $-2+i2\pi$ when I use the branch $[0,2\pi]$.
But our instructor used the branch $(-\frac{\pi}{2},\frac{7}{2}\pi)$.
Are those two branches appropriate?
Is it ok to use a closed interval for a branch or only open interval are allowable?
My attempt:
A primitive for $1+ \frac{2}{z}$ is $z+2 \ln z$. Choosing the branch $ \ln z = \ln r + i \theta , \theta \in [0,2\pi] $ by Cauchy theorem $ \int_C \left(1+ \frac{2}{z}\right) dz = z+2 \ln z \bigg|_{z=1}^{z=-1}=-2+i2\pi $ as $\ln 1= 0 + i 0$ and $\ln -1 = 0 + i \pi$.