I am trying to use the residue theorem to evaluate $$I=\int_0 ^{\infty}\frac{dx}{x^{1/3}(1+x)}$$ I'll explain my difficulty in finding a contour, then I explain my difficulty in finding a new contour after a substitution.
Consider the complexification $$f(z)=\frac{1}{z^{1/3}(1+z)}$$ where we choose the branch of the radical given by $$z^{1/3}=r^{1/3}e^{i\theta}, -\pi /2<\theta < 3\pi /2$$ (I'm open to using a different branch if convenient). The poles of $f$ are at $0,-1$, and I am not sure what contour I should use. I'm convinced that I am going to use a wedge, but I am not sure at which angle to make the wedge (that is, I am unsure of the angle of the line $\gamma_3$ lies on - see the pic below). In a different example that involved a square root, I was told "the angle should be twice the argument of the pole," but I have two poles; I don't know the argument of $0$ and if I double or triple the argument of $-1$, I land back on the real axis and my contour will have two overlapping sides or will intersect itself.

On the other hand, if we apply the $u$-substitution $u=x^{1/3}$, then $I$ becomes $$3\int_0^{\infty}\frac{u}{1+u^3}du$$, and the (complexification of the) integrand has poles at $-1,e^{\pi i /3}, e^{-\pi i /3}$. In this case, I am also unsure of how to determine the angle at which $\gamma_2$ should be (see pic below). I beleive the modified integral can be solved using partial fractions (and no complex analysis), but I prefer to use complex for now.

Question: How can I choose the right contour in each case, and should one always consider using a $u$-substitution when the integrand has rational powers of $x$?
The integral is the Beta Function integral for $$ \mathrm{B}(\tfrac23,\tfrac13)=\frac{\Gamma(\frac23)\Gamma(\frac13)}{\Gamma(1)}=\frac\pi{\sin(\frac\pi3)}=\frac{2\pi}{\sqrt3} $$
Contour Integration
If we use the keyhole contour $\gamma$
we get $$ \begin{align} \int_\gamma\frac{z^{-1/3}\,\mathrm{d}z}{1+z} &=\underbrace{\int_0^\infty\frac{x^{-1/3}\,\mathrm{d}x}{1+x}}_{\begin{array}{c}\text{line above}\\\text{the positive reals}\end{array}} -\underbrace{e^{-2\pi i/3}\int_0^\infty\frac{x^{-1/3}\,\mathrm{d}x}{1+x}}_{\begin{array}{c}\text{line below}\\\text{the positive reals}\end{array}}\\ &=(1-e^{-2\pi i/3})\int_0^\infty\frac{x^{-1/3}\,\mathrm{d}x}{1+x} \end{align} $$ because the integral along the two circular contours vanishes as the outside one gets larger and the inside one gets smaller.
The contour integral along $\gamma$ equals $2\pi i$ times the residue of $\frac{z^{-1/3}}{1+z}$ at $z=-1=e^{\pi i}$.