I want to show that (for $x \in \mathbb{R}$ and $z \in \mathbb{C}$)
$$ \int_{-\infty}^{\infty} {\dfrac{\cos \pi x}{z^2-2z+5}}\mathrm{d}x = -\frac{\pi }{2}e^{-2\pi}$$
However, I am a little confused on how to proceed given that the denominator of the integrand is complex.
If the integral was in the form $ \int_{-\infty}^{\infty} {\dfrac{\cos \pi x}{\color{blue}{x^2-2x+5}}}\mathrm{d}x$, then I could treat it as a Fourier integral, and use the fact that $$ \int_{-\infty}^{\infty} {\dfrac{\cos \pi x}{x^2-2x+5}}\mathrm{d}x = -2\pi \sum {\operatorname{Im} \operatorname{Res} \left[ \dfrac{e^{i\pi z}}{z^2-2z+5} \right] }$$
But given that the numerator of the integrand is a complex number, I am missing a key insight on how to proceed towards a solution. Thanks in advance!
Let $\Gamma_{R}$ be the semicircular contour in the upper-half plane of radius $R$. Then calculate
$$\int_{-\infty}^{\infty} \frac{\cos(\pi x)}{x^2-2x+5}\, dx = \Re \left \{\int_{-\infty}^{\infty} \frac{e^{i \pi x}}{x^2-2x+5}\, dx \right \} \\ = \Re \left \{\int_{\Gamma_R} \frac{e^{i \pi z}}{z^2-2z+5} \right \} \\ = \Re \{2\pi i \mathrm{Res}_{z=1+2i} \left (e^{i \pi z}/(z^2-2z+5) \right ) \} \\ = \Re \{2\pi i e^{i \pi - 2\pi}/(4i) \} = -\frac{\pi}{2}e^{-2\pi}.$$
On the question of whether it is a $z$ or an $x$: it is a typo. Just substitute $z=0$ and $z=1$ to belie a contradiction by linearity to do a dummy check.