I want to compute the integral $I=\int_0^\infty \frac{\ln x}{x^a(1+x)} dx, 0<a<1$ using contour integral.
I tried to tackle the problem by considering the function $f(z)=\frac{\log z}{z^a(1+z)}$, where the argument of $\log z$ is in the range $(0, 2\pi)$, and integrating over the counterclockwise "pacman contour"1. It's standard to show that the integrals over the large arc and small arc converge to zero as we take limit, so it remains to calculate the two integrals over positive real axis. Here's my work:
The integral along the path slightly above the real axis is exactly $I$. The integral along the path slightly below the real axis (with reversed limits of integration) is
$\int_0^\infty \frac{\log z}{z^a(1+z)} dz = \int_0^\infty \frac{\log x + 2\pi i}{e^{a (\log x + 2\pi i)}(1+x)}dx=e^{-2\pi ia}I + e^{-2\pi i a}2\pi i \int_0^\infty \frac{1}{x^a (1+x)}dx$
Then the value of the contour integral is $(1-e^{-2\pi ia})I-e^{-2\pi i a}2\pi i \int_0^\infty \frac{1}{x^a (1+x)}dx=2\pi i \mathrm{res}(f, -1)$. But this doesn't give me the correct answer. Can anyone show me where I went wrong in the calculation?
This is easily solved through Feynman's trick and the Beta function. For any $a\in(0,1)$ we have $$ f(a) = \int_{0}^{+\infty}\frac{dx}{x^a(1+x)}\stackrel{\frac{1}{1+x}\mapsto z}{=} \int_{0}^{1}z^{a-1}(1-z)^{-a}\,dz=\Gamma(a)\Gamma(1-a)=\frac{\pi}{\sin(\pi a)}$$ so $$ \int_{0}^{+\infty}\frac{\log(x)\,dx}{x^a(1+x)} = -f'(a) = \color{red}{\frac{\pi^2\cos(\pi a)}{\sin^2(\pi a)}}.$$