Contour integral along a straight line - why does this simple practice problem fail to be simple? 
Use the residue theorem to compute:$$I=\int_0^\infty\frac{1}{x^3+1}\,\mathrm{d}x$$By using the contour that goes first from $0\to r$ along the real axis ($\gamma_1$), then in an arc from $r\to r\exp(\frac{2}{3}\pi i)$ ($\gamma_2$), then in a straight line from $r\exp(\frac{2}{3}\pi i)\to0$ ($\gamma_3$), taking limits as $r\to\infty$.

Firstly we need to show that the integral along this contour is equivalent to the integral along the real axis, as $r\to\infty$, so it first must be shown that:
$$\lim_{r\to\infty}\int_{\gamma_2}\frac{1}{z^3+1}\,\mathrm{d}z=0$$
This part is straightforward: noticing that the arc, when cubed, is transformed to a circle of radius $r^3$ - missing the point $(r^3,0)$ - and adding $1$ to all values on this circle shifts the circle such that the smallest value of $|z^3+1|$ is $r^3-1$:
$$0\le\lim_{r\to\infty}\left|\int_{\gamma_2}\frac{1}{z^3+1}\,dz\right|\le\lim_{r\to\infty}\frac{2}{3}\pi r\cdot\sup_{\gamma_2}\frac{1}{|z^3+1|}\le\lim_{r\to\infty}\frac{2}{3}\pi r\cdot\frac{1}{r^3-1}=0$$
So the contour $\gamma_2$ is accounted for. Sadly, using the same estimation trick on the straight line segment $\gamma_3$ fails, since the maximum value of $(z^3+1)^{-1}$ on $\gamma_3$ is just $1$, which fails to give a limit to zero. Deciding to crack the integral by hand, I proceeded:
$$\begin{align}\int_{\gamma_3}\frac{1}{z^3+1}\,\mathrm{d}z&=\int_r^0\frac{\exp\frac{2}{3}\pi i}{(t\exp\frac{2}{3}\pi i)^3+1}\,\mathrm{d}t\\&=-\exp\frac{2}{3}\pi i\int_0^r\frac{1}{t^3+1}\,\mathrm{d}t\end{align}$$
And got immediately stuck. According to Wolfram Alpha, the antiderivative does exist but it is not at all clear that as $r\to\infty$, the integral goes to $0$. Besides, this is a practice problem; although university level, I doubt one has to crack a very tricky antiderivative and an unclear limit. What am I doing wrong? As far as I understand it, in order for the residue theorem to be of any use, the contour integral enclosing the singularity must first be shown to evaluate to the integral along the real axis.
 A: For any students confused as I was, the answer is simpler than I first thought (credit to the users Pax, Jean Marie): the integral I struggled to evaluate at the bottom is in fact just a constant multiple of the original integral, as $r\to\infty$.
With this in mind, my answer comes out as (where $\gamma=\gamma_0+\gamma_1+\gamma_2$):
$$\begin{align}\lim_{r\to\infty}\int_\gamma\frac{1}{z^3+1}\,\mathrm{d}z&=I-\exp\left(\frac{2}{3}\pi i\right)I\\&=2\pi i\cdot\operatorname{Res}\left(\frac{1}{z^3+1},\,\exp\left(\frac{1}{3}\pi i\right)\right)\\&=2\pi i\cdot\frac{1}{3}\exp\left(-\frac{2}{3}\pi i\right)\\\implies I&=2\pi i\cdot\frac{\exp\left(-\frac{2}{3}\pi i\right)}{1-\exp\left(\frac{2}{3}\pi i\right)}\\&=\frac{2\pi i}{3}\cdot\frac{-\frac{1}{2}-\frac{\sqrt{3}}{2}}{1-\left(\frac{1}{2}+\frac{\sqrt{3}}{2}\right)}\\&=\frac{2\pi i}{3}\cdot\frac{1+i}{-3+\sqrt{3}i}\\&=\frac{2\pi i}{3}\cdot\frac{-4\sqrt{3}i}{12}\\&=\frac{2\pi i}{3}\cdot\frac{-i}{\sqrt{3}}\\&=\frac{2\pi}{3\sqrt{3}}\\\therefore\int_0^\infty\frac{1}{x^3+1}\,\mathrm{d}x&=\frac{2\pi}{3\sqrt{3}}\end{align}$$
Which is the correct answer as corroborated by other posts on this site.
About the residue:
Let $\zeta=\exp\frac{1}{3}\pi i$, the cube root of $-1$ that is present in the contour's interior. As this is a simple pole of $\frac{1}{z^3+1}$, the following limit finds the residue.
$$\operatorname{Res}\left(\frac{1}{z^3+1},\exp\frac{1}{3}\pi i\right)=\lim_{z\to\zeta}\frac{z-\zeta}{z^3+1}=\lim_{z\to\zeta}\frac{1}{z^2+\zeta z+\zeta^2}=\frac{1}{3\zeta^2}=\frac{1}{3}\exp\left(-\frac{2}{3}\pi i\right)$$
Where one step was achieved by simple polynomial division.
