I've been trying to calculate $$\int_0^\infty\frac{1}{x^a(1-x)}\,dx\quad\text{with }0<a<1.$$I haven't had much luck. I tried taking the branch cut with of the positive reals and estimating that way, but I wasn't sure how to handle the poles at $z=0$ and $z=1$ when dealing with branch cuts. I also looked at the Wikipedia page to try to get some insight, but I didn't see any similar examples with the contour closing in on poles that are on a branch cut.
Complex Analysis – Contour Integration of $\int_0^\infty\frac{1}{x^a(1-x)}\,dx$ for $0
complex-analysiscontour-integration
Related Solutions
Consider $f(\omega) = \omega^{-3/4} (x-\omega)^{-3/4} (1-\omega)^{-3/4}$ and $ I(x) = \oint_{\vert \omega \vert = x} f(\omega) \mathrm{d} \omega$.
The function $f(\omega)$ is discontinuous at $\omega = -x$ along $\vert \omega \vert = x$ and has integrable singularity at $\omega = x$. Making a change of variables, $\omega = x z$: $$ I(x) = \frac{1}{\sqrt{x}} \oint_{\vert z \vert = 1} z^{-3/4} (1-z)^{-3/4} (1-x z)^{-3/4} \mathrm{d} z = \frac{1}{\sqrt{x}} \oint_{\vert z \vert = 1} h\left(z\right) \, \mathrm{d} z $$
Let $\mathcal{C}$ denote the circle $\vert z \vert = 1$. Let $C_{-1, \delta}$ denote segment of $\mathcal{C}$ which crosses the negative axis and of length $2 \pi \delta$, with $\pi \delta$ above and $\pi \delta$ below the negative axis.
It is clear that integral along $\mathcal{C}_{-1,\delta}$ is vanishing as $\delta \to 0$: $$ \begin{eqnarray} \left\vert \int_{\mathcal{C}_{-1,\delta}} z^{-3/4} (1-z)^{-3/4} (1-x z)^{-3/4} \mathrm{d} z \right\vert &\le& (2(1+x))^{-3/4} \left\vert \int_{\mathcal{C}_{-1,\delta}} z^{-3/4} \mathrm{d} z \right\vert \\ &=& \left(2 (1+x) \right)^{-3/4} \frac{8\sqrt{2}}{7} \sin\left(\frac{7 \delta}{8}\right) \left( \cos\left(\frac{7 \delta}{8}\right) - \sin\left(\frac{7 \delta}{8}\right) \right) \\ &\le& \sqrt{2} \delta \left(2 (1+x) \right)^{-3/4} \end{eqnarray} $$
Let's complete $\mathcal{C} \backslash \mathcal{C}_{-1,\delta}$ with integration along $(-1,0)$ above the axis and then along $(0,-1)$ below the axis so as to complete the contour, and call the completed contour $\mathcal{L}$. Then $$ \begin{eqnarray} \oint_{\mathcal{C}} h\left(z\right) \, \mathrm{d} z &=& \oint_{\mathcal{L}} h\left(z\right) \, \mathrm{d} z + \int_0^1 \left( h\left(-y - i \epsilon \right) - h\left(-y + i \epsilon \right) \right)\, \mathrm{d} y \\ &=& \oint_{\mathcal{L}} h\left(z\right) \, \mathrm{d} z + \left( \mathrm{e}^{i \frac{3 \pi}{4}} - \mathrm{e}^{-i \frac{3 \pi}{4}} \right) \int_0^1 y^{-3/4}(1+y)^{-3/4}(1+x y)^{-3/4} \mathrm{d} y \end{eqnarray} $$ The claim is that the principal value of $\oint_\mathcal{L} h(z) \mathrm{d} z = 0$, so we get $$ I(x) = \frac{2 i \sin\left( 3/4 \pi \right)}{\sqrt{x}} \int_0^1 y^{-3/4}(1+y)^{-3/4}(1+x y)^{-3/4} \mathrm{d} y $$
Now, let's check this with quadratures:
Notice that the purported answer you gave in your post can not be correct, as it is not purely imaginary.
Consider the integral
$$\oint_C dz \frac{\log^2{z}}{(1+z)^3}$$
where $C$ is a keyhole contour in the complex plane, about the positive real axis. This contour integral may be seen to vanish along the outer and inner circular contours about the origin, so the contour integral is simply equal to
$$\int_0^{\infty} dx \frac{\log^2{x}-(\log{x}+i 2 \pi)^2}{(1+x)^3} = -i 4 \pi \int_0^{\infty} dx \frac{\log{x}}{(1+x)^3}+4 \pi^2 \int_0^{\infty} dx \frac{1}{(1+x)^3}$$
By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the residue at the pole $z=-1=e^{i \pi}$. In this case, with the triple pole, we have the residue being equal to
$$\frac12 \left [ \frac{d^2}{dz^2} \log^2{z}\right]_{z=e^{i \pi}} = 1-i \pi$$
Thus we have that
$$-i 4 \pi \int_0^{\infty} dx \frac{\log{x}}{(1+x)^3}+4 \pi^2 \frac12 = i 2 \pi + 2 \pi^2$$
which implies that
$$\int_0^{\infty} dx \frac{\log{x}}{(1+x)^3} = -\frac12$$
Best Answer
You use an almost-keyhole contour, except that you indent both paths above and below the real axis with a small semicircle to avoid the pole at $z=1$:
In doing this, you end up with not $4$, but $8$ contour segments. I will avoid writing them all out by noting that the integrals over the outer circular arc and inner circular arc at the origin vanish in the limits of their radii going to $\infty$ and $0$, respectively. We are left with
$$\oint_C dz \frac{z^{-a}}{1-z} = \int_{\epsilon}^{1-\epsilon} dx \frac{x^{-a}}{1-x} + i \epsilon \int_{\pi}^0 d\phi\, e^{i \phi} \frac{(1+\epsilon e^{i \phi})^{-a}}{-\epsilon e^{i \phi}} + \int_{1+\epsilon}^{\infty} dx \frac{x^{-a}}{1-x} \\+e^{-i 2 \pi a} \int_{\infty}^{1+\epsilon} dx \frac{x^{-a}}{1-x} +e^{-i 2 \pi a} i \epsilon \int_{2 \pi}^{\pi} d\phi\, e^{i \phi} \frac{(1+\epsilon e^{i \phi})^{-a}}{-\epsilon e^{i \phi}} +e^{-i 2 \pi a} \int_{1-\epsilon}^{\epsilon} dx \frac{x^{-a}}{1-x} $$
Combining like terms, we get
$$\oint_C dz \frac{z^{-a}}{1-z} = \left ( 1-e^{-i 2 \pi a}\right ) PV\int_{0}^{\infty} dx \frac{x^{-a}}{1-x} + \left ( 1+e^{-i 2 \pi a}\right ) i \pi = 0$$
because of Cauchy's Theorem. $PV$ denotes the Cauchy principal value. After a little algebra, the result is
$$PV\int_{0}^{\infty} dx \frac{x^{-a}}{1-x} = -i \pi \frac{1+e^{-i 2 \pi a}}{1-e^{-i 2 \pi a}}=-\pi \cot{\pi a}$$
EXAMPLE
Let's check the result for $a=1/2$. This would imply that
$$PV \int _{0}^{\infty} dx \frac{1}{\sqrt{x} (1-x)} = 0$$
Consider
$$\begin{align}\underbrace{\int_0^{1-\epsilon} dx \frac{1}{\sqrt{x} (1-x)}}_{x=1/u} &= \int_{1/(1-\epsilon)}^{\infty} \frac{du}{u^2} \frac{\sqrt{u}}{1-(1/u)} \\ &= -\int_{1+\epsilon}^{\infty} du \frac{1}{\sqrt{u} (1-u)}\end{align}$$
Thus
$$\int_0^{1-\epsilon} dx \frac{1}{\sqrt{x} (1-x)} + \int_{1+\epsilon}^{\infty} du \frac{1}{\sqrt{u} (1-u)} = 0$$
or
$$PV \int _{0}^{\infty} dx \frac{1}{\sqrt{x} (1-x)} = 0$$
as was to be demonstrated.