# Complex Analysis - $\int_0^\infty\frac{\cos(5x)}{(1+x^2)^2}\mathrm{d}x$

How to calculate the following integral using complex analysis? $\int_0^\infty\frac{\cos(5x)}{(1+x^2)^2}\mathrm{d}x$.

So far I have $$\int_0^\infty\frac{\cos(5x)}{(1+x^2)^2}\mathrm{d}x = \int_{-\infty}^\infty\frac{1}{(1+x^2)^2}e^{5ix}\mathrm{d}x$$ Then, $$Res(f(x),i)=\frac{d}{dx}[e^{5ix}]|_i=5ie^{5ix}|_i=2\pi i5ie^{5i(i)}=\frac{-10\pi}{e^5}$$ Then I might have to multiply by 1/2 to get from 0 to infinity only but that gives $\frac{-5\pi}{e^5}$ and the answer should be $\frac{3\pi}{2e^5}$ and I am not sure what I am doing wrong...

$$\int_{0}^{+\infty}\frac{\cos(5x)}{(1+x^2)^2}\,dx = \frac{1}{2}\text{Re}\int_{-\infty}^{+\infty}\frac{e^{5ix}}{(1+x^2)^2}\,dx \tag{1}$$ and $x=i$ is a double pole for $\frac{e^{5ix}}{(1+x^2)^2}$, in particular
$$\text{Res}\left(\frac{e^{5ix}}{(1+x^2)^2},x=i\right) = \lim_{x\to i}\frac{d}{dx}\left(\frac{e^{5ix}}{(x+i)^2}\right)=-\frac{3i}{2e^5}\tag{2}$$ and $$\int_{0}^{+\infty}\frac{\cos(5x)}{(1+x^2)^2}\,dx = \text{Re}\left(\frac{(-3i)\cdot(\pi i)}{2e^5}\right)=\color{red}{\frac{3\pi}{2e^5}}.\tag{3}$$
• Oh thank you. I am a bit confused because Res$(f(z),z_0)=\frac{1}{(n-1)!} \frac{d^{n-1}}{dz^{n-1}}[(z-z_0)^nf(z)]}$. Wouldn't that give $\frac{d}{dz}[(z-i)^2 \frac{e^{5iz}{(z+i)^2}]$ or something like that? Can you explain how you used the definition to get the Residue? Thanks for your time. – MathIsHard Apr 25 '17 at 16:41
• @Math4Life: I took the definition of the residue at a double pole and simply noticed that $(x^2+1)^2=(x+i)^2(x-i)^2$. – Jack D'Aurizio Apr 25 '17 at 16:46
Hint: $$\dfrac{e^{5iz}}{(z-i)^2(z+i)^2}=\dfrac{1}{(z-i)^2}\dfrac{e^{5iz}}{(z+i)^2}$$ so compute $$2\pi i\Big[\dfrac{e^{5iz}}{(z+i)^2}\Big]'_{z=i}$$