I'm working on the following excercise:
Calculate:
$$\int_0^{+\infty} \frac{x^{\frac{1}{3}}\sin (x+\frac{\pi}{3})}{x^2+1}\operatorname dx$$
Using the contour-integral $\int_{\Gamma} \frac{z^{\frac{1}{3}}e^{i(z+\frac{\pi}{3})}}{z^2+1}\operatorname dz$ as follows:

I've evaluated the integral using the residue theorem, i've proven $\int_{\Gamma_1}f(z)\operatorname dz \to 0$ and $\int_{\Gamma_2}f(z)\operatorname dz \to 0$.
But i've encoutered a problem on the remaining parts:
$$\int_{\Gamma_3} f(z) \operatorname dz = \int_R^\delta \frac{(-x)^{\frac{1}{3}} e^{i(-x+\frac{\pi}{3})}}{x^2-1}\operatorname d (-x) \qquad \int_{\Gamma_4} f(z) \operatorname dz = \int_R^\delta \frac{x^{\frac{1}{3}} e^{i(x+\frac{\pi}{3})}}{x^2-1}\operatorname d x$$
I think the second integral looks fine, but the first one gives me a headache.
option 1:
$$\int_R^\delta \frac{(-x)^{\frac{1}{3}} e^{i(-x+\frac{\pi}{3})}}{x^2-1}\operatorname d (-x) = -\int_\delta^R \frac{x^{\frac{1}{3}} e^{-i(x-\frac{\pi}{3})}}{x^2-1}\operatorname d x$$ $$= -\int_\delta^R \frac{x^{\frac{1}{3}} e^{-i(x+\frac{\pi}{3})}e^{i\frac{2\pi}{3}}}{x^2-1}\operatorname d x$$ $$= -e^{i\frac{2\pi}{3}}\int_\delta^R \frac{x^{\frac{1}{3}} e^{-i(x+\frac{\pi}{3})}}{x^2-1}\operatorname d x$$
option 2:
$$\int_R^\delta \frac{(-x)^{\frac{1}{3}} e^{i(-x+\frac{\pi}{3})}}{x^2-1}\operatorname d (-x) = \int_\delta^R \frac{e^{i\frac{\pi}{3}}x^{\frac{1}{3}} e^{-i(x-\frac{\pi}{3})}}{x^2-1}\operatorname d x$$ $$= \int_\delta^R \frac{x^{\frac{1}{3}} e^{-i(x-\frac{2\pi}{3})}}{x^2-1}\operatorname d x$$ $$= \int_\delta^R \frac{x^{\frac{1}{3}} e^{-i(x+\frac{\pi}{3})}e^{i\pi}}{x^2-1}\operatorname d x$$ $$= -\int_\delta^R \frac{x^{\frac{1}{3}} e^{-i(x+\frac{\pi}{3})}}{x^2-1}\operatorname d x$$
Those solutions can't be equal can they? What causes this problem?
I think it has something to do with the $(-x)^{\frac{1}{3}}$ is this equal to $-x^{\frac{1}{3}}$ or $e^{i\frac{\pi}{3}}x^{\frac{1}{3}}$? When should I use Euler's identity?
EDIT
Thank you for your reply Michael. I don't fully understand it. And I would like to illustrate with another related problem.
Integrate over the curve $\Gamma$:
$$\int_{\Gamma} \frac{z^{\frac{1}{3}}}{z^2+z+1} \operatorname dz$$

After finding the poles, calculating the residue etc... I get to the remaining contours $\Gamma_1$ and $\Gamma_3$. $$\int_{\Gamma_1} f(z) \operatorname d z = \int_\delta^R \frac{x^{\frac{1}{3}}}{x^2+x+1}\operatorname d x \qquad \int_{\Gamma_3} f(z) \operatorname d z = \int_R^\delta \frac{x^{\frac{1}{3}}}{x^2+x+1}\operatorname d x$$
And once again the last integral can't be right. I guess it should be $x^\frac{1}{3}e^{i\frac{2\pi}{3}}$?
But the reason is not clear. Why use $e^{i2\pi}$ in $\Gamma_3$ and not in $\Gamma_1$?
In the region enclosed by the path, $(-x)^{1/3}=e^{i\pi/3}x^{1/3}$ by continuity. The cube-root has a cut from the origin to $-i\infty$.
When you do the path in the lower half-plane, $(-x)^{1/3}=e^{-i\pi/3}x^{1/3}$ for the same reason, and the cube-root has a cut from $0$ to $+i\infty$.