Evaluate the integral \[ \int_0^\infty\frac{\cos x}{1+x^4}\,dx. \]
Solution
Consider \[ F(z)=\frac{e^{iz}}{1+z^4} \] and integrate over the upper semicircle. The arc contribution tends to zero by Jordan’s lemma. The poles in the upper half-plane are \[ z_1=e^{i\pi/4},\qquad z_2=e^{3i\pi/4}, \] and both are simple. Since \((1+z^4)'=4z^3\), \[ \operatorname{Res}(F,z_k)=\frac{e^{iz_k}}{4z_k^3}. \] Therefore \[ \int_{-\infty}^{\infty}\frac{e^{ix}}{1+x^4}\,dx =2\pi i\sum_{k=1}^2\frac{e^{iz_k}}{4z_k^3}. \] Writing \(a=1/\sqrt2\) and simplifying the two residues gives \[ \int_{-\infty}^{\infty}\frac{e^{ix}}{1+x^4}\,dx =\frac{\pi}{\sqrt2}e^{-a}(\cos a+\sin a). \] The imaginary part vanishes by oddness, and the cosine integrand is even. Hence \[ \boxed{\displaystyle \int_0^\infty\frac{\cos x}{1+x^4}\,dx =\frac{\pi}{2\sqrt2}e^{-1/\sqrt2} \left(\cos\frac1{\sqrt2}+\sin\frac1{\sqrt2}\right).} \]