Residue Theorem Troubles I'm trying to compute $$\int_{0}^{\infty} \frac{\cos(ax)}{1+x^4}dx$$ using the residue theorem.
I've split this integral into two contour integrals in the complex plane--one along the real axis and one along the semi circle in the upper half plane centered at the origin. However, I'm having some trouble computing my residues and getting the answer to work out correctly.
The poles are at $z=e^{i\pi/4}$ and $z=e^{3i\pi/4}$. I was going to compute the residues from the limit definition but it becomes quite messy. Is there a better way of going about this?
 A: These poles are simple poles, so you can use next formula($c$ is pole):
$res = \lim_{z\rightarrow c} (z-c)f(z)$;
where $f(z)=\frac {cos(az)} {(x-e^{i\pi/4})(x-e^{i3\pi/4})(x-e^{i5\pi/4})(x-e^{i7\pi/4})}$
A: Let us define the following function
$$f(z):=\frac{e^{iaz}}{z^4+1}$$ 
so
$$z_1:=e^{\pi i/4}=\frac{1}{\sqrt 2}(1+i)\Longrightarrow Res_{z=z_1}(f)=\lim (z-z_1)f(z)\stackrel{\text{L'Hospital}}=$$
$$=\lim_{z\to z_1}\frac{e^{aiz}}{4z^3}=\frac{\sqrt 2\;e^{\frac{a}{\sqrt 2}\left(-1+i\right)}}{4(-1+i)}=-\frac{1+i}{4}\cdot{e^{\frac{a}{\sqrt 2}\left(-1+i\right)}}$$
$${}$$
$$z_2=e^{3\pi i/4}=\frac{1}{\sqrt 2}\left(-1+i\right)\Longrightarrow Res_{z=z_2}(f)=\lim (z-z_2)f(z)\stackrel{\text{L'Hospital}}=$$
$$=\lim_{z\to z_2}\frac{e^{aiz}}{4z^3}=\frac{\sqrt 2\;e^{-\frac{a}{\sqrt 2}\left(1+i\right)}}{4(1+i)}=\frac{1-i}{4}\cdot{e^{-\frac{a}{\sqrt 2}\left(1+i\right)}}$$
Added upon request by OP: With a little trigonometry and using the polar expression for complex numbers, we can write, for example:
$${}$$
$$\frac{1-i}{4}\cdot{e^{-\frac{a}{\sqrt 2}\left(1+i\right)}}=\frac{\sqrt 2\,\,e^{-\frac{a}{\sqrt 2}}}{4}\left[\left(\cos\frac{\pi}{4}-i\sin\frac{\pi}{4}\right)\left(\cos\frac{a}{\sqrt 2}-i\sin\frac{a}{\sqrt 2}\right) \right]=$$
$${}$$
$$=\frac{\sqrt 2\,\,e^{-\frac{a}{\sqrt 2}}}{4}\left[\cos\left(\frac{\pi}{4}+\frac{a}{\sqrt 2}\right)-i\sin\left(\frac{\pi}{4}+\frac{a}{\sqrt 2}\right)\right]=\frac{\,\,e^{-\left[\frac{a}{\sqrt 2}+i\left(\frac{\pi}{4}+\frac{a}{\sqrt 2}\right)\right]}}{2\sqrt 2}$$
$${}$$
How simple and which of the above forms is simpler I can't say...in fact, I think they all are pretty nasty and even evil.
