Let's consider the following integral $$\int \limits_{-\infty}^{\infty} \frac{\cos2x}{(x^2+4)^2} \, dx. \tag{1}$$
I would like to compute $(1)$ using residue theory. Let's consider a complex function $$f(z) = \frac{\cos2z}{(z^2+4)^2} = \frac{\cos2x}{(z-2i)^2(z+2i)^2}.$$
Of course $\text{Im}(-2i) < 0$ thus I am to calculate residue only in the point $z_0 = 2i$.
Noting that $z_0$ is a double pole we have $$R = \text{res}_{z_0}f(z) = \lim_{z \to 2i} \frac{d}{dz} \bigg((z-2i)^2 \frac{\cos(2z)}{(z-2i)^2(z+2i)^2} \bigg).$$
After some calculations we get $$R = \frac{i \big(-5 + 3 e^8 \big)}{64 e^4}.$$ That implies $$\int \limits_{-\infty}^{\infty} \frac{\cos2x}{(x^2+4)^2} \, dx = 2 \pi i \frac{i \big(-5 + 3 e^8 \big)}{64 e^4} = -\frac{(-5 + 3 e^8) \pi}{32 e^4}.$$
According to WolframAlpha $(1)$ is equal to $$\frac{5 \pi}{16 e^4}.$$
What am I doing wrong?