Consider the integral $$\int_{0}^{\infty}\frac{\cos(x)}{(1+x^2)^2}dx$$ Are there any other ways to compute this integral besides using the residue theorem?
Edit: Thank you all, kind people, for the answers. I had this on an exam and solved it with the residue theorem and was just wondering what other ways are possible and which of those do not involve complex integration.
Writing $$\frac 1{(x^2+1)^2}=\frac{2}{(i+1)^3 (x+i)}+\frac{1}{(i+1)^2 (x+i)^2}-\frac{2}{(i+1)^3 (x-i)}+\frac{1}{(i+1)^2 (x-i)^2}$$ you face two types and integral $$I_k=\int \frac {\cos(x)}{x+ik}\,dx \qquad \text{and} \qquad J_k=\int \frac {\cos(x)}{(x+ik)^2}\,dx $$ where $k=\pm 1$.
Make $x+ik=y$ and expand the cosine
$$\cos(y-ik)=\cosh (k) \cos (y)-i \sinh (k) \sin (y)$$ So, now, we have four kinds of integrals $$\int \frac {\sin(y)}y \,dy \qquad \int \frac {\cos(y)}y \,dy \qquad \int \frac {\sin(y)}{y^2} \,dy \qquad \int \frac {\cos(y)}{y^2} \,dy$$ The first and second leads to the sine and cosine integrals; for the the third and the fourth use one integration by parts.
Go back to $x$, use the bounds and simplify all complex numbers.