What are different ways to compute $\int_{0}^{+\infty}\frac{\cos x}{a^2+x^2}dx$?
For any $a>0$, $$ I(a)=\int_{0}^{+\infty}\frac{\cos(x)}{x^2+a^2}\,dx = \frac{1}{a}\int_{0}^{+\infty}\frac{\cos(ax)}{1+x^2}\,dx = \frac{J(a)}{a} $$ and the Laplace transform of $J(a)$ is given by $$ \int_{0}^{+\infty}J(a) e^{-sa}\,da = \int_{0}^{+\infty}\int_{0}^{+\infty}\frac{\cos(ax)e^{-sa}}{1+x^2}\,dx\,da $$ or, by invoking Fubini's theorem and integration by parts: $$ \int_{0}^{+\infty}\frac{s}{(1+x^2)(s^2+x^2)}\,dx =\frac{\pi}{2(1+s)}$$ by partial fraction decomposition. $\mathcal{L}^{-1}$ then gives $J(a)=\frac{\pi}{2}e^{-a}$ and $I(a)=\frac{\pi}{2a}e^{-a}$ as wanted.