Improper integral of $\frac{\log\left(\sqrt{x^2+a^2}\right)}{x^2+b^2}$ Show that $$\int_{-\infty}^\infty \frac{\log\left(\sqrt{x^2+a^2}\right)}{x^2+b^2}\,dx = \frac{\pi}{b}\log\left(a+b\right)$$
for $a,b>0\in\mathbb{R}$. I stumbled on this answer empirically, but I'm not sure how to solve it directly.

It's easy to see that your integral is the same as
$$ I(a) = \int_0^{\infty} \frac{\log{(x^2+a^2)}}{x^2+b^2} \, dx $$
Now, we can do the case $a=0$ fairly easily, by setting $x=b^2/y$:
$$ \begin{align}
I(0) &= 2\int_0^{\infty} \frac{\log{x}}{x^2+b^2} \, dx \\
&= 2\int_0^{\infty} \frac{\log{(b^2/y)}}{b^2/y^2+b^2} \frac{b}{y^2} \, dy \\
&= 2\int_0^{\infty} \frac{2\log{b}-\log{y}}{y^2+b^2} \, dy \\
&= 4\log{b} \int_0^{\infty} \frac{dy}{y^2+b^2} -I(0),
\end{align} $$
so
$$ I(0) = \frac{\pi}{b}\log{b}. $$
To get from here to nonzero $a$, differentiate under the integral sign:
$$ I'(a) = \int_0^{\infty}\frac{\partial}{\partial a} \frac{\log{(x^2+a^2)}}{x^2+b^2} \, dx = \int_0^{\infty} \frac{2a \, dx}{(x^2+a^2)(x^2+b^2)} $$
But this is easy to calculate using partial fractions: we find
$$ I'(a) = \frac{2a\pi}{2(b^2-a^2)} \left( \frac{1}{a} - \frac{1}{b} \right) = \frac{\pi}{b(a+b)} $$
Now
$$ I(a) = I(0) + \int_0^{a} \frac{\pi}{b(A+b)}\, dA =  \frac{\pi}{b}(\log{(b+a)}-\log{b}+\log{b}) = \frac{\pi}{b}\log{(a+b)}, $$
as desired.

A complex analysis method will work in the same way as that given in this answer, although the pole is in a different place from the branch point in your case, rather than coincident.
