<s>[INST] Evaluate the integral$ \int_{-\infty}^{\infty}\frac{b\tan^{-1}\big(\frac{\sqrt{x^2+a^2}}{b}\big)}{(x^2+b^2)(\sqrt{x^2+a^2})}\,dx$. I am attempting to evaluate 
$$\int_{-\infty}^{\infty}\dfrac{b\tan^{-1}\Big(\dfrac{\sqrt{x^2+a^2}}{b}\Big)}{(x^2+b^2)(\sqrt{x^2+a^2})}\,dx. $$
I have tried using the residue formula to calculate the residues at $\pm ib,\pm ia,$ but it got messy very quickly. Then I tried to use a trigonometric substitution $x=a\tan(\theta)$; $dx=a\sec^{2}(\theta)\,d\theta$ which led me to the integral $$\int_{-\infty}^{\infty}\dfrac{b\tan^{-1}\Big(\dfrac{a\sec(\theta)}{b}\Big)\sec(\theta)}{(a^2\tan^{2}(\theta)+b^2)}\,d\theta.$$ The bounds for this integral seem incorrect, but I am more worried about the actual expression before I deal with the bounds, which may have to be changed into a double integral where $0\leq\theta\leq2\pi$ and the second bound would range from $-\infty$ to $\infty$. I am wondering if there is some kind of substitution I have missed, but I have hit the wall. The OP of this problem said there were cases that would come into play, but when I asked him whether or not those cases arose from $b<0$ and $b>0$ he told me they did not. The cases most likely arise from whether $a$ and $b$ are positive or negative, because the case where $b=0$ is trivial, and in the case where $a=0$ I used wolframalpha and the integral evaluates to $\dfrac{\pi\ln(2)\lvert b \rvert}{b^2}$ for $\Im(b)=0 \land \Re(b)\neq0.$ Contour integration may be necessary. I am stuck on this problem and I would greatly appreciate the help. Thank you for your time. 
 [/INST] We will use Mark Viola’s derivations to account for the case when $\lvert\,a\,\rvert< \lvert\,b\,\rvert$. 
Integrating $(2)$ (See Mark Viola's answer above) and using $\lim_{c\to \infty}F(c)=0$, we find that
$$\begin{align}
F(c)&=\pi\,\left(\frac{\arctan\left(\frac{bc}{\sqrt{a^2-b^2}\sqrt{a^2+c^2}}\right)-\arctan\left(\frac{b}{\sqrt{a^2-b^2}}\right)+\pi/2-\arctan\left(\frac{c}{\sqrt{a^2-b^2}}\right)}{\sqrt{a^2-b^2}}\right)
\end{align}.$$
Now we will account for our case’s assumption and arrive at 
$$\begin{align}
F(c)&=\pi\,\left(\frac{-i\tanh^{-1}\left(\frac{bc}{\sqrt{b^2-a^2}\sqrt{a^2+c^2}}\right)+i\tanh^{-1}\left(\frac{b}{\sqrt{b^2-a^2}}\right)+\pi/2+i\tanh^{-1}\left(\frac{c}{\sqrt{b^2-a^2}}\right)}{i\sqrt{b^2-a^2}}\right) \\
&=\pi\,\left(\frac{-\tanh^{-1}\left(\frac{bc}{\sqrt{b^2-a^2}\sqrt{a^2+c^2}}\right)+\tanh^{-1}\left(\frac{b}{\sqrt{b^2-a^2}}\right)-i\pi/2+\tanh^{-1}\left(\frac{c}{\sqrt{b^2-a^2}}\right)}{\sqrt{b^2-a^2}}\right)
\end{align}.$$
We replace $c=b$ to obtain our result 
$$\int_{-\infty}^\infty \frac{b\arctan\left(\frac{\sqrt{x^2+a^2}}{b}\right)}{(x^2+b^2)\sqrt{x^2+a^2}}\,dx=\\\pi\,\left(\frac{-\tanh^{-1}\left(\frac{b^2}{\sqrt{b^2-a^2}\sqrt{a^2+b^2}}\right)-i\pi/2+2\tanh^{-1}\left(\frac{b}{\sqrt{b^2-a^2}}\right)}{\sqrt{b^2-a^2}}\right).$$
</s>