How to find PV $\int_0^\infty \frac{\log \cos^2 \alpha x}{\beta^2-x^2} \, \mathrm dx=\alpha \pi$ $$
I:=PV\int_0^\infty \frac{\log\left(\cos^2\left(\alpha x\right)\right)}{\beta^2-x^2} \, \mathrm dx=\alpha \pi,\qquad \alpha>0,\  \beta\in \mathbb{R}.$$
I am trying to solve this integral, I edited and added in Principle value to clarify the convergence issue that the community pointed out.  I tried to use $2\cos^2(\alpha x)=1+\cos 2\alpha x\,$ and obtained
$$
I=-\log 2 \int_0^\infty \frac{\mathrm dx}{\beta^2-x^2}+\int_0^\infty \frac{\log (1+\cos 2 \alpha x)}{\beta^2-x^2}\mathrm dx,
$$
simplifying
$$
I=\frac{ \pi \log 2 }{2\beta}+\int_0^\infty \frac{\log (1+\cos 2 \alpha x)}{\beta^2-x^2}\mathrm dx
$$
but  stuck here. Note the result of the integral is independent of the parameter $\beta$. Thank you
Also for $\alpha=1$, is there a geometrical interpretation of this integral and why it is $\pi$?
Note this integral 
$$
\int_0^\infty \frac{\log \sin^2 \alpha x}{\beta^2-x^2} \,\mathrm dx=\alpha \pi-\frac{\pi^2}{2\beta},\qquad \alpha>0,\beta>0
$$
is also FASCINATING, note the constraint $\beta>0$ for this one.  I am not looking for a solution to this too obviously on the same post, it is just to interest people with another friendly integral.

Consider the function $$ f(z) = \frac{\log(1+e^{2i \alpha z})}{z^{2}-\beta^{2}} \ , \ (\alpha,\beta >0)$$
which is well-defined on the complex plane if we omit the real axis and restrict $z$ to the upper half-plane while defining $\log (1+e^{2iaz})$ to be $\log(2)$ just above the origin.
Notice that  $$\text{Re} \big( f(x) \big) = \frac{1}{2} \frac{\log(2+2 \cos 2 \alpha x)}{x^{2}-\beta^{2}} = \frac{1}{2} \frac{\log \big(4 \cos^{2} ( \alpha x) \big)}{x^{2}-\beta^{2}}.$$
Now integrate around a contour that consists of the line segment just above the line segment $[-R,R]$ (with half-circle indentations of radius $r$ around the branch points at $z= \frac{(2n+1)\pi}{2 \alpha}$ and the simple poles at $z = \pm \beta$) and the upper half of the circle $|z|=R$.
Along the upper half of $|z|=R$, $\log(1+e^{2iaz}) \to 0$ as $R \to \infty$. So the integral clearly vanishes along there as $R \to \infty$.
And since $\lim_{z \to \frac{(2n+1)\pi}{2 \alpha}}\left(z- \frac{(2n+1)\pi}{2 \alpha} \right) f(z) = 0$, the contributions from the indentations around the branch points vanish as $r \to 0$.
So we have
$$\begin{align}  \text{PV} \int_{-\infty}^{\infty} \frac{\log \left(4 \cos^{2}( \alpha x)\right)}{\beta^{2}-x^{2}} \ dx &= -2 \ \text{Re} \ \text{PV} \int_{-\infty}^{\infty} \frac{\log(1+e^{2i \alpha x})}{x^{2}-\beta^{2}} \ dx \\ &= -2 \ \text{Re} \Big( i \pi \ \text{Res}[f(z),\beta)] + i \pi \ \text{Res}[f(z),-\beta)]\Big) \\ &= - 2 \ \text{Re} \ i \pi  \Big(\frac{\log(1+e^{2i \alpha \beta})}{2 \beta} + \frac{\log(1+e^{-2i \alpha \beta})}{-2 \beta} \Big) \\ &= \frac{2\pi}{\beta} \left[\arctan\Big(\frac{\sin 2 \alpha \beta}{1+\cos 2 \alpha \beta}\Big) \right] \\ &= \frac{2 \pi}{\beta} \arctan \left(\tan ( \alpha \beta) \right) , \end{align}$$
which implies
$$ \log(4) \ \text{PV} \int_{-\infty}^{\infty} \frac{1}{\beta^{2}-x^{2}} \ dx + \text{PV} \int_{-\infty}^{\infty} \frac{\log \cos^{2}(\alpha x)}{\beta^{2}-x^{2}} \ dx = \frac{2 \pi}{\beta} \arctan \left( \tan (\alpha \beta) \right).$$
But $$\text{PV} \int_{-\infty}^{\infty} \frac{1}{\beta^{2}-x^{2}} \ dx =0$$
since the residues at $\pm \beta$ cancel each other.
Therefore,
$$ \text{PV} \int_{0}^{\infty} \frac{\log \cos^{2}(\alpha x)}{\beta^{2}-x^{2}} \ dx =  \frac{\pi}{\beta} \arctan \left(\tan (\alpha \beta) \right).$$
And if $\alpha \beta < \frac{\pi}{2}$, $$ \text{PV} \int_{0}^{\infty} \frac{\log \cos^{2}(\alpha x)}{\beta^{2}-x^{2}} \ dx = \frac{\pi}{\beta} \left(\alpha \beta \right) =\pi \alpha.$$
