Find the residue of $\frac{e^{iz}}{(z^2+1)^5}$ at $z = i$ and evaluate $\int_0^{\infty} \cos x/(x^2+1)^5 dx$ I know the evaluation of $\int_0^{\infty} \cos x/(x^2+1)^5 dx$ requires that I solve the first part, but for some reason I'm stumped. I get that I should use $\lim_{z \to i}\frac{1}{24}\frac{d^4}{dz^4}((z-i)^5\frac{e^{iz}}{(z^2+1)^5})$, but I can't seem to evaluate that for the life of me.
 A: When you have such a high order pole, it is likely better to evaluate the residue directly from the Laurent series about the pole.  That is, rewrite
$$\frac{e^{i z}}{(z^2+1)^5} = \frac{1}{e} \frac{e^{i (z-i)}}{(z-i)^5 [(z-i)+2 i]^5} = \frac{1}{i 2^5 e}\frac{e^{i (z-i)}}{(z-i)^5 [1-i(z-i)/2]^5}$$
So we want to find the coefficient of $(z-i)^4$ of the expression
$$\frac{1}{i 2^5 e}\frac{e^{i (z-i)}}{ [1-i(z-i)/2]^5}$$
Note that
$$(1-y/2)^{-5} = 1+(-5)\left (\frac{-y}{2} \right ) + \frac{(-5)(-6)}{2!}\left (\frac{-y}{2} \right )^2 + \frac{(-5)(-6)(-7)}{3!}\left (\frac{-y}{2} \right )^3 + \frac{(-5)(-6)(-7)(-8)}{4!}\left (\frac{-y}{2} \right )^4+\cdots\\ = 1+\frac{5}{2} y+\frac{15}{4} y^2+\frac{35}{8} y^3 + \frac{35}{8} y^4 + \cdots$$
where $y=i(z-i)$.  So we want the coefficent of $y^4$ of
$$\frac{1}{i 2^5 e}\left (1+y+\frac12 y^2+\frac16 y^3+\frac{1}{24} y^4+\cdots \right )\left (1+\frac{5}{2} y+\frac{15}{4} y^2+\frac{35}{8} y^3 + \frac{35}{8} y^4 + \cdots \right )$$
which is
$$\frac{1}{i 32 e} \left (\frac{35}{8}+\frac{35}{8}+\frac{15}{8}+\frac{5}{12}+\frac{1}{24} \right ) = \frac{133}{i 384 e}$$
That is the sought-after residue.  The integral is simply $i \pi$ times this residue, or 
$$\int_0^{\infty} dx \frac{\cos{x}}{(1+x^2)^5} = \frac{133 \pi}{384 e}$$
A: Hint: $z=i$ is a pole of order $5$. You need to work out the following
$$ \lim_{z \to i}\frac{1}{24}\frac{d^4}{dz^4}\left((z-i)^5\frac{e^{iz}}{(z-i)^5(z+i)^5}\right).$$
A: $$\frac{d^4}{dz^4}\left((z-i)^5\frac{e^{iz}}{(z-i)^5(z+i)^5}\right)= \frac{d^4}{dz^4}\left(e^{iz}(z+i)^{-5}\right).$$
By Leibnitz Rule
$$ \frac{d^4}{dz^4}\left(e^{iz}(z+i)^{-5}\right) = \binom{4}{0} \left(\frac{d^4}{dz^4}  e^{iz}\right)(z+i)^{-5}+\binom{4}{1} \left( \frac{d^3}{dz^3}e^{iz}\right) \left( \frac{d}{dz}(z+i)^{-5} \right) \\ +\binom{4}{2} \left( \frac{d^2}{dz^2}e^{iz}\right) \left( \frac{d^2}{dz^2}(z+i)^{-5} \right)+\binom{4}{3} \left( \frac{d}{dz}e^{iz}\right) \left( \frac{d^3}{dz^3}(z+i)^{-5} \right)\\+\binom{4}{4} \left( e^{iz}\right) \left( \frac{d^4}{dz^4}(z+i)^{-5} \right)$$
$$=e^{iz}(z+i)^{-5}+4 (-i)e^{iz} (-5) (z+i)^{-6} \\
-6e^{iz}(30)(z+i)^{-7} +4i e^{iz}(-210)(z+i)^{-8} +1680 e^{iz}(z+i)^{-9} $$
$$=\frac{e^{iz}}{(z+i)^{9}} \left(  (z+i)^4+20i(z+i)^{3} -180(z+i)^2 -840i(z+i) +1680 \right)$$
