Evaluate $\int\limits_0^\infty \frac{\cos(ax)}{\cos(bx)}\frac{1}{1+x^2}dx$ I would like to show that
$$\text{PV}\int_0^\infty \frac{\cos(ax)}{\cos(bx)}\frac{1}{1+x^2}dx = \frac{\pi}{2}\mathrm{sech}(b)$$
using complex analysis. $a$ and $b$ are real numbers and $a \neq b$.
Please give some hints.
 A: What the question asking for cannot be right!
At least for $0 < a < b$, we have:
$$\begin{align}\operatorname{PV} \int_0^{\infty} \frac{\cos a x}{\cos b x} \frac{dx}{1+x^2}&= \frac12 \operatorname{PV} \int_{-\infty}^{\infty} \frac{\cos a x}{\cos b x}\frac{dx}{1+x^2}
\\&= \frac12 \lim_{\epsilon\to 0+} \Re\left[\int_{-\infty+i\epsilon}^{\infty+i\epsilon} \frac{\cos a z}{\cos b z}\frac{dz}{1+z^2}\right]\tag{*}
\end{align}$$
The last equality is true because at the poles $\pm \frac{(2k-1)\pi}{2 b}, k = 1, 2,\ldots$ of the integrand $\frac{\cos a z}{\cos b z}\frac{1}{1+z^2}$, the residues are all real. Their contribution to the integral is $-\pi i$ times the residues and hence is imaginary.
We can evaluate the integral $(*)$ by completing the contour in upper half plane.
Notice when the $y$ in $z = x + iy$ becomes big, 
$\frac{\cos a z}{\cos b z} \sim e^{-(b-a)(y - ix)} \to 0$.
The upper half circle at infinity contributes nothing to the contour integral and we have:
$$\lim_{\epsilon\to 0+}\int_{-\infty+i\epsilon}^{\infty+i\epsilon} \frac{\cos a z}{\cos b z}\frac{dz}{1+z^2} 
= 2 \pi i \operatorname{Res}( \frac{\cos a z}{\cos b z}\frac{1}{1+z^2}; z = i )
= 2 \pi i \frac{\cos a i}{\cos b i}\frac{1}{2i} = \pi \frac{\cosh a}{\cosh b}$$
From this, we get:
$$\operatorname{PV} \int_0^{\infty} \frac{\cos a x}{\cos b x} \frac{dx}{1+x^2} = \frac{\pi}{2} \frac{\cosh a}{\cosh b}$$
This is not what the OP asking to show...
A: So, you need to explain what you want.  Take this one
$$
\int_0^\infty \frac{\cos x}{\cos(2x)}\;\frac{dx}{1+x^2}
$$
The first spot where it is improper is $x=\pi/4$, and
$$
\int_0^{\pi/4} \frac{\cos x}{\cos(2x)}\;\frac{dx}{1+x^2} = +\infty .
$$
So unless you provide some explanation, your request is impossible.
