Evaluate $\int_{\gamma}\sqrt{z^2-1}dz$ where $\gamma$ is the circle of radious $\frac{1}{2}$ 
Evaluate $\int_{\gamma}\sqrt{z^2-1}dz$ where $\gamma$ is the circle of radius  $\frac{1}{2}$ centred at $0$

I get a little bit confused with the Cauchy criterion for line integrals, in specific with their hyphotesis.
Let $\gamma(t)=\frac{1}{2}e^{i\theta}$ where $\theta \in [0,2\pi]$ which is clearly a simple closed curve.
If I don´t make a mistake in this integral I have that $f(z)=\sqrt{z^2-1}$ is analytic in all its domain and inside of the region that $\gamma$ contains hence $\int_{\gamma}\sqrt{z^2-1}dz=0$.
But for for other hand I tryed calculate it by definition of contour integral
$$\int_{\gamma}\sqrt{z^2-1}dz=\int_{0}^{2\pi}\frac{1}{2}ie^{3\theta i}-\frac{1}{2}ie^{i\theta}d\theta=-\frac{1}{2}$$
Which confused me, and now I want know which of the two calculations are wrong, and why?
 A: Here's my work for doing the integral by hand: using your same parametrization of $\gamma = \{z : z = \frac12e^{i\theta}, \theta \in [0, 2\pi)\}, dz = \frac12ie^{i\theta} d\theta$
$$\int_{\gamma} \sqrt{z^2 - 1} dz = \int_0^{2\pi} \sqrt{\frac14 e^{2i\theta} - 1}\cdot\frac12ie^{i\theta} d\theta$$
Now, break up the integral into an integral from $0$ to $\pi$ and one from $\pi$ to $2\pi.$
$$\int_0^{2\pi} \sqrt{\frac14 e^{2i\theta} - 1}\cdot\frac12ie^{i\theta} d\theta = \int_0^{\pi} \sqrt{\frac14 e^{2i\theta} - 1}\cdot\frac12ie^{i\theta} d\theta + \int_{\pi}^{2\pi} \sqrt{\frac14 e^{2i\theta} - 1}\cdot\frac12ie^{i\theta} d\theta$$
In the second integral, let $u  = \theta - \pi, du = d\theta.$
$$\int_{\pi}^{2\pi} \sqrt{\frac14 e^{2i\theta} - 1}\cdot\frac12ie^{i\theta} d\theta = \int_0^{\pi} \sqrt{\frac14e^{2i(u+\pi)} - 1}\cdot\frac12ie^{i(u+\pi)} du$$
$$= \int_0^{\pi} \sqrt{\frac14 e^{2iu} - 1} \cdot -\frac12ie^{iu} du$$
Now notice that this is exactly the negative of the first integral, so:
$$\int_{\gamma} \sqrt{z^2 - 1} dz = \int_0^{\pi} \sqrt{\frac14 e^{2i\theta} - 1}\cdot\frac12ie^{i\theta} d\theta - \int_0^{\pi} \sqrt{\frac14 e^{2iu} - 1}\cdot\frac12ie^{iu} du = 0.$$

Now as far as the use of Cauchy's theorem goes, I think you can use it here but it requires a little more motivation than you seem to have given, mostly because of the possibility of crossing the branch cut for the square root function. I'm going to choose to use the canonical branch where we get the result with a positive real part, which puts our branch cut along the positive real line $\theta = 0.$
By the chain rule we know that our integrand $\sqrt{z^2 - 1}$ is differentiable at $z_0$ if $z^2 - 1$ is differentiable at $z_0$ and if $\sqrt{z}$ is differentiable at $z_0^2 - 1.$ The first part is trivial because polynomials are differentiable everywhere, so we just need to check if $\sqrt{z}$ is always differentiable, which it will be whenever we aren't on the branch cut.
So, we need to check if $z^2 - 1$ is ever a positive real number for any $z$ on $\gamma.$ Let's suppose there was such a $z$: then $z^2 - 1 > 0$ implies $z^2 > 1,$ and because any positive real number is equal to its modulus, this implies $|z^2| = |z|^2 > 1.$ However, for all $z$ on $\gamma,$ we have that $|z| = \frac12,$ so this implies $\left(\frac12\right)^2 = \frac14 > 1,$ which is a blatant contradiction, so there can exist no $z$ on $\gamma$ such that $z^2 - 1$ is a positive real number, so our integrand is differentiable everywhere on the disk enclosed by $\gamma$ and Cauchy's integral theorem can be used.
