Let $u = 2\tan^{-1}\left(\frac{x}{4}\right) - x$. Then
$$ du = -\frac{x^2 + 8}{x^2 + 16}\,dx. $$
Now since
$$ \begin{align*}
\frac{x^2 + 8}{(x^2 - 16)\sin x + 8x \cos x}
&= \frac{\frac{x^2 + 8}{x^2 + 16}}{\frac{8x}{16+x^2} \cos x - \frac{16-x^2}{16+x^2}\sin x} \\
&= \frac{\frac{x^2 + 8}{x^2 + 16}}{\sin\left(2\tan^{-1}\left(\frac{x}{4}\right)\right) \cos x - \cos\left(2\tan^{-1}\left(\frac{x}{4}\right)\right)\sin x} \\
&= \frac{\frac{x^2 + 8}{x^2 + 16}}{\sin\left(2\tan^{-1}\left(\frac{x}{4}\right) - x\right)} \\
&= -\frac{1}{\sin u}\frac{du}{dx},
\end{align*}$$
it remains to take integration by substitution.
It can be solved using differentiation under the integral sign. Consider the following integral:
\begin{equation}
I(t)=\int\limits_{-\infty}^{+\infty} \frac{\cos(tx)}{x^{2}+k} \,dx = 2\int\limits_{0}^{+\infty} \frac{\cos(tx)}{x^{2}+k} \,dx
\end{equation}
for any positive real $t$ and $k$. The first derivative with respect to $t$ is:
\begin{equation}
I'(t)= -2\int\limits_{0}^{+\infty} \frac{x\sin(tx)}{x^{2}+k} \,dx
\end{equation}
\begin{equation}
\Leftrightarrow \hspace{.3cm}I'(t)= -2\int\limits_{0}^{+\infty} \frac{x^{2}\sin(tx)}{x(x^{2}+k)} \,dx
\end{equation}
\begin{equation}
\Leftrightarrow \hspace{.3cm}I'(t)= -2\int\limits_{0}^{+\infty} \frac{(x^{2}+k-k)\sin(tx)}{x(x^{2}+k)} \,dx
\end{equation}
\begin{equation}
\Leftrightarrow \hspace{.3cm}I'(t)= -2\int\limits_{0}^{+\infty} \frac{\sin(tx)}{x} \,dx +2k\int\limits_{0}^{+\infty} \frac{\sin(tx)}{x(x^{2}+k)} \,dx
\end{equation}
The first one is just the sine integral as $x\rightarrow \infty$ and it is known to converge to $\frac{\pi}{2}$. Thus:
\begin{equation}
I'(t)= 2k\int\limits_{0}^{+\infty} \frac{\sin(tx)}{x(x^{2}+k)} \,dx -\pi
\end{equation}
Differentiating once more with respect to $t$ yields:
\begin{equation}
I''(t)= 2k\int\limits_{0}^{+\infty} \frac{\cos(tx)}{x^{2}+k} \,dx
\end{equation}
\begin{equation}
\Leftrightarrow \hspace{.3cm}I''(t)-kI(t)=0
\end{equation}
The general solution to the ODE is:
\begin{equation}
I(t)=c_{1}e^{\sqrt{k}t}+c_{2}e^{-\sqrt{k}t}
\end{equation}
Plugging some conditions $\left(I(t=0) \,\,\text{and}\,\, I'(t=0)\right)$ allows you to find that $c_{1}=0$ and that $c_{2}=\frac{\pi}{\sqrt{k}}$. Then:
\begin{equation}
\boxed{\int\limits_{-\infty}^{+\infty} \frac{\cos(tx)}{x^{2}+k} \,dx = \frac{\pi}{\sqrt{k}}e^{-\sqrt{k}t}}
\end{equation}
for positive real values of $t$ and $k$. If you plug $t=2$ and $k=4$, you obtain the desired result.
Best Answer
\begin{align*} \frac{\mathrm{d} I(b)}{\mathrm{d} b}=\int_{0}^{\pi}{\cos x\over 1+b\cos x}\; \mathrm{d}x &= \frac{1}{b}\int_0^{\pi} \frac{ 1+b \cos{x}-1}{1+b\cos{x}} \; \mathrm{d}x \\ &= \frac{\pi}{b}-\frac{1}{b} \int_0^{\pi} \frac{1}{1+b \cos{x}} \; \mathrm{d}x\\ &= \frac{\pi}{b}-\frac{2}{b} \int_0^{\infty} \frac{1}{(t^2+1)+b(1-t^2)} \; \mathrm{d}t \tag{1}\\ &= \frac{\pi}{b}-\frac{2}{b} \int_0^{\infty} \frac{1}{(1-b)t^2+(1+b)} \; \mathrm{d}t\\ &= \frac{\pi}{b}-\frac{2}{b} \left(\frac{\pi}{2\sqrt{1-b^2}}\right) \\ &= \frac{\pi}{b}- \frac{\pi}{b\sqrt{1-b^2}} \\ I(b) &= \int \frac{\pi}{b}- \frac{\pi}{b\sqrt{1-b^2}} \; \mathrm{d}b \\ &= \pi \ln|b| + \pi \operatorname{artanh}{\left(\sqrt{1-b^2}\right)}+C \\ I(1)&=-\pi \ln{2} \implies C=-\pi \ln{2}\\ I(b) &= \pi \ln|b| + \pi \operatorname{artanh}{\left(\sqrt{1-b^2}\right)}-\pi \ln{2} \\ &= \pi \ln\bigg|\frac{b}{2}\bigg| -\frac{\pi}{2} \ln\left(1-\sqrt{1-b^2}\right)+\frac{\pi}{2}\ln \left(1+\sqrt{1-b^2}\right) \\ &= \boxed{\pi \ln\left(\frac{1+\sqrt{1-b^2}}{2}\right)} \end{align*}
Additionally, note that $-1<b<1$.
$(1):$ Weierstrass substitution