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.