If $|p|<1$, how to find the Cauchy Principal Value of $$\int_0^\infty \frac{x^{-p}}{x-1}dx$$
I tried spliting the integration from $0\to 1$ and $1 \to \infty$ and switching $x = 1/u$, but no luck getting desired result which the book says is $ \pi \cot p \pi$. Please help.
ADDED:: using above method I got $\displaystyle \sum_{k=0}^\infty \left( \frac{1}{k + p} + \frac{1}{p - (k+1)} \right) $, it turned out to be $p \cot p\pi$ from Mathematica, anyone any ideas?
ADDED:: It seems that $$\displaystyle \sum_{k=0}^\infty \left( \frac{1}{k + p} + \frac{1}{p - (k+1)} \right) = \sum_{k=-\infty}^\infty \frac{1}{k +p} = - \text{Res}[ \pi \cot(z \pi)/(p+z), z=-p] = \pi \cot p\pi$$
Also I was having trouble doing this via contour. Is this the shape of contour?

Note: we must restrict $p$ to $p \in (0,1)$ for the Cauchy PV of the integral to converge at infinity.
The idea is to consider an integral in the complex plane and use Cauchy's theorem. That is, if we define a contour $C$ within which there are no poles, we have
$$\oint_C dz \frac{z^{-p}}{z-1} = 0$$
$C$ will take the form of a keyhole contour, except that we will indent with a semicircle about the singularity at $z=1$ each time we make a pass along the real axis. Thus, the above contour integral is broken up into $8$ pieces:
$$\oint_C dz \frac{z^{-p}}{z-1} = \int_{\epsilon}^{1-\epsilon} dx \frac{x^{-p}}{x-1} + i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{(1+\epsilon e^{i \phi})^{-p}}{\epsilon e^{i \phi}} + \int_{1+\epsilon}^{R} dx \frac{x^{-p}}{x-1} + \\i R \int_{0}^{2 \pi} d\phi \, e^{i \phi} \frac{R^{-p} e^{-i p \phi}}{R e^{i \phi}-1} + e^{-i 2 \pi p}\int_{R}^{1+\epsilon} dx \frac{x^{-p}}{x-1} + \\ i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{(e^{i 2 \pi}+\epsilon e^{i \phi})^{-p}}{\epsilon e^{i \phi}} + e^{-i 2 \pi p} \int_{1-\epsilon}^{\epsilon} dx \frac{x^{-p}}{x-1} + \\ i \epsilon \int_{2 \pi}^0 d\phi \, e^{i \phi} \frac{\epsilon^{-p} e^{-i p \phi}}{\epsilon e^{i \phi}-1} $$
Note that when we make the second pass along the real axis, we exploit the fact that we have traversed $2 \pi$ in argument, so we parametrize the real line using $z=x\, e^{i 2 \pi}$. The multivaluedness of the integrand produces the nontrivial result we seek.
We take the limit as $\epsilon \to 0$ and $R \to \infty$. The integrals over $x$ combine to form a factor times the Cauchy PV we seek. The fourth and eighth integrals vanish in this limit because of the restriction over the value of $p$. We are then left with the integrals over the bumps which do not vanish. We thus have, after some simplification:
$$\left ( 1-e^{-i 2 \pi p}\right ) PV \int_0^{\infty} dx \frac{x^{-p}}{x-1} - i \pi \left ( 1+e^{-i 2 \pi p}\right ) = 0$$
Note that the second term comes from evaluating the second and sixth integrals and combining, while the first term comes from combining the first, third, fifth, and seventh integrals.
Solving for the Cauchy principal value, we get
$$PV \int_0^{\infty} dx \frac{x^{-p}}{x-1} = i \pi \frac{1+e^{-i 2 \pi p}}{1-e^{-i 2 \pi p}} = \pi \cot{\pi p}$$