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.

$$\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)$$
