Integral $\int_{-\infty}^{\infty}\frac{e^{r \arctan(ax)}+e^{-r \arctan(ax)}}{1+x^2}\cos \left( \frac{r}{2}\log(1+a^2x^2)\right)dx$
Solution 1:
This one is similar to this one, and uses the same contour. That is, consider
$$\oint_C dz \frac{e^{r \arctan{a z}} + e^{-r \arctan{a z}}}{1+z^2} \exp{\left [i \frac{r}{2} \log{(1+a^2 z^2)} \right ]}$$
where $a>0$ and $C$ is a contour that is a semicircle in the upper half plane, except that it detours up just to the left of the imaginary axis to $z=i/a$, around that point, and the back down just to the right of the imaginary axis to the real axis, where it continues along the semicircle. This detour is needed to avoid the branch point at $z=i/a$.
In this way, note that there is a pole within $C$ at $z=i$ only when $a>1$. When $a<1$, then there is no pole within $C$ and the integral is zero. So for $a>1$ we have the integral along the real axis is equal to $i 2 \pi$ times the residue at the pole $z=i$:
$$\int_{-\infty}^{\infty} dx \frac{e^{r \arctan{a x}} + e^{-r \arctan{a x}}}{1+x^2} \exp{\left [i \frac{r}{2} \log{(1+a^2 x^2)} \right ]} = i 2 \pi \frac{e^{i r \mathrm{arctanh}{a}}+e^{-i r \mathrm{arctanh}{a}}}{2 i} \exp{\left [i \frac{r}{2} \log{(1-a^2)} \right ]}$$
Again, use the fact that
$$\mathrm{arctanh}(a) = \frac{1}{2} \log{\left ( \frac{1+a}{1-a} \right )}$$
and we get
$$\int_{-\infty}^{\infty} dx \frac{e^{r \arctan{a x}} + e^{-r \arctan{a x}}}{1+x^2} \exp{\left [i \frac{r}{2} \log{(1+a^2 x^2)} \right ]} = 2 \pi \cos{r \log{(1+a)}}$$
We finish this by considering the same integral, complex conjugated, using a contour in the lower half-plane; the results are identical. Therefore,
$$\int_{-\infty}^{\infty} dx \frac{e^{r \arctan{a x}} + e^{-r \arctan{a x}}}{1+x^2} \cos{\left [ \frac{r}{2} \log{(1+a^2 x^2)} \right ]} = 2 \pi \cos{r \log{(1+a)}}$$
Solution 2:
There is a curious formula attributed to Abel that states if $f(a+z)$ can be expanded in a series of the form $ f(a+z) = \sum_{n=0}^{\infty} c_{n} e^{-nz} $ whether $z$ be real or imaginary, then for $b >0$, $$\int_{0}^{\infty} \frac{f(a+ibt)+f(a-ibt)}{1+t^{2}} \, dt = \pi f(a+b).$$
If we assume $\sum_{n=0}^{\infty} c_{n}$ converges absolutely, the proof is fairly straightforward.
$$ \begin{align} \int_{0}^{\infty} \frac{f(a+ibt)+f(a-ibt)}{1+t^{2}} \ dt &= 2 \int_{0}^{\infty}\frac{1}{1+t^{2}} \sum_{n=0}^{\infty} c_{n} \cos(nbt) \, dt \\ &= 2 \sum_{n=0}^{\infty} c_{n} \int_{0}^{\infty} \frac{\cos (nbt)}{1+t^{2}} \, dt \\ &= \pi \sum_{n=0}^{\infty} c_{n} e^{-nb} \\ &= \pi f(a+b) . \end{align}$$
It's not particularly clear, however, what sort of functions we're talking about here.
But if we assume that $\cos \Big(r \log (1+z)\Big)$ is such a function, we get
$$ \begin{align} &\int_{0}^{\infty} \frac{\cos \Big(r \log(1+iat) \Big) + \cos \Big(r \log(1-iat) \Big)}{1+t^{2}} \ dt \\ &= \int_{0}^{\infty} \frac{\cos \Big( \frac{r}{2} \log(1+a^{2}t^{2})+ir \arctan at \Big) + \cos \Big( \frac{r}{2} \log(1+a^{2}t^{2})-ir \arctan at \Big)}{1+t^{2}} \, dt \\ &= 2 \int_{0}^{\infty} \frac{\cosh (r \arctan at)}{1+t^{2}} \, \cos \Big(\frac{r}{2} \log(1+a^{2}t^{2})\Big) \, dt \\ &= \pi \cos \Big(r \log(1+a) \Big).\end{align} $$