Solution (source code)

= Solution

Let $B=|b|>0$. For $a>0$, integrate $e^{iaz}/(z^2+B^2)$ over the upper semicircle. <Jordan's lemma> removes the arc, and the <residue theorem> at $z=iB$ gives
$$
\int_{-\infty}^{\infty}\frac{e^{iax}}{x^2+B^2}\,dx
=2\pi i\frac{e^{-aB}}{2iB}=\frac\pi B e^{-aB}.
$$
Taking the real part and using <evenness> in both $x$ and $a$ yields
$$
\boxed{I_1(a)=\frac{\pi}{2B}e^{-B|a|}.}
$$
The case $a=0$ follows directly from an <inverse tangent> primitive. The complex exponential is essential on the contour: the cosine alone has a growing exponential component.

For $a>0$, <differentiation under the integral sign> gives $-I_1'(a)=\int_0^\infty x\sin(ax)/(x^2+B^2)\,dx$. This derivative is a conditionally convergent <improper integral>; the <Dirichlet test> makes its tails uniform on compact subintervals of $a>0$, justifying the differentiation. Setting $a=1$ gives
$$
\boxed{I_2=\frac\pi2e^{-B}.}
$$
Finally let $J(a)=\int_0^\infty\sin(ax)/[x(x^2+B^2)]\,dx$. Its differentiated integrand is absolutely integrable, so $J'(a)=I_1(a)$ and $J(0)=0$. Hence
$$
\boxed{I_3=J(1)=\frac{\pi}{2B^2}(1-e^{-B}).}
$$
If $b=0$, $I_1$ and $I_3$ diverge at the origin, whereas $I_2=\int_0^\infty\sin x/x\,dx=\pi/2$ is the corresponding <Dirichlet integral>.