Let $\gamma(t) = i + 2e^{it} $, with t $\in [-\pi,3\pi]$, $\frac{1}{2\pi i}\int_\gamma \frac{dz}{z} = ?$
By Cauchy theorem I know that: $$ f(z_0) = \frac{1}{2\pi i}\int_\gamma \frac{f(z)}{z - z_0}dz$$ In this case I have that f(z) = 1. Then: $$\int_\gamma \frac{dz}{z} = 2\pi i * 1 = 2\pi i$$ Originally I wanted to calculate it with a $\frac{1}{2\pi I}$ in front of it, so I should get 1. However, the answer should be 2, why is that?
$\gamma(t) = i + 2e^{it}$ is the cercle centered at $i$ within radius $2$. Hence the origin belongs to the disk limited by the circle.
Now the formula
$$f(z_0) = \frac{1}{2\pi i}\int_\alpha \frac{f(z)}{z - z_0}dz$$ is true for an holomorphic function, a curve $\alpha$ having an index of $1$ around the complex $z_0$. This is not the case for the curve $\gamma$ around the origin.
Another formula is stating
$$\text{ind}(\gamma,0)=\frac{1}{2\pi i}\int_\gamma \frac{dz}{z}$$
Here $\gamma$ is circling twice around the origin. So $\int_\gamma \frac{dz}{z} = 4\pi i$.