I'm supposed to calculate
$$\int_0^{\infty}\frac{1}{(x+1)(x-2)}dx$$
using residues. The typical procedure on a problem like this would be to integrate a contour going around an upper-half semicircle of radius $R$, and come back through the real axis, taking two indents on the path at the points $z=-1$, $z=2$, say of radius $\rho_1,\rho_2$ respectively. Then the total integral around the path is $0$ and I can calculate the limits as $\rho_1,\rho_2\to0$ and $R\to\infty$ using the known formulas/theorems. However, this leaves me with $\int_{-\infty}^{\infty}\frac{1}{(x+1)(x-2)}dx$, instead of $0$ to $\infty$. And the function is not even so I can't just take half of the whole integral.
Does anybody know a way around this problem? Taking a path going a quarter around the circle and back down to the origin seems unnecessarily complicated, and I'm not even sure that would work here.

You use, as Jack said, a keyhole contour with bumps above and below the pos. real axis at $z=2$. Thus, if $C$ is that keyhole contour with the bumps of radius $\epsilon$, we consider
$$\oint_C dz \frac{\log{z}}{(z+1)(z-2)}$$
which is equal to (assuming we have taken the radius of the large circular arc to go to $\infty$)
$$PV \int_0^{\infty} dx \frac{\log{x}}{(x+1)(x-2)} + i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{\log{(2+\epsilon e^{i \phi}})}{(3+ \epsilon e^{i \phi})(e^{i \phi})} \\ + PV \int_{\infty}^0 dx \frac{\log{x}+i 2 \pi}{(x+1)(x-2)} + i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{\log{(2+\epsilon e^{i \phi})+i 2 \pi}}{(3+ \epsilon e^{i \phi})(e^{i \phi})} $$
The contour integral is equal to $i 2 \pi$ times the residue at the pole $z=e^{i \pi}$. Thus,
$$-i 2 \pi PV \int_0^{\infty} \frac{dx}{(x+1)(x-2)} - i 2 \pi \frac{\log{2}}{3} + \frac{2 \pi^2}{3} = i 2 \pi \frac{i \pi}{-3}$$
Therefore we now say that
$$PV \int_0^{\infty} \frac{dx}{(x+1)(x-2)} = - \frac{\log{2}}{3} $$