# 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?

• It's called interval, but Maybe I'm not aware of the term "rectangle". – UmbQbify Aug 4 '20 at 22:30
• interval is on one dimension, I'm taking about 2D "interval". – hash man Aug 4 '20 at 22:30
• actually it isn't as it refers to a fixed pole at 1 where here both of my poles are on the negative side. @DennisOrton – hash man Aug 4 '20 at 22:36
• and I'm looking for a way to solve it with complex analysis. – hash man Aug 4 '20 at 22:38
• @ThreeSidedCoin The answers in that referenced post do not use (1) Complex Analysis, (2) Contour Integration, or (3) Residue Calculus, which are three out of four of the tags and moreover the essence of the OP's attempted solution. So, it does not come even close to answering the OP's question. – Mark Viola Aug 5 '20 at 0:11

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?

• can you explain why you moved to $\displaystyle \oint_{C}\frac{\log^2(z)}{(z+a)(z+b)}\,dz$ instead of $\displaystyle \oint_{C}\frac{\log(z)}{(z+a)(z+b)}\,dz$? – hash man Aug 5 '20 at 7:29
• Yes. If we used $\log(z)$ instead, then the difference $(\log(z)+i2\pi) -(\log(z))=i2\pi$ annihilates the logarithm term. – Mark Viola Aug 5 '20 at 13:36
• okay then, why $\displaystyle \oint_{C}\frac{\log^2(z)}{(z+a)(z+b)}\,dz=\displaystyle \oint_{C}\frac{\log(z)}{(z+a)(z+b)}\,dz$? – hash man Aug 5 '20 at 13:57
• Note that $$(\log(z)+i2\pi )^2-(\log(z))^2=i4\pi \log(z)-4\pi^2$$so we retain a term with $\log(z)$. – Mark Viola Aug 5 '20 at 14:12
• another question if I may when you take the limit with the 4th integral on (1) , why is it legit? I mean if I try to calculate the residue, every circle will be $2\pi i$, but you just took the limit, and decided based that the limit of the function is 0, then its whole integral is 0. – hash man Aug 5 '20 at 16:53

$$\newcommand{\bbx}{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}{\mathcal{#1}} \newcommand{\mrm}{\mathrm{#1}} \newcommand{\pars}{\left(\,{#1}\,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}{\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.

• thanks for the solution, though it seems that you use a different niche of math from what I look for. can you explain what {} mean in the 2nd row? – hash man Aug 5 '20 at 7:41
• @hashman It's just for grouping the factors. It clarifies the next step. Indeed, it amounts to make the variable change $\displaystyle x/\left(\,{-c}\,\right) \mapsto x$. Thanks. – Felix Marin Aug 5 '20 at 13:25