Let $C$ be the intersection of the circle of raidus $2$ with the set $\{x+iy:y\geq 0\}$ with start and end point $2,-2$ respectively and let $D=\{re^{i\theta}:r>0, \theta\in(-\pi/2,3\pi/2)\}$
Let $f:D\to \mathbb{C}$ be a branch of square root with $f(1)=-1$, find $\int_C f(z)dz$
So I believe I can find the integral of the square root function normally by substituting $z=2e^{it}$ and then taking the integral of $\sqrt{2}\int_{0}^\pi e^{1/2 it}ie^{it}dt$ to get $F(z)=\frac{2\sqrt{2}}{3}(e^{\frac{9}{4}\pi i}+e^{\frac{1}{4}\pi i})$
Im not sure what to do with the fact that $f$ is a branch of the square root
$f(re^{i\theta}) = -\sqrt{r} e^{(\frac{\theta}{2})i}$ for $\theta\in[0, 2\pi)$.
How do we know this is the branch we want? Well, first it's easy to check that $f(z)^2=z$, so it's indeed a square-root function, and it's clearly continuous (so it falls into one branch instead of jumping between branches), finally $f(1) = f(1\cdot e^{0\cdot i}) = -1$.
The semi-circle can be parametrized by $\gamma(\theta) = 2e^{i\theta}$ for $\theta\in [0, \pi]$. Hence $$\int_D f(z)dz = \int_{\theta = 0}^\pi -\sqrt{2} e^{(\frac{\theta}{2})i}d(2e^{i\theta})$$
Here is another way to do it. The branch can be continuously extended to the closed upper half plane (but not analytically), therefore we can apply the Cauchy–Goursat theorem to get $\int_{D\cup[-2, 2]}f(z)dz=0$, hence $$\int_D f(z)dz = -\int_{[-2,2]} f(z)dz=-(\int_{-2}^0 f(z)dz+\int_{0}^2f(z)dz)$$ By continuity of $f$, if $f(1)=-1$, then $f(r)=-\sqrt{r}$ for real $r\ge 0$, and $f(-r) = -i\sqrt{|r|}$ for $r<0$. So the answer is simply $$\int_Df(z)dz = \int_{-2}^0 i\sqrt{|r|}dr + \int_0^2 \sqrt{r}dr=(1+i)\int_0^2\sqrt{r}dr$$