I'm trying to show $$PV \int_0^\infty\frac{\cos(\ln x)}{x^2+1}\,dx=\frac{\pi}{2\cosh(\pi/2)}.$$ My textbook says to do this by "integrating $e^{i\ln z}/(z^2-1)$ around a contour like Figure 7.3 but rotated 90◦ clock- wise so the straight side is along the y axis."
I took the original integral and reformulated it like this: $$I=\int_0^\infty\frac{\cos(\ln x)}{x^2+1}\,dx=\frac{1}{2}\text{ Re}\left[\int_{-\infty}^\infty\frac{e^{i\ln x}}{x^2+1}\,dx\right]$$
Next I set up the contour integral $$\oint_C\frac{e^{i\ln z}}{(z^2-1)}\,dz=2\pi i\sum Res$$
With $\sum Res = Res[z=1]$.
I then managed to show that the semicircular paths around the contour go to zero as $R$ and $\epsilon$ go to infinity and zero respectively. This implies the contour integral is equal to the principal value of $f(z)$ evaluated from $-\infty$ to $\infty$.
But my problem is that $\frac{1}{2}$ of the real part of the sum of the residues does not equal $\frac{\pi}{2\cosh(\pi/2)}$.
Any pointers would be very much appreciated, I've been working on this for quite a while now!