calculate a real integral using complex integration I'm having difficulties with finding the singularity points:
$$\int_{-\infty}^\infty{\cos(ax)\over x^4 +1}dx, a>0$$
 A: Use the following contour integral:
$$\oint_C dz \frac{e^{i a z}}{z^4+1}$$
where $C$ is a semicircle in the upper half plane of radius $R$.  This integral is equal to
$$\int_{-\infty}^{\infty} dx \frac{e^{i a x}}{x^4+1} + i R \int_0^{\pi} d\theta \, e^{i \theta} \frac{e^{i a R \cos{\theta}} e^{-a R \sin{\theta}}}{R^4 e^{i 4 \theta}+1}$$
As $R\to\infty$, you may show that the second integral vanishes as $\pi/(a R^4)$ by using, e.g., the ML-inequality and the fact that $\sin{\theta} \ge 2 \theta/\pi$ when $\theta \in [0,\pi/2]$.
By the residue theorem, then, the contour integral - and hence the first integral - is equal to $i 2 \pi$ times the sum of the residues of the poles of the integrand inside $C$.  These poles are at $z=e^{i \pi/4}$ and $z=e^{i 3 \pi/4}$.  The relevant equation is then
$$\int_{-\infty}^{\infty} dx \frac{e^{i a x}}{x^4+1} = i 2 \pi \left [\frac{e^{i a e^{i \pi/4}}}{4 e^{i 3 \pi/4}} + \frac{e^{i a e^{i 3 \pi/4}}}{4 e^{i 9 \pi/4}} \right ] = i \frac{\pi}{2} e^{-a/\sqrt{2}} \left (e^{-i 3 \pi/4} e^{i a/\sqrt{2}} + e^{-i \pi/4} e^{-i a/\sqrt{2}} \right )$$
The quantity in parentheses is
$$-\frac1{\sqrt{2}} \left [(1+i) \left (\cos{\frac{a}{\sqrt{2}}}+i \sin{\frac{a}{\sqrt{2}}}\right ) - (1-i) \left (\cos{\frac{a}{\sqrt{2}}}-i \sin{\frac{a}{\sqrt{2}}}\right )  \right ] $$
which simplifies to
$$-i \sqrt{2} \left (\cos{\frac{a}{\sqrt{2}}} + \sin{\frac{a}{\sqrt{2}}}\right ) $$
Thus, exploiting the symmetry in the integral, we finally have
$$\int_{-\infty}^{\infty} dx \frac{\cos{a x}}{x^4+1} = \frac{\pi}{\sqrt{2}} e^{-a/\sqrt{2}}\left (\cos{\frac{a}{\sqrt{2}}} + \sin{\frac{a}{\sqrt{2}}}\right ) $$
A: $x^4=-1$ now use Euler's identity...
Drag mouse over grey zone for solutions:

 Hence get $\exp(i\frac\pi4), \exp(i\frac{3\pi}4), \exp(-i\frac{\pi}4), \exp(-i\frac{3\pi}4)$

A: Doing something similar to what Ron Gordon gave as an answer to the post mentioned by Git Gud, I arrived to a rather simple expression which write
$$\frac{\pi  e^{-\frac{|a|}{\sqrt{2}}} \left(\sin
   \left(\frac{|a|}{\sqrt{2}}\right)+\cos
   \left(\frac{a}{\sqrt{2}}\right)\right)}{\sqrt{2}}$$
which is valid if $a\in \mathbb{R}$.  
A side result I found amazing : the integral of the above axpression between $0$ and $\infty$ is equal to $\pi$.
