Contour Integral of $\int_{0}^{\infty}\frac{\cos(x)}{(x^2+1)^2}dx$

245 Views Asked by At

I had this question $\int_{0}^{\infty} \frac{\cos(x)}{(x^2+1)^2}dx$ on a introductory complex analysis final and really had a poor go of it. The poles are $\pm i$ both of order 2, so I replaced $cos(x)$ by $e^{iz}$ and then set $$H(z)=e^{iz}~~ \& ~~G(z)=(z^2+1)^2$$ and so $$G'(z)=4z(z^2+1)=4z((z+i)(z-i))$$ I then attempted to take $Res(\frac{H}{G'};i)$ $$\lim_{z\to i}\left((z-i)\frac{e^{iz}}{4z((z+i)(z-i))}\right)=\frac{e^{-1}}{4i(2i)}=-\frac{1}{8e}$$ But then multiplying by $2\pi i$ gave me an imaginary result which I clearly knew was wrong but due to time constraints I just couldn't afford to fix the problem. I am convinced that since $G'(i)=0$ that I was flawed from the start, could I have taken another derivative or slightly altered this approach?

After a week of feeling poor about how I had fumbled this one, I decided to go back and redo it. I defined the same $H(z)=e^{iz}$ and $G(z)=(z^2+1)^2=(z+i)^2(z-i)^2$. So define $$H_1(z)=\frac{e^{iz}}{(z+i)^2}$$ then $$H_1'(z)=\frac{ie^{iz}(z+i)^2-2(z+i)e^{iz}}{(z+i)^4}$$ To compute the residue I instead used the formula $Res(f;z_0)=\frac{H^{(m-1)}(z_0)}{(m-1)!}$ with $m=2$, then $$Res(H_1;i)=\frac{H_1'(i)}{1!}=\frac{ie^{i\cdot i}(2i)^2-2(2i)e^{i\cdot i}}{2i^4}=\frac{-4ie^{-1}-4ie^{-1}}{16}=-\frac{i}{2e}$$ Then by the residue theorem; $2\pi i \cdot -\frac{i}{2e}= \frac{\pi}{e}$. I chose to integrate over the contour of a semicircle in the upper half plane of radius $R$, of which it can easily be shown that along upper arc $\gamma_R$ the integral will converge to 0 and so we are left with $\gamma_x$ which is the $\mathbb{R}$-axis. Then $$\lim_{R\to\infty}\int_{-R}^{R}\frac{\cos(x)}{(x^2+1)^2}dx=\int_{-\infty}^{\infty}\frac{\cos(x)}{(x^2+1)^2}dx=2\int_{0}^{\infty}\frac{\cos(x)}{(x^2+1)^2}=\frac{\pi}{e}$$ So $$\int_{0}^{\infty}\frac{\cos(x)}{(x^2+1)^2}=\frac{\pi}{2e}$$ Could anybody confirm that this is the correct result and please point out any flaws in my method for both my first and second solutions?