I was doing a contour integration over a circle and, after a few steps, got stuck here:
$$\int_0^{2\pi}\frac{i}{e^{it}+2}dt=-\frac{1}{2}\log(1+2e^{-it})\Big\vert_0^{2\pi}=0$$ which is clearly not correct.
I know this has to do with the fact that the logarithm function can't be simultaneously defined at $0$ and $2\pi$. How could I formalize the argument?
BTW I know this can be done using the Cauchy Integral formula. But we are not there yet. I'd appreciate a more elementary approach.
Your integral is equal to$$\int_{\lvert z\rvert=1}\frac1{z(z+2)}\,\mathrm dz$$and, by Cauchy's integral formula, this integral is equal to$$\frac{2\pi i}{0+2}=\pi i.$$