<s>[INST] Evaluate $\int_{|z|=4}\frac{\sin z}{z(z-2i)}\ dz$ 
Evaluate $$\int_{|z|=4}\frac{\sin z}{z(z-2i)}\ dz$$

The two singularities are included in inside the disk $|z|<4$, so I broke the integral in a sum of two integrals.
The first one:
$$\int \frac{\frac{\sin z}{z}}{z-2i}\ dz = 2i\pi f_1(2i)$$
where $f_1 = \frac{\sin z}{z} \implies f_1(2i) = \frac{\sin 2i}{2i}$.
The second one:
$$\int \frac{\frac{\sin z}{z-2i}}{z}\ dz = 2i\pi f_2(0)$$
where $f_2 = \frac{\sin z}{z-2i}\implies f_2(0) = 0$.
The result should be the sum of the two integrals.
However, a friend of mine did the following:
$$\int \frac{\sin z}{(z-0)(z-2i)}\ dz$$
Then
$$\frac{1}{(z-0)(z-2i)} = \frac{A}{z-0}+\frac{B}{z-2i}\implies
A = \frac{i}{2}, B = \frac{-i}{2}$$
and 
$$\int_{|z|=4} \frac{\sin z}{z(z-2i)}\ dz = \int_{|z|=4} \frac{A}{z}\ dz+\int_{|z|=4}\frac{B}{z-2i}\ dz = 0 + 2i\pi$$
Which one is right? If both are wrong, at least which method is the right one? I've seen mine on the internet but I can't find anything wrong with my friend's answer.
 [/INST] Both methods work, but there is a small error in the second.
It is true that
$$
\frac{1}{z(z-2i)} = \frac{A}{z} + \frac{B}{z-2i}
$$
for $A = i/2$ and $B = -i/2$, but the error comes in the next line where your friend essentially says
$$
\frac{\sin z}{z(z-2i)} = \frac{A}{z} + \frac{B}{z-2i}
\newcommand{\contour}{{|z|=4}}
$$
The left-hand side got multiplied by $\sin z$, but not the right. We can fix it by including $\sin z$ on the right:
\begin{align}
\int_\contour \frac{\sin z}{z(z-2i)} \, dz &= \int_\contour A \cdot \frac{\sin z}{z} \, dz + \int_\contour B \cdot \frac{\sin z}{z-2i} \, dz
\end{align}
The first integral evaluates to zero since the singularity at $z=0$ is removable (by assigning the value $1$). The second integral has a first-order pole at $z=2i$ and can be computed using Cauchy's Integral Formula:
\begin{align*}
\int_\contour B \cdot \frac{\sin z}{z-2i} \, dz &= 2\pi i \cdot B \sin(2i) \\
&= 2\pi i \cdot (-i/2) \cdot \sin(2i) \\
&= \pi \sin(2i) \\
&= 2\pi i \cdot f_1(2i)
\end{align*}
</s>