The integral I'd like to evaluate is $\int_0^\infty \frac{\log^2 x \, dx}{(1+x)^2}$. I consider the function $f(z) = \frac{\text{Log}^2 z}{(1+z)^2}$, which has a pole of order 2 at $z=-1$ and has a branch point at $z=0$. I set up the integral $\oint_C f(z) dz$ along the contour $C = C_1 + C_2 + C_3 + C_4 + C_5 + C_6$, which consists of $C_1$ going just above the branch cut from $0$ to infinity, $C_2$, which is a big half-circle, $C_3$, which is a piece along the real axis from infinity to a point infinitesimally close to $z=-1$, $C_4$, which is a small half-circle going around $z=-1$ clockwise, $C_5$, which is another small piece on the real axis, and, finally, $C_6$, which is a quarter-circle around the origin to close the contour.
Now, I take the branch with $\text{Log}(z) = \log(r) + i \theta$, $0 \le\theta<2\pi$. Then the piece along $C_1$ is the integral $I$ I want to calculate. The pieces along $C_2$ and $C_6$ are zero when we take appropriate limits, but I'm not sure what to do with all the other pieces, since we can't really (can we?) write them in a way "$\text{something} \cdot I$", because of the singularity at $z=-1$. I know what I would do in the case of $1+z^2$ in the denominator, but not in this one. Suggestions?