Show that the function $z\to \int_{\sqrt{5}}^{z} \frac{2w}{w^{2}-4}dw$ is well-defined in $\mathbb{C}\setminus [-2,2]$ Problem: Show that the function $z\to \displaystyle\int_{\sqrt{5}}^{z} \frac{2w}{w^{2}-4}dw$ is well-defined in $\mathbb{C}\setminus [-2,2].$
My approach to this problem was to prove that $\displaystyle\int_{\gamma} \frac{2w}{w^{2}-4}dw=0$ for every closed curve in $\mathbb{C}\setminus [-2,2]$, but when I took 
$\gamma(t)=\sqrt{5}e^{it}$ for $t\in [0,2\pi]$, the result of the integral gave me 4$\pi i$. So this means that the function is not well-defined. 
Can someone tell me if the integral is $0$ or $4\pi i$? Is the function well-defined?
I assume that this function is intended to be $\log(z^2 -4)$.
 A: Chilote suggested that I turn my old (and somewhat poorly-worded) comment into an answer, so that's what I'm going to do.

Showing that $$ z \mapsto \int_{\sqrt{5}}^{z} \frac{2w}{w^{2}-4} \,  \mathrm dw$$ is a well-defined function on $\mathbb{C} \setminus [-2,2]$ means showing that the integral is independent of the path of integration.
This is indeed equivalent to showing that the value of the integral is zero for all closed contours on $\mathbb{C} \setminus [-2,2] $. 
The integrand is a meromorphic function with simple poles at $w=-2$ and $w=2$, and the residue at both points is $1$.
Due to the branch cut on $[-2,2]$, every closed contour will either enclose both poles or neither pole.
If the contour encloses neither pole, then the value of the integral is $0$.  
But if the contour is positively oriented and encloses both poles, that the value of the integral is $2 \pi i \, (1+1) = 4 \pi i$ (or a multiple of $4 \pi i$ if the contour winds around the poles more than once).
Therefore $$ z \mapsto \int_{\sqrt{5}}^{z} \frac{2w}{w^{2}-4} \, \mathrm dw $$ is not a well-defined function on $\mathbb{C} \setminus [-2,2]$.
The function is, however, well-defined on $\mathbb{C} \setminus (-\infty,2]$.
You are correct that the function is actually $f(z) = \log(z^{2}-4)$ if $f \left(\sqrt{5}\right)$ is defined to be zero (as opposed to some other other multiple of $2 \pi i$).
