Solution
= Solution
Integrate $e^{inz}/(z^4+1)$ over the upper semicircle. Jordan's lemma removes the arc and the upper poles are $e^{i\pi/4}$ and $e^{3i\pi/4}$. Summing their residues and taking real parts gives
$$
\boxed{\int_{-\infty}^{\infty}\frac{\cos(nx)}{x^4+1}\,dx
=\frac\pi{\sqrt2}e^{-n/\sqrt2}\left(\cos\frac n{\sqrt2}+\sin\frac n{\sqrt2}\right).}
$$