<s>[INST] An improper integral : $\int_{0}^\infty {\ln(a^2+x^2)\over{b^2+x^2}}dx$ How to evaluate the following improper integral:$$\int_{0}^\infty {\ln(a^2+x^2)\over{b^2+x^2}}dx,$$ where $a,b>0$.

I tried to suppose $$f(a)=\int_0^\infty {\ln(a^2+x^2)\over{b^2+x^2}}dx,$$ based on the convergence theorem, and then I tried $${df(a)\over da}=\int_0^\infty {2a\over {(a^2+x^2)(b^2+x^2)}}dx = {\pi\over b(b+a)},$$and then $$f(a)={\pi\over b}\ln(b+a)+C,$$where $C$ is a constant, but I don't know how to find the constant $C$. Could anyone tell me that, and explain why? Or could anyone find other methods to evaluate the integral? If you could, please explain. Thanks.
 [/INST] Letting $y=\frac{x}{b} $ yields
$$
\begin{aligned}
I &=b \int_0^{\infty} \frac{\ln \left(a^2+b^2 y^2\right)}{b^2+b^2 y^2} d y \\
&=\frac{1}{b} \int_0^{\infty} \frac{\ln \left(b^2 y^2+a^2\right)}{1+y^2} d y
\end{aligned}
$$
By my post,
$$
\begin{aligned}
\boxed{I =\frac{1}{b} \pi \ln \left(\sqrt{a^2}+\sqrt{b^2}\right)=\frac{\pi}{b} \ln (a+b)}
\end{aligned}
$$
</s>