Calculate: $\int_0^\infty \frac{\log x \, dx}{(x+a)(x+b)}$ using contour integration

complex-analysiscontour-integrationintegrationresidue-calculus

given $ a\neq b;b,a,b>0 $
calculate: $\int_0^\infty\frac{\log x \, dx}{(x+a)(x+b)}$
my try:
I take on the rectangle: $[-\varepsilon,\infty]\times[-\varepsilon,\varepsilon]$ I have only two simple poles outside $x=-a,$ $x=-b,$ therefore according the residue theorem it must be $4\pi i$.
My problem, is that in the rectangle I left inside there is a pole and when epsilon reaches $0$ the rectangle actually goes through it. Isn't it problematic?

Best Answer

A standard way forward to evaluate an integral such as $\displaystyle \int_0^\infty \frac{\log(x)}{(x+a)(x+b)}\,dx$ using contour integration is to evaluate the contour integral $\displaystyle \oint_{C}\frac{\log^2(z)}{(z+a)(z+b)}\,dz$ where $C$ is the classical keyhole contour.

Proceeding accordingly we cut the plane with a branch cut extending from $0$ to the point at infinity along the positive real axis. Then, we have

$$\begin{align} \oint_{C} \frac{\log^2(z)}{(z+a)(z+b)}\,dz&=\int_\varepsilon^R \frac{\log^2(x)}{(x+a)(x+b)}\,dx\\\\ & +\int_0^{2\pi}\frac{\log^2(Re^{i\phi})}{(Re^{i\phi}+a)(Re^{i\phi}+b)}\,iRe^{i\phi}\,d\phi\\\\ &+\int_R^\varepsilon \frac{(\log(x)+i2\pi)^2}{(x+a)(x+b)}\,dx\\\\ &+\int_{2\pi}^0 \frac{\log^2(\varepsilon e^{i\phi})}{(\varepsilon e^{i\phi}+a)(\varepsilon e^{i\phi}+b)}\,i\varepsilon e^{i\phi}\,d\phi\tag1 \end{align}$$

As $R\to \infty$ and $\varepsilon\to 0$, the second and fourth integrals on the right-hand side of $(1)$ vanish and we find that

$$\begin{align}\lim_{R\to\infty\\\varepsilon\to0}\oint_{C} \frac{\log^2(z)}{(z+a)(z+b)}\,dz&=-i4\pi \int_0^\infty \frac{\log(x)}{(x+a)(x+b)}\,dx\\\\ &+4\pi^2\int_0^\infty \frac{1}{(x+a)(x+b)}\,dx\tag2 \end{align}$$

And from the residue theorem, we have for $R>\max(a,b)$

$$\begin{align} \oint_{C} \frac{\log^2(z)}{(z+a)(z+b)}\,dz&=2\pi i \left(\frac{(\log(a)+i\pi)^2}{b-a}+\frac{(\log(b)+i\pi)^2}{a-b}\right)\\\\ &=2\pi i\left(\frac{\log^2(a)-\log^2(b)}{b-a}\right)-4\pi ^2 \frac{\log(a/b)}{b-a} \tag3 \end{align}$$

Now, finish by equating the real and imaginary parts of $(2)$ and $(3)$.

Can you finish now?