What's the flaw in my argument? I'm trying to evaluate the following integral $$\int_{0}^{\infty} \frac{(x+1)}{(1+(1+x)^2)x^{1/3}}dx$$
 I'm using the branch cut from $[0, \infty)$ (positive real axis to be precise). For this cut, when I try to evaluate the residues ( they're $(+i-1)$ and $(-i-1)$ ) and I get the following values : $ \frac{1}{2(i-1)^{1/3}}$ and $ \frac{1}{2(-i-1)^{1/3}}$, respectively. For $ \infty$, we get the residue $0$ (I would appreciate if someone can explain this too i couldn't evaluate the residue at that point either). By residue theorem i should get the answer as summation of the residues I found times $ 2\pi i$ over (1-$e^{-i \pi (2/3)})$. The problem here is that the following form of the residues give us the correct solution $ \frac{1}{2(-i+1)^{1/3}}$ and $ \frac{1}{2(+i+1)^{1/3}}$. Why this is the case? 
 A: Taking the branch cut along the positive real axis and integrating over the classical keyhole contour, $C$, we find that 
$$\begin{align}
\oint_C \frac{(z+1)z^{-1/3}}{(z^2+2z+2)}\,dz&=\int_\epsilon^R \frac{(x+1)x^{-1/3}}{(x^2+2x+2)}\,dx-e^{-i2\pi/3}\int_\epsilon^R \frac{(x+1)x^{-1/3}}{(x^2+2x+2)}\,dx\\\\
&+\int_0^{2\pi}\frac{(Re^{i\phi}+1)(Re^{i\phi})^{-1/3}}{(Re^{i\phi})^2+2(Re^{i\phi})+2}\,iRe^{i\phi}\,d\phi\\\\
&+\int_0^{2\pi}\frac{(\epsilon e^{i\phi}+1)(\epsilon e^{i\phi})^{-1/3}}{(\epsilon e^{i\phi})^2+2(\epsilon e^{i\phi})+2}\,i\epsilon e^{i\phi}\,d\phi\tag1
\end{align}$$
As $\epsilon\to 0$ and $R\to \infty$, the third and fourth integrals on the right-hand side of $(1)$ approach $0$.  Therefore, 

With the given branch cut, we have at the poles $z=-1+i=\sqrt{2}e^{i3\pi/4}$ and $z=-1-i=\sqrt{2}e^{i5\pi/4}$.  Hence, at $z=-1+i$, $z^{-1/3}=2^{-1/6}e^{-i\pi/4}$ and at $z=-1-i$, $z^{-1/3}=2^{-1/6}e^{-i5\pi/12}$.
From the residue theorem, for $R>\sqrt 2$, we find that with $z=-1+i=\sqrt{2}e^{i3\pi/4}$ and $z=-1-i=\sqrt{2}e^{i5\pi/4}$
$$\begin{align}
\oint_C \frac{(z+1)z^{-1/3}}{(z^2+2z+2)}\,dz&=2\pi i \,\text{Res}\left(\frac{(z+1)z^{-1/3}}{(z^2+2z+2)}, z=-1+i,-1-i\right)\\\\
&=2\pi i \left(\frac{i\,2^{-1/6}e^{-i\pi/4}}{i2}+\frac{(-i)\,2^{-1/6}e^{-i5\pi/12}}{-i2}\right)\tag 2
\end{align}$$
where we found the resides as follows:
$$\text{Res}\left(\frac{(z+1)z^{-1/3}}{(z^2+2z+2)}, z=-1+i\right)=\lim_{z\to -1+i}(z+1-i)\left(\frac{(z+1)z^{-1/3}}{(z^2+2z+2)}\right)=\frac{i2^{-1/6}e^{-i\pi/4}}{i2}$$
and
$$\text{Res}\left(\frac{(z+1)z^{-1/3}}{(z^2+2z+2)}, z=-1-i\right)=\lim_{z\to -1+i}(z+1+i)\left(\frac{(z+1)z^{-1/3}}{(z^2+2z+2)}\right)=\frac{i2^{-1/6}e^{-i5\pi/12}}{i2}$$

Therefore, equating $(1)$ and $(2)$, taking the limit as $\epsilon\to 0$ and $R\to\infty$, and solving for the integral of interest yields
$$\int_0^\infty \frac{(x+1)x^{-1/3}}{(x^2+2x+2)}\,dx=\frac{1}{1-e^{-i2\pi/3}}\left(2\pi i \left(\frac{i\,2^{-1/6}e^{-i\pi/4}}{i2}+\frac{i\,2^{-1/6}e^{-i5\pi/12}}{i2}\right)\right)$$
Can you finish now?
A: A quick way to find the residuals:
$\lim_\limits{z\to -1+i} \frac{(z+1)}{(z+1-i)(z+1+i)z^{1/3}} (z+1-i) = \frac {i}{2i(-1+i)^{\frac 13}}$
And
$\lim_\limits{z\to -1-i} \frac{(z+1)}{(z+1-i)(z+1+i)z^{1/3}} (z+1+i) = \frac {i}{(-2i)(-1-i)^{\frac 13}}$
