Help with algebra involving residues Evaluate $$\int_0^\infty \dfrac {\cos(mx)}{1+x^4}dx$$
I know I have to change the inegral to $-\infty$ as the lower limit. I understand the logic of the problem but it's the algebra in finding the residues that kills me. I know I'm only interested in the singularities in the upper half plane which are $z=e^i{^{\pi/4}}$ and $z=e^i{^{3\pi/4}}$. Can anyone help me in finding the residues for this problem? I'm only interested in that I know how to evaluate the integral.
 A: First of all, you have to consider, for $m>0$
$$\oint_C dz \frac{e^{i m z}}{1+z^4}$$
which goes to zero along the outer arc of the semicircle.  In this case, you must consider the residues in this semicircle, as you say, at $e^{i \pi/ 4}$ and $e^{i 3 \pi/4}$.  To keep the algebra simple, because the poles are simple, you may use the formula
$$\text{Res}_{z=z_0} \frac{f(z)}{g(z)} = \frac{f(z_0)}{g'(z_0)}$$
That way, the sum of the residues at these poles is
$$\frac{e^{i m (\cos{(\pi/4)} + i \sin{(\pi/4)})}}{4 e^{i 3 \pi/4}} + \frac{e^{i m (\cos{(3\pi/4)} + i \sin{(3\pi/4)})}}{4 e^{i 9 \pi/4}}$$
which you can manipulate with a little elbow grease as follows:
$$\frac{e^{-i 3 \pi/4}}{4} e^{i m/\sqrt{2}} e^{-m /\sqrt{2}} + \frac{e^{-i \pi/4}}{4} e^{-i m/\sqrt{2}} e^{-m /\sqrt{2}}$$
which may be simplified into
$$\begin{align}-i \frac{1}{4 \sqrt{2}} e^{-m /\sqrt{2}}[ (1-i)  e^{i m/\sqrt{2}}  + (1+i)  e^{-i m/\sqrt{2}}] &= -i \frac{1}{2 \sqrt{2}} e^{-m /\sqrt{2}} \Re{[(1-i)  e^{i m/\sqrt{2}}]}\\ &=-i \frac{1}{2 \sqrt{2}} e^{-m /\sqrt{2}} \left[\cos{\left(\frac{m}{\sqrt{2}}\right)} + \sin{\left(\frac{m}{\sqrt{2}}\right)}\right]\end{align}$$
To get the integral, multiply the above by $i 2 \pi$ and divide by 2. 
For $m < 0$, use the contour in the lower half-plane and multiply the sum of the residues by $-i 2 \pi$.  Then you get the result with the $|m|$.
A: $\frac{\pi}{2 \sqrt{2}} e^{-m/\sqrt{2}} (cos{\left( \frac{m}{\sqrt{2}}\right)}+sin(\frac m{\sqrt2}))$$
