Compute $\int_0^{\infty}\frac{\cos(\pi t/2)}{1-t^2}dt$ Compute $$\int_0^{\infty}\frac{\cos(\pi t/2)}{1-t^2}dt$$

The answer is $\pi/2$. The discontinuities at $\pm1$ are removable since the limit exists at those points.

Define
$$f(z)=\frac{e^{\pi iz/2}}{1-z^2}\;,\;\;C_R:=[-R,-1-\epsilon]\cup\gamma_{-1,\epsilon}\cup[1+\epsilon,\epsilon]\cup\gamma_{1\epsilon}\cup[1+\epsilon,R]\cup\Gamma_R$$
with $\;\epsilon, R\in\Bbb R^+\;$ and
$$\gamma_{r,s}:=\{r+se^{it}\;;\;0\le t\le \pi\}\;,\;r,s\in\Bbb R^+\;,\;\Gamma_R:=\{Re^{it}\;;\;0\le t\le \pi\}\;$$
Now, as the two poles of the function are simple:
$$\begin{align*}\text{Res}_{z=-1}(f)&=\lim_{z\to -1}(z+1)f(z)=\frac{e^{-\pi i/2}}{2}=-\frac i2\\
\text{Res}_{z=1}(f)&=\lim_{z\to 1}(z-1)f(z)=-\frac{e^{\pi i/2}}{2}=-\frac i2\end{align*}$$
so using the corollary to the lemma in the second answer here (watch the direction of the integration!), and the residue theorem for integration, and using also Jordan's Lemma, we get:
$$0=\lim_{R\to\infty\,,\,\epsilon \to 0}\oint\limits_{C_R}f(z) dz=\int\limits_{-\infty}^\infty f(x)dx+\pi i(i)\implies$$
$$\int\limits_{-\infty}^\infty \frac{e^{\pi ix/2}}{1-x^2}dx=\pi$$
Now just compare real parts in both sides and take into account your integrand function is an even one...
