calculate: $\int_0^\infty \frac{\log x \, dx}{(x+a)(x+b)}$ using contour integration 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?
 A: 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?
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[10px,#ffd]{\int_{0}^{\infty}{\ln\pars{x} \over \pars{x + a}\pars{x + b}}\,\dd x} =
{1 \over b - a}\lim_{\Lambda \to \infty}\bracks{%
\int_{0}^{\Lambda}{\ln\pars{x} \over x + a}\,\dd x - \int_{0}^{\Lambda}{\ln\pars{x} \over x + b}\,\dd x}\label{1}\tag{1}
\end{align}

\begin{align}
\int_{0}^{\Lambda}{\ln\pars{x} \over x + c}\,\dd x & =
-\int_{0}^{\Lambda}{\ln\pars{-c\braces{x/\bracks{-c}}} \over
1 - x/\pars{-c}}
\,{\dd x \over -c} =
-\int_{0}^{-\Lambda/c}{\ln\pars{-cx} \over 1 - x}\,\dd x
\\[5mm] = &\
\ln\pars{1 + {\Lambda \over c}}\ln\pars{\Lambda} -
\int_{0}^{-\Lambda/c}{\ln\pars{1 - x} \over x}\,\dd x
\\[5mm] = &\
\ln\pars{1 + {\Lambda \over c}}\ln\pars{\Lambda} +
\mrm{Li}_{2}\pars{-\,{\Lambda \over c}}
\\[5mm] = &\
\ln\pars{1 + {\Lambda \over c}}\ln\pars{\Lambda} -
\mrm{Li}_{2}\pars{-\,{c \over \Lambda}} - {\pi^{2} \over 6} -
{1 \over 2}\,\ln^{2}\pars{\Lambda \over c}\label{2}\tag{2}
\\[5mm] \stackrel{\mrm{as}\ \Lambda\ \to\ \infty}{\sim}\,\,\, &\
-\,{1 \over 2}\,\ln^{2}\pars{c} - {\pi^{2} \over 6} +
{1 \over 2}\,\ln^{2}\pars{\Lambda}\label{3}\tag{3}
\end{align}
Replacing (\ref{3}) in (\ref{1}):
$$
\bbox[10px,#ffd,border:2px groove navy]{\int_{0}^{\infty}{\ln\pars{x} \over
\pars{x + a}\pars{x + b}}\,\dd x =
{1 \over 2}\,{\ln^{2}\pars{b} - \ln^{2}\pars{a} \over b - a}}
$$

In (\ref{2}), I used the
Dilogarithm $\ds{\mrm{Li}_{2}}$ Inversion Formula.
