If $a,b\in\mathbb R_{>0}$ and $ b>a$, then why is $\int_{-\infty}^{\infty}\left\lvert\log\frac{a^2+x^2}{b^2+x^2}\right\rvert dx=2\pi(b-a)$ ?
Usual change of variables doesnt bring anything, I think. Is there a special function involved here (because of $\pi$) ?
Note that we can write
$$\begin{align} \int_{-\infty}^\infty\log\left(\frac{b^2+x^2}{a^2+x^2}\right)\,dx&=2\int_0^\infty \int_{a^2}^{b^2} \frac{1}{y+x^2}\,dy\,dx\\\\ &\overbrace{=}^{\text{Fubini}}2\int_{a^2}^{b^2}\int_0^\infty \frac{1}{y+x^2}\,dx\,dy\\\\ &=2\int_{a^2}^{b^2}\frac{\pi/2}{\sqrt y}\,dy\\\\ &=2\pi (b-a) \end{align}$$
as expected!
Alternatively, we can integrate $\int \log(a^2+x^2)\,dx$ by parts with $u=\log(a^2+x^2)$ and $v=x$ to find
$$\begin{align} \int \log(a^2+x^2)\,dx&=x\log(a^2+x^2)-2\int \frac{x^2}{a^2+x^2}\,dx\\\\ &=x\log(a^2+x^2)-2x+2a\arctan(x/a) \end{align}$$
And the rest is straightforward.