Solution (source code)

= Solution

Use $f(x)=(2\pi)^{-1}\int_{\mathbb R}\widetilde f(k)e^{ikx}dk$. <Jordan's lemma> says that for $x>0$, if a function $h$ has maximum modulus $M_R\to0$ on upper semicircles, then $\int_{C_R}h(k)e^{ikx}dk\to0$; a bound is $\pi M_R/x$. For $x<0$ use lower semicircles instead. The rational factors here meet this decay condition, so the <residue theorem> evaluates their inverse transforms.

For $1/(a+ik)$, only the upper half-plane contains a pole, at $k=ia$. Its <residue> after multiplication by $e^{ikx}$ is $-ie^{-ax}$. The lower contour encloses no pole. Therefore
$$
\boxed{\mathcal F^{-1}\left[\frac1{a+ik}\right](x)=e^{-ax}H(x).}
$$
Here $H$ is the <Heaviside step function>, with midpoint value $H(0)=1/2$ for symmetric Fourier inversion.

For $1/(a^2+k^2)$, the upper-pole <residue> is $e^{-ax}/(2ia)$ when $x>0$, while the clockwise lower contour gives the matching expression for $x<0$. Thus
$$
\boxed{\mathcal F^{-1}\left[\frac1{a^2+k^2}\right](x)=\frac{e^{-a|x|}}{2a}.}
$$
The final rational factor has double poles at $\pm ia$. At the upper pole,
$$
\operatorname{Res}_{k=ia}\frac{e^{ikx}(a^2-k^2)}{(a^2+k^2)^2}
=\left.\frac d{dk}\frac{e^{ikx}(a^2-k^2)}{(k+ia)^2}\right|_{k=ia}
=-\frac{ix}2e^{-ax}.
$$
The upper inverse integral is $i$ times that <residue>. The lower contour for negative $x$ supplies $-x e^{ax}/2$, and the value at zero is zero. Consequently
$$
\boxed{\mathcal F^{-1}\left[\frac{a^2-k^2}{(a^2+k^2)^2}\right](x)=\frac{|x|}2e^{-a|x|}.}
$$