Write
$$x^4+1=(x-a)(x-b)(x-c)(x-d)$$
Use partial fraction decomposition
$$\frac 1{x^4+1}=\frac A{x-a}+\frac B{x-b}+\frac C{x-c}+\frac D{x-d}$$ to face four integrals
$$I(k)=\int \frac{\cos(x)}{x-k}\,dx=\int\frac{\cos (k+t)}{t}\,dt$$ Expand the cosine and use the fact that $k=\alpha+i\,\beta$
$$\cos (k+t)=\cos (\alpha ) \cosh (\beta ) \cos (t)-\sin (\alpha ) \cosh(\beta ) \sin (t)-$$
$$i (\cos (\alpha ) \sinh (\beta ) \sin (t)+\sin (\alpha ) \sinh
(\beta ) \cos (t))$$ So, integrating, one sine integral and one cosine integral.
So, even if nasty, we have the antiderivative.
Back to $x$ and using the bounds
$$\int_0^{\infty} \frac{\cos(x)}{x^4+1}\, dx=\frac{\pi }{2 \sqrt{2}}\,e^{-\frac{1}{\sqrt{2}}} \left(\sin
\left(\frac{1}{\sqrt{2}}\right)+\cos
\left(\frac{1}{\sqrt{2}}\right)\right)$$
No problem to generalize for any positive integer exponent in the denominator. The formula will be nasty for odd values of the exponent and nice for even values
$$\int_0^{\infty} \frac{\cos(x)}{x^2+1}\, dx=\frac{\pi }{2 e}$$
$$\int_0^{\infty} \frac{\cos(x)}{x^6+1}\, dx=\frac{\pi \left(1+\sqrt{3 e} \sin
\left(\frac{\sqrt{3}}{2}\right)+\sqrt{e} \cos
\left(\frac{\sqrt{3}}{2}\right)\right)}{6 e}$$