evaluate $\oint_C \frac{1}{z-i} dz$ where C is the circle $\left\vert 2 \right\vert$ I've tried several times to solve this integral, but I am unable to solve it, every time I get a similar wrong answer. The question is "evaluate $$\oint_C \frac{1}{z-i} dz$$ where C is the circle $\left\vert 2 \right\vert$"
Here is my (wrong) solution:
This function is not analytic in $z=i$. This point is part of the circle $\left\vert 2 \right\vert$, so the cauchy's integral theorem does not hold here.
The parametric equation for the curve is:
$$
z(t)=2e^{it}
$$
where $0\leq t \leq 2\pi$
and
$$
\frac {dz}{dt} = 2ie^{it}
$$
and also:
$$
f(z(t))=\frac {1}{z(t)-i}=\frac {1}{2e^{it}-i}
$$
So:
$$
\oint_C f(z(t))\cdot z'(t)dt = \oint\limits_{0}^{2\pi} \frac{2ie^{it}}{2e^{it}-i}dt
$$
I used $u=2e^{it}-i$ and $du=2ie^{it}dt$ to solve the integral.
$$
\int\limits_{0}^{2\pi}\frac {du}{u}=Ln(u)=Ln(2e^{it}-i)
$$
Now if I substitute $2\pi$ and $0$:
$$
Ln(2e^{i(2\pi)}-i) - Ln(2e^{i(0)}-i) = Ln(2-i)-Ln(2-i)=0
$$
But the book says the answer is "$2\pi i$". What's wrong with my solution?
 A: Your issue is that the function $1/u$ does not have a primitive defined on all of $C$.  The complex logarithm is typically defined with branch cuts, since 
$$ e^{2\pi i} = e^{0} ~~ {\rm but } ~~ 2\pi i \neq 0, $$
leading to an ambiguity in the definition of $\log$ at $z=1$ (for example!).
To deal with this in the most elementary way, you can separate the integral into real and imaginary parts and attempt to integrate each separately.  This process looks like a huge bummer, so instead you can expand the function $f(z)$ into its Laurent series about $z = i$ and apply the residue theorem.
Probably more helpful: you could draw a second circle of unit radius about $z = i$, call it $C_2$.  Then by Cauchy's theorem, 
$$ \int_C f(z) dz = \int_{C-C_2} f(z) dz + \int_{C_2} f(z) dz = \int_{C_2} f(z)dz.$$
That is, traversing $C$ once can be broken up into (i) traversing $C$ starting from $z = 2i$, counterclockwise; (ii) traversing $C_2$ starting at the same point, clockwise (these two steps give a path I labelled $C - C_2$); (iii) traversing $C_2$ again, counterclockwise.
The two trips along $C_2$ cancel out, but by grouping the first two legs of the journey we get a contour which doesn't contain the singularity $z = i$.  Cauchy's theorem then implies that the line integral along $C - C_2$ is zero.
Now to evaluate $\int_{C_2} f(z) dz$, we can translate the problem to integrating $1/z$ about the unit circle, $C_0$ (substitute $w = z-i$).  This leaves
$$\int_C {1 \over z - i} dz = \int_{C_2} {1\over z - i} dz = \int_{C_0} {dw \over w} = \int_0^{2\pi} {ie^{it} \over e^{it}} dt = i\int_0^{2\pi} dt = 2\pi i.$$
Daniel Fischer's comment is an excellent suggestion.  I prefer his solution, but this is what I've got :)
A: As shown below, you cannot integrate $\frac1z$ around the singularity at the origin and get a value that matches the value you started with. This means that $\log(z)$ cannot be well-defined in a neighborhood of the origin.

The following computation might simply be a translated version of Titus's answer.  If so, perhaps the translation and diagram add some value.
Substituting $z\mapsto z+i$, we get
$$
\int_{\left|z\right|=2}\frac{\mathrm{d}z}{z-i}
=\int_{\left|z+i\right|=2}\frac{\mathrm{d}z}{z}\tag{1}
$$
Since the contour below does not circle the origin,

Cauchy's Integral Theorem says that
$$
\int_{\left|z+i\right|=2}\frac{\mathrm{d}z}{z}
-\int_{\left|z\right|=1}\frac{\mathrm{d}z}{z}\tag{2}
=0
$$
Therefore,
$$
\begin{align}
\int_{\left|z+i\right|=2}\frac{\mathrm{d}z}{z}
&=\int_{\left|z\right|=1}\frac{\mathrm{d}z}{z}\\
&=\int_0^{2\pi}\frac{\mathrm{d}e^{i\theta}}{e^{i\theta}}\\
&=i\int_0^{2\pi}\mathrm{d}\theta\\[3pt]
&=\bbox[5px,border:2px solid #C0A000]{2\pi i}\tag{3}
\end{align}
$$
