Closed contour integral: $\int_{\mathbb{c}}\frac{ z}{2z^{2}+1} dz$ where the contour is the unit circle first and foremost please excuse my English.
given $∫_c \frac{{z}}{2z^{2}+1}dz$  where the contour is the unit circle. so c = $e^{it}$ from 0 to $2\pi$. 
since the contour is the unit circle we can say that $f(z(t)) = \frac{e^{it}}{2*(e^{it})^{2}+1}$ and $z'(t) = i*e^{it}$
We know that $\int_a^{b} f(z(t))*z'(t) = \int _c f(z) dz$
so then we just substitute what we know and we get:$$ \int _0 ^{2\pi } \frac{e^{it}}{2*(e^{it})^{2}+1} *  i*e^{it} dt $$
$$ i\int _0 ^{2\pi } \frac{e^{2it}}{2e^{2it}+1} dt $$
we let $ u = 2e^{2it}+1 $ and $du = 4ie^{2it}$ and we get : 
$$i\int _0 ^{2\pi } \frac{e^{2it}}{u} \frac{du}{4ie^{2it}}$$ 
$$ \frac{1}{4}\int _0 ^{2\pi } \frac{1}{u}du $$
we solve and see that:
$$ i\int _0 ^{2\pi } \frac{e^{2it}}{2e^{2it}+1} dt = \frac{1}{4}(log (1+2e^{4\pi i})-log(1+2e^{0 i})) = 0 $$
is this correct? this was a problem on my final and when I computed this contour integral on wolfram alpha I got $\pi$i?
any explanation would by much appreciate it. I understand I could have done this problem with Cauchy's Integral Formula. Our class did not get up to residue calculus since this is an undergraduate course. Many thanks in advance. 
 A: No, the answer is $\pi i$. Since 
$$\frac{z}{2z^2 + 1} = \frac{1/4}{z - i/\sqrt{2}} + \frac{1/4}{z + i/\sqrt{2}}$$
then 
$$\int_c \frac{z}{2z^2 + 1}\, dz = \frac{1}{4}\int_c \frac{1}{z - i\sqrt{2}}\, dz + \frac{1}{4}\int_c \frac{1}{z + i/\sqrt{2}}\, dz = \frac{1}{4}(2\pi i) + \frac{1}{4}(2\pi i) = \pi i$$
using Cauchy's integral formula in the second to last step.
A: The solution presented in the OP might appear paradoxical.  The substitution $u=1+e^{i2t}$ seems both natural and innocuous.  Yet, inappropriate application of the substitution led to the integral
$$\int_{t=0}^{t=2\pi}\frac{1}{u}\,du=0$$
So, what went wrong here?


In THIS ANSWER, I showed that for any rectifiable curve $\gamma$ on $\mathbb{C}\setminus\{0\}$, that begins at $1$ and ends at $re^{i\theta}$
$$\int_\gamma \frac1z\,dz=\log(r)+i(\theta +2\pi k) \tag 1$$
where $k$ is the net number of times $\gamma$ crosses the positive real axis from the fourth quadrant to the first quadrant.  (For additional explanation, SEE THIS ANSWER).
Note that $(1)$ can be easily generalized by replacing the starting point at $z=x$.  In that case, we simply replace $\log(r)$ with $\log(r/x)$.


To make things clear, we apply $(1)$ to the problem of interest.  Observe that for $t\in [0,2\pi]$, the substitution $u=1+e^{2it}$ results in a contour $\gamma$ defined by $|u-1|=2$, that has one net crossing (at $t=\pi$) of the positive real axis in the $u$-plane.  
Then, using the aforementioned modification of $(1)$, we find that with $x=r=3$, $\theta=2\pi$, and $k=1$
$$\int_{|u-1|=2}\frac1u\,du =i4\pi$$
Finally, we have
$$\begin{align}
\oint_{|z|=1} \frac{z}{2z^2+1}\,dz&=i\int_0^{2\pi}\frac{e^{i2t}}{2e^{i2t}+1}\,dt\\\\
&=\frac14 \oint_{|u-1|=2}\frac1u\,du\\\\
&=i\pi
\end{align}$$
as was to be shown!

