Compute complex integral inside an open curve I need to compute this complex integral:
$$ \int_\gamma \frac{1}{(z-i)(z-2i)} dz $$
$\gamma$ is defined as:
$$ \gamma (t) = t + i(3e^t\cos^2(t)) $$
The parameter t belongs to the following interval: $[\frac{-\pi}{2},\frac{\pi}{2}] $
My approach to this question was to use the Residue's Theorem. However, the theorem requires a closed curve.
The problem above does not portray a closed curve. It is an open one.
I know that open curves can be manipulated as closed ones. You treat it artificially as a closed one and, by the end, you take out (or add) something.
How can I approach this integral?
The partial result of the residues is:
$Res(f,i)= i$ and  $Res(f,2i)=-i$
Hence:
$2\pi i(+i-i)=0 $
P.S.: I also tried a different approach with the formula:
$$ \int f(\gamma(t))\gamma'(t)dt $$ 
Nonetheless, this approach results in a massive and ugly integral. I think the correct approach is the manipulation described above.

UPDATE
Professor Robert Israel commented bellow and suggested using a third approach with $F(\gamma(\pi/2)) - F(\gamma(-\pi/2))$. In order to do that, I needed to find the primitives. I got them with a little help from Wolfram Alpha. As you can see bellow, the primitive is not really friendly. I am still curious on how to solve this problem treating the curve as a closed one and manipulating it:

 A: Hint: find an antiderivative $F$  of the integrand that is analytic in a region containing the curve $\gamma$.  For this it suffices that any branch cuts are on the imaginary axis below $2i$.
Then the integral is $F(\gamma(\pi/2)) - F(\gamma(-\pi/2))$. 
A: Here is a brute force approach. First, decompose the integrand: 
$\int_\gamma \frac{1}{(z-i)(z-2i)} dz=i\int_\gamma \frac{1}{z-i} dz-i\int_\gamma \frac{1}{z-2i} dz.$
Now, treat each one separately:
For the first integral, complete $\gamma $ to a closed curve $\Gamma$ by taking $\gamma_1$ to be the circular arc centered at $z=i$ of radius $|i-\pi/2|$ going from $x=-\pi/2$ to $x=\pi/2$ and find that the angle $\theta $ subtended by this arc is given by $\cos \frac{1}{2}\theta=\frac{1}{|i-\pi/2|}.$ Then, $i\int_{\gamma_1} \frac{1}{z-i} dz=-\theta.$
Now, the argument principle applies to show that $i\int_{\Gamma} \frac{1}{z-i} dz=i(2\pi i)(1)=-2\pi.$
Therefore, $i\int_{\Gamma} \frac{1}{z-i} dz=i\int_{\gamma_1} \frac{1}{z-i} dz-i\int_{\gamma} \frac{1}{z-i} dz\Rightarrow \int_{\gamma} \frac{1}{z-i} dz=i\theta-2\pi i$.
The second integral is treated in the same way, this time with a circle centered at $2i$.
