$$\int_{-\infty}^{\infty}{\cos(x+a)\over (x+b)^2+1}dx=\cos (a-b)\int_{-\infty}^{\infty}{\cos x\over x^2+1}dx-\sin (a-b)\int_{-\infty}^{\infty}{\sin x\over x^2+1}dx$$
Deje $\lambda\in\mathbb{R}$,
$$I(\lambda)=\int_{-\infty}^{\infty}{\cos(\lambda x)\over x^2+1}dx$$
utilizamos integrar por partes, la escritura
$$u=\frac{1}{{{x}^{2}}+1}\quad,\quad dv=\cos (\lambda x)$$
tenemos
$$I(\lambda )=\frac{\sin (\lambda x)}{\lambda ({{x}^{2}}+1)}\izquierda| \begin{matrix}
\infty \\
-\infty \\
\end{de la matriz} \right.+\frac{2}{\lambda }\int_{-\infty }^{+\infty }{\frac{\sin (\lambda x)}{{{({{x}^{2}}+1)}^{2}}}}\,dx
$$
como resultado
$$\lambda I(\lambda )=2\int_{-\infty }^{\infty }{\frac{x\sin \lambda x}{{{({{x}^{2}}+1)}^{2}}}\,}dx \,.\quad(1)$$
Por diferenciarse con respecto a $\lambda$ para obtener
$$\lambda \frac{dI}{d\lambda }+I(\lambda )=2\int_{-\infty }^{\infty }{\frac{{{x}^{2}}\cos \lambda x}{{{({{x}^{2}}+1)}^{2}}}\,}dx=\underbrace{2\int_{-\infty }^{\infty }{\frac{\cos \lambda x}{{{x}^{2}}+1}\,}dx}_{2I(\lambda )}-2\int_{-\infty }^{\infty }{\frac{\cos \lambda x}{{{({{x}^{2}}+1)}^{2}}}\,}dx$$
por lo tanto
$$\lambda \frac{dI}{d\lambda }-I(\lambda )=-2\int_{-\infty }^{\infty }{\frac{\cos \lambda x}{{{({{x}^{2}}+1)}^{2}}}\,}dx$$
y
$$\lambda \frac{{{d}^{2}}I}{d{{\lambda }^{2}}}=2\int_{-\infty }^{\infty }{\frac{x\sin \lambda x}{{{({{x}^{2}}+1)}^{2}}}\,}dx.\quad(2)$$
$(1)$ $(2)$
$$\frac{{{d}^{2}}I(\lambda)}{d{{\lambda }^{2}}}- I(\lambda )=0$$
así
$$I(\lambda)=c_1e^{\lambda}+c_2e^{-\lambda}$$
en el otro lado
\begin{align}
& I(0)={{c}_{1}}+{{c}_{2}}=\int_{-\infty }^{+\infty }{\frac{1}{{{x}^{2}}+1}}\,dx=\pi \,\,\,\,\Rightarrow \,\,{{c}_{1}}+{{c}_{2}}=\pi \, \\
& I(\lambda )=\frac{2}{\lambda }\int_{-\infty }^{+\infty }{\frac{x\sin \lambda x}{{{({{x}^{2}}+1)}^{2}}}\,\,}dx\,\,\,\Rightarrow \,\,\underset{\lambda \to \infty }{\mathop{\lim }}\,I(\lambda )=0\,\,\,\Rightarrow \,{{c}_{1}}=0 \\
\end{align}
entonces
$$I(\lambda )=\pi {{e}^{-\lambda }}$$
set $\lambda=1$, tenemos
$$\cos (a-b)\int_{-\infty}^{\infty}{\cos x\over x^2+1}dx=\frac{\pi}{e}\cos (a-b)$$
Ahora establecer
$$J(\lambda)=\int_{-\infty}^{\infty}{\sin(\lambda x)\over x^2+1}dx$$
Repetimos esta producción,para obtener
$$J(\lambda)=c_1e^{\lambda}+c_2e^{-\lambda}$$
y
\begin{align}
& J(0)={{c}_{1}}+{{c}_{2}}=0 \\
& \underset{\lambda \to \infty }{\mathop{\lim }}\,J(\lambda )=0\Rightarrow \,{{c}_{1}}=0 \\
\end{align}
es decir,$J(\lambda)=0$, con lo que
$$\int_{-\infty}^{\infty}{\cos(x+a)\over(x+b)^2+1}dx=\frac{\pi}{e}\cos(a-b)$$