$ \int_0 ^\infty \frac{1}{x^3+1}dx$
Using for contour 1/3 of a circumference of radius R and $ \theta \in [0, \frac{2\pi}{3}] $ and two segments from $0$ to $R$ and from $0$ to $Re^{i\frac{2\pi}{3}}$
$ \int_0 ^\infty \frac{1}{x^3+1}dx$
Using for contour 1/3 of a circumference of radius R and $ \theta \in [0, \frac{2\pi}{3}] $ and two segments from $0$ to $R$ and from $0$ to $Re^{i\frac{2\pi}{3}}$
We have the contour $\;\Gamma_R\;$:
$$[0,R]\cup\eta_R:=\left\{z\in\Bbb C\;/\;z=Re^{it},\;0<t<\frac{2\pi}3\right\}\cup C:=\left\{z\in\Bbb C\;/\;z=xe^{2\pi i/3},\;0\le x\le R\right\}$$
Now, with $\;f(z)=\cfrac1{z^3+1}\;$ , we have that
$$\text{Res}_{z=e^{\pi i/3}}(f)=\lim_{z\to e^{\pi i/3}}(z-e^{\pi ie})f(z)=\frac1{3e^{2\pi i/3}}=-\frac16-\frac{\sqrt3}6i$$
Also:
$$\left|\int_{\eta_R}f(z)dz\right|\;\le\frac{2\pi R}3\cdot\frac1{R^3-1}\xrightarrow[R\to\infty]{}0$$
and since on the ray $\;C\;$ we have $$z=xe^{2\pi i/3}\implies dz=e^{2\pi i/3}dx\implies z^3+1=(xe^{2\pi i/3})^3+1=x^3+1\;$$
we get that (observe we go on the ray from the upper part to the lower one, and this explains the sign...)
$$\int_Cf(z)dz=-\int_0^R\frac{e^{2\pi i/3}dx}{x^3+1}\xrightarrow[R\to\infty]{}-e^{2\pi i/3}\int_0^\infty\frac{dx}{x^3+1}$$
And thus, applying the Residue Theorem:
$$2\pi i\left(-\frac16-\frac{\sqrt3}6i\right)=\lim_{R\to\infty}\oint_{\Gamma_R} f(z)\,dz=\left(1-e^{2\pi i/3}\right)\int_0^\infty\frac{dx}{x^3+1}$$
and (observe that $\;1-e^{2\pi i/3}=\frac32-\frac{\sqrt3}2i\;$):
$$\int_0^\infty\frac{dx}{x^3+1}=2\pi i\left(-\frac16-\frac{\sqrt3}6i\right)\cdot\frac1{\frac32-\frac{\sqrt3}2i}=-\frac{2\pi i}{3\sqrt3}\cdot\frac{1+\sqrt3\,i}{\sqrt3-i}=$$
$$=-\frac{2\pi i}{3\sqrt3}\cdot\frac{4\,i}4=\color{red}{\frac{2\pi}{3\sqrt3}}$$