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.
In the following we shall assume that $a$, $b$, and $c$ are real valued and that $a>b>0$.
Let $F(c)$ be represented by the integral
$$F(c)=b\int_{-\infty}^\infty \frac{\arctan\left(\frac{\sqrt{x^2+a^2}}{c}\right)}{(x^2+b^2)\sqrt{x^2+a^2}}\,dx\tag 1$$
Differentiating $(1)$ reveals
$$\begin{align} F'(c)&=-b\int_{-\infty}^\infty \frac{1}{(x^2+b^2)(x^2+a^2+c^2)}\,dx\\\\ &=-\frac{\pi}{c^2+a^2+b\sqrt{c^2+a^2}}\tag2 \end{align}$$
Integrating $(2)$ 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}$$
Setting $c=b$ yields the coveted 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{\arctan\left(\frac{b^2}{\sqrt{a^2-b^2}\sqrt{a^2+b^2}}\right)+\pi/2-2\arctan\left(\frac{b}{\sqrt{a^2-b^2}}\right)}{\sqrt{a^2-b^2}}\right)$$