<s>[INST] Use Complex Integrals/ Residue to evaluate $\int_0^\infty \frac{dx}{(x+1)^3 + 1}$ 
Use Complex Integrals/ Residue to evaluate $\int_0^\infty \frac{dx}{(x+1)^3 + 1}$

I'm not sure how to do this integration. It looks like partial fractions but I'm unsure. 
 [/INST] Generally, we can evaluate integrals of the form
$$\int_0^{\infty} dx \, f(x)$$
using a contour integral of the form
$$\oint_c dz \, f(z) \log{z} $$
As long as $f$ is sufficiently well-behaved at the origin and at infinity and in between, we have
$$-i 2 \pi \int_0^{\infty} dx \, f(x)  = i 2 \pi \sum_k \operatorname*{Res}_{z=z_k} f(z) \log{z_k}$$
In this case
$$f(z) = \frac1{(1+z)^3+1}$$
so that, for $k \in \{0,1,2\}$: 
$$z_k = -1 + e^{i (2 k+1) \pi/3} = -\left [1-\cos{(2 k+1) \frac{\pi}{3}}\right ] + i \sin{(2 k+1) \frac{\pi}{3}}$$
Thus,
$$\int_0^{\infty} \frac{dx}{(1+x)^3+1} = -\sum_{k=0}^2 \frac{\log{z_k}}{3 e^{i 2 (2 k+1) \pi/3}}$$
where
$$\begin{align}\log{z_k} &= \log{|z_k|} + i \arg{z_k} \\ &= \log{2 \left | \sin{(2 k+1) \frac{\pi}{6}} \right |} - i \arctan{\cot{(2 k+1) \frac{\pi}{6}}} \\ &= \log{2} - i \frac{\pi}{2} + \log{\sin{(2 k+1) \frac{\pi}{6}}} + i (2 k+1) \frac{\pi}{6}\end{align}$$
so that
$$\begin{align}\sum_{k=0}^2 \frac{\log{z_k}}{3 e^{i 2 (2 k+1) \pi/3}} &= -i \frac13 \frac{\pi}{3} e^{-i 2 \pi/3} + \frac13 \log{2} e^{-i 2 \pi} + i \frac13 \frac{\pi}{3} e^{i 2 \pi/3}\\ &= -\frac{2 \pi}{9} \sin{\frac{2 \pi}{3}} + \frac13 \log{2}\end{align}$$
Finally, we may conclude that

$$\int_0^{\infty} \frac{dx}{(1+x)^3+1} = \frac{\pi}{3 \sqrt{3}} - \frac13 \log{2} $$

This agrees with a numerical integral in Mathematica v 9.0.
</s>