# Definite integral involving a log and a rational function.

Let $a \ge 0$ and $1/3 \ge b \ge 0$.

In the course of answering question Evaluating a double integral of a complicated rational function we came across a following integral: $${\mathfrak I}(a,b):=\int\limits_{-\infty}^\infty \frac{\log(b^2+x^2)}{(x+a/2)^2+(1-b)^2/4} dx$$ Now, since the integrand is a product of a logarithm and a rational function it the anti-derivative of the integrand can be always found as a collection of terms that involve logs and di-logarithms. Since the anti-derivative is known its values at plus and minus infinities can be taken and the integral above evaluated. This task seems to be easy enough but in the multitude of terms that emerges makes it very hard to complete. We have completed it though and got the following result: $${\mathfrak I}(a,b)= 2 \pi \frac{\log(a^2+(1+b)^2)-2\log(2)}{1-b}$$

My question is how do we derive this result in some alternative way for example by using the Cauchy residue theorem.

Update: If we integrate the identity above over $a$ we get the following identity: $$-\int\limits_{-\infty}^\infty \log(b^2+x^2) \cdot \left( \arctan(\frac{2x+a}{-1+b}) - \arctan(\frac{2x}{-1+b})\right) dx = \frac{\pi}{2} \left((1+b)(\pi-2 \arctan(\frac{1+b}{a}))+a \log(a^2+(1+b)^2)-2 a(1+\log(2)) \right)$$

Again, the question would be to derive that identity in some alternative way.

The problem with using the Residue theorem is that you have essential singularities at $z = \pm ib$ about which the function cannot be represented by a Laurent series. Therefore any contour cannot include either of these points inside it, which makes it really hard to figure a way to either evaluate or send to $0$ the part of the contour not on the real line.
Note that there are complex-valued constants $u, v, A, B$ such that your integrand can be expressed as $$\int_{-\infty}^\infty \frac{\log(x + u) + \log(x - u)}{(x + v)(x + \bar v)}dx \\= A\int_{-\infty}^\infty \frac{\log(x + u)}{x + v}dx + A\int_{-\infty}^\infty \frac{\log(x - u)}{x + v}dx \\+ B\int_{-\infty}^\infty \frac{\log(x + u)}{x + \bar v}dx + B\int_{-\infty}^\infty \frac{\log(x - u)}{x + \bar v}dx$$
So all you really need is to do is work out the complex function $f(u,v) = \int_{-\infty}^\infty \frac{\log(x + u)}{x + v}dx$ and apply it four times. (WARNING: You will need to be very careful about branching of the $\log$ function here - $f$ may need to be based on different branches for the two different values of $u$.)
• What you can do is break the integration along the real line at 0, go up to a small circle about rhe singularity, then back down to the real line. Finally take a big half-circle in the upper-half plane to close the contour. The integral on the big half-circle goes to 0 as the radius goes to $\infty$., so it drops out. Because of the singularity, the integrals up to the circle and back down do not cancel, but instead the logarithm will change in value by $2\pi i$ from one to the other. I don't see any tricks for figuring out the integral on the small circle around the singularity. May 3, 2018 at 13:44
$$\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{\on}[1]{\operatorname{#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}$$ Lets $$\ds{\alpha \equiv a/2}$$ and $$\ds{\beta \equiv \pars{1 - b}/2}$$. Since $$\ds{a \geq 0,\,\,\,\mbox{and}\,\,\, 0 \leq b \leq 1/3}$$, we'll have $$\ds{\alpha \geq 0\,\,\, \mbox{and}\,\,\, 1/3 \leq \beta \leq 1/2}$$.
Then, \begin{align} \mathfrak{I}\pars{a,b} & \equiv \bbox[5px,#ffd]{\int_{-\infty}^{\infty} {\ln\pars{b^{2} + x^{2}} \over \pars{x + a/2}^{2} + \pars{1 - b}^{2}/4}\,\dd x} \\[5mm] & = 2\,\Re\int_{-\infty}^{\infty} {\ln\pars{b + \ic x} \over \bracks{x - \pars{-\alpha + \beta\,\ic}} \bracks{x - \pars{-\alpha -\beta\,\ic}}}\,\,\dd x \end{align} With $$\ds{\pars{~s \equiv b + x\,\ic \implies x = \pars{b - s}\ic~}}$$: \begin{align} \mathfrak{I}\pars{a,b} & \equiv \bbox[5px,#ffd]{\int_{-\infty}^{\infty} {\ln\pars{b^{2} + x^{2}} \over \pars{x + a/2}^{2} + \pars{1 - b}^{2}/4}\,\dd x} \\[5mm] & = -2\,\Im\int\limits_{b - \infty\ic}^{b + \infty\ic} \!\!\!\!\!{\ln\pars{s} \over \bracks{s - \pars{b + \beta - \alpha\,\ic}} \bracks{s - \pars{b - \beta - \alpha\,\ic}}}\,\dd s \\[5mm] & = -2\,\Im\bracks{-2\pi\ic\, {\ln\pars{b + \beta - \alpha\,\ic} \over \pars{b + \beta - \alpha\,\ic} - \pars{b - \beta - \alpha\,\ic}}} \\[5mm] & = {2\pi \over \beta}\,\Re\ln\pars{b + \beta - \alpha\,\ic} \\[5mm] & = {2\pi \over \pars{1 - b}/2}\,\Re\ln\pars{{b + 1 \over 2} - {a \over 2}\,\ic} \\[5mm] & = {4\pi \over 1 - b} \ln\pars{\root{\pars{b + 1 \over 2}^{2} + \pars{-\,{a \over 2}}^{2}}} \\[5mm] & = \bbx{2\pi\, {\ln\pars{\bracks{b + 1}^{\,2} + a^{2}} - 2\ln\pars{2} \over 1 - b}} \\ &\ \end{align}