# 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.

• Could the fact that $$\log(1+\cos(2\alpha x))=\sum^\infty_{k=1}\dfrac{(-1)^{k+1}}{k}\cos^k(2\alpha x)$$Be used? ($\cos(2\alpha x)<1\forall 2\alpha x$) – user122283 May 4 '14 at 16:17
• @SantoshLinkha You can also try this one $$\int_0^\infty \frac{\log \sin^2 \alpha x}{\beta^2-x^2} \, dx=\alpha \pi-\frac{\pi^2}{2\beta},\qquad \alpha>0,\beta>0.$$ Note, this integral requires $\beta >0.$ – Jeff Faraci May 4 '14 at 16:59
• @Integrals Signs are not important. It depends on $\large\left\vert\,\alpha\,\right\vert$ and $\large\left\vert\,\beta\,\right\vert$. – Felix Marin May 4 '14 at 22:00
• User64494 is correct - I don't think this integral converges. The RHS if anything is a Cauchy PV. – Ron Gordon May 4 '14 at 23:58
• @Integrals, usual integral and Cauchy PV integral are slightly different objects. And the integral in question does not converge as improper integral sense except for some rare occurrence where the singularity is cancelled. That's what peoples said and that's why I began with the Cauchy PV. – Sangchul Lee May 5 '14 at 4:46

We make use of the identity

$$\sum_{n=-\infty}^{\infty} \frac{1}{a^{2} - (x + n\pi)^{2}} = \frac{\cot(x+a) - \cot(x-a)}{2a}, \quad a > 0 \text{ and } x \in \Bbb{R}.$$

Then for $\alpha, \beta > 0$ it follows that

\begin{align*} I := \mathrm{PV}\int_{0}^{\infty} \frac{\log\cos^{2}(\alpha x)}{\beta^{2} - x^{2}} &= \frac{1}{2} \mathrm{PV} \int_{-\infty}^{\infty} \frac{\log\cos^{2}(\alpha x)}{\beta^{2} - x^{2}} \, dx \\ &= \frac{\alpha}{2} \mathrm{PV} \int_{-\infty}^{\infty} \frac{\log\cos^{2}x}{(\alpha\beta)^{2} - x^{2}} \, dx \\ &= \frac{\alpha}{2} \sum_{n=-\infty}^{\infty} \mathrm{PV} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\log\cos^{2}x}{(\alpha\beta)^{2} - (x+n\pi)^{2}} \, dx \\ &= \frac{\alpha}{2} \mathrm{PV} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \left( \sum_{n=-\infty}^{\infty} \frac{1}{(\alpha\beta)^{2} - (x+n\pi)^{2}} \right) \log\cos^{2}x \, dx \\ &= \frac{1}{4\beta} \mathrm{PV} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} (\cot(x+\alpha\beta) - \cot(x-\alpha\beta)) \log\cos^{2}x \, dx, \end{align*}

where interchanging the order of integration and summation is justified by Tonelli's theorem applied to the summation over large indices $n$. Then

\begin{align*} I &= \frac{1}{4\beta} \mathrm{PV} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} (\cot(x+\alpha\beta) - \cot(x-\alpha\beta)) \log\cos^{2}x \, dx \\ &= \frac{1}{2\beta} \mathrm{PV} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} (\cot(x+\alpha\beta) - \cot(x-\alpha\beta)) \log\left|2\cos x\right| \, dx \tag{1} \end{align*}

Here, we exploited the following identity to derive (1).

$$\mathrm{PV} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cot(x+a) \, dx = 0 \quad \forall a \in \Bbb{R}.$$

Now with the substitution $z = e^{2ix}$ and $\omega = e^{2i\alpha\beta}$, it follows that

\begin{align*} I &= \frac{1}{2\beta} \Re \mathrm{PV} \int_{|z|=1} \left( \frac{\bar{\omega}}{z - \bar{\omega}} - \frac{\omega}{z - \omega} \right) \log(1 + z) \, \frac{dz}{z}. \tag{2} \end{align*}

Now consider the following unit circular contour $C$ with two $\epsilon$-indents $\gamma_{\omega,\epsilon}$ and $\gamma_{\bar{\omega},\epsilon}$.

Then the integrand of (2)

$$f(z) = \left( \frac{\bar{\omega}}{z - \bar{\omega}} - \frac{\omega}{z - \omega} \right) \frac{\log(1 + z)}{z}$$

is holomorphic inside $C$ (since the only possible singularity at $z = 0$ is removable) and has only logarithmic singularity at $z = -1$. So we have

$$\oint_{C} f(z) \, dz = 0.$$

This shows that

\begin{align*} I &= \frac{1}{2\beta} \Re \lim_{\epsilon \downarrow 0} \left( \int_{-\gamma_{\omega,\epsilon}} f(z) \, dz + \int_{-\gamma_{\bar{\omega},\epsilon}} f(z) \, dz \right) \\ &= \frac{1}{2\beta} \Re \left( \pi i \mathrm{Res}_{z=\omega} f(z) + \pi i \mathrm{Res}_{z=\bar{\omega}} f(z) \right) \\ &= \frac{1}{2\beta} \Re \left( - \pi i \log(1 + \omega) + \pi i \log(1 + \bar{\omega}) \right) \\ &= \frac{\pi}{\beta} \arg(1 + \omega) = \frac{\pi}{\beta} \arctan(\tan (\alpha \beta)). \end{align*}

In particular, if $\alpha\beta < \frac{\pi}{2}$ then we have

$$I = \pi \alpha.$$

But due to the periodicity of $\arg$ function, this function draws a scaled saw-tooth function for $\alpha > 0$. Of course, $I$ is an even function of both $\alpha$ and $\beta$, so the final result is obtained by even extension of this saw-tooth function.

• +1 Thank you for providing proof to this problem. How did you draw your contour? Do you use mathematica to do so? – Jeff Faraci May 5 '14 at 1:52
• @Integrals, I use Mathematica, so basically I use some calculation to create a figure. For the series, you can first apply partial fraction decomposition and then apply the partial fraction decomposition formula for tangent. – Sangchul Lee May 5 '14 at 3:33
• Okay great thanks you. I will look into the contour drawing. – Jeff Faraci May 5 '14 at 4:05
• @RandomVariable That sounds much simpler. Actually, what I did in the first step is to wind the upper-half plane $\Bbb{H}$ into the unit disc $\Bbb{D}$, so the theoretically two approaches are almost equivalent. Still, your idea leads to a much simpler solution. (Actually what I intended first is to use some real-analysis techniques... the first part is just a trace of this unsuccessful approach.) – Sangchul Lee May 5 '14 at 4:30
• @AchalGautam You can divide the interval $(-\infty, \infty)$ into $\cdots \cup [-3\pi/2, -\pi/2] \cup [-\pi/2, \pi/2] \cup [\pi/2, 3\pi/2] \cup \cdots$. Then your integral splits as the sum of integrals on these subintervals, and by translation it is finally written as the sum as in the identity. – Sangchul Lee Jun 1 '14 at 3:51

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.$$

• whoever down votes random variable needs to reevaluate what they think they know about mathematics. He solves $\approx$ every integral I post!!!! – Jeff Faraci May 6 '14 at 11:32
• I can't tell, are you switching the order of taking the logarithm and taking the real part in the beginning? If so, how is this justified? Take for example $z = \pi/4 - i\log(\sqrt{2}).$ Then $f(z)=1+e^{iz} = 2+i$ which has real part $2$. Hence $\log(\mathscr{R}(f))=\log(2)$. However, $\log(f(z)) = \log|2+i| + i \arg(2+i) = \log(\sqrt{5}) + i \arctan(1/2).$ This has real part $\log(\sqrt{5})$ which is not $\log(2).$ – glowsticc May 9 '14 at 0:35
• @glowsticc $$\log(1+e^{2iax}) = \log(1+\cos 2ax + i \sin 2ax)$$ $$= \log |1+\cos 2ax + i \sin 2ax| + i \arg( 1+ \cos 2ax +i \sin 2ax )$$ $$= \log \left( \sqrt{1+2 \cos 2ax + \cos^{2}(2ax) + \sin^{2}(2ax)} \right) + i \arctan \left( \frac{\sin 2ax}{1 + \cos 2ax} \right)$$ $$= \frac{1}{2} \log(2+ 2 \cos 2ax) + i \arctan \left( \frac{\sin 2ax}{1 + \cos 2ax} \right)$$ Then I'm just extracting the real part. – Random Variable May 9 '14 at 0:54
• +1. The result is so simple that it should be some way to get it in an elementary way. I guess so. I couldn't imagine any simple way. Nice answer. – Felix Marin May 30 '14 at 21:41
• @FelixMarin Thanks. This was sort of a simplification of sos440's approach. I don't know of any other way to approach it. – Random Variable May 30 '14 at 22:14

Let us use the contour $\gamma$ which is the limit as $R\to\infty$ and $r\to0$ of $$[-R,-\beta-r]\cup-\beta+re^{i[\pi,0]}\cup[-\beta+r,\beta-r]\cup\beta+re^{i[\pi,0]}\cup[\beta+r,R]\cup Re^{i[0,\pi]}$$

$\hspace{3.5cm}$

to compute \begin{align} &PV\int_{-\infty}^\infty\frac{\cos(\alpha x)}{\beta^2-x^2}\mathrm{d}x\\ &=PV\int_{-\infty}^\infty\frac{e^{i\alpha x}}{\beta^2-x^2}\mathrm{d}x\\ &=\int_\gamma\frac{e^{i\alpha z}}{\beta^2-z^2}\mathrm{d}z+\pi i\operatorname*{Res}_{z=-\beta}\left(\frac{e^{i\alpha z}}{\beta^2-z^2}\right)+\pi i\operatorname*{Res}_{z=\beta}\left(\frac{e^{i\alpha z}}{\beta^2-z^2}\right)\\ &=0+\pi i\frac{e^{-i\alpha\beta}}{2\beta}-\pi i\frac{e^{i\alpha\beta}}{2\beta}\\[6pt] &=\frac\pi\beta\sin(\alpha\beta) \end{align} where $\alpha\ge0$ (needed so that the integral vanishes along the large arc); however, the principal value integral is even in $\alpha$.

Setting $\alpha=0$ gives $$PV\int_{-\infty}^\infty\frac1{\beta^2-x^2}\mathrm{d}x=0$$

Now we can use that $$\log\left(\cos^2(\alpha x)\right)=-2\log(2)+2\sum_{k=1}^\infty\frac{(-1)^{k-1}}{k}\cos(2k\alpha x)$$ to get, for $\alpha\ge0$, \begin{align} \int_0^\infty\frac{\log\left(\cos^2(\alpha x)\right)}{\beta^2-x^2}\mathrm{d}x &=\frac12\int_{-\infty}^\infty\frac{\log\left(\cos^2(\alpha x)\right)}{\beta^2-x^2}\mathrm{d}x\\ &=\frac\pi\beta\sum_{k=1}^\infty\frac{(-1)^{k-1}}{k}\sin(2k\alpha\beta)\\ &=\frac\pi\beta\frac1{2i}\sum_{k=1}^\infty\frac{(-1)^{k-1}}{k}\left(e^{2ik\alpha\beta}-e^{-2ik\alpha\beta}\right)\\ &=\frac\pi\beta\frac1{2i}\left(\log\left(1+e^{2i\alpha\beta}\right)-\log\left(1+e^{-2i\alpha\beta}\right)\right) \end{align}

Note that $$\theta(\alpha,\beta)=\frac\pi\beta\frac1{2i}\left(\log\left(1+e^{2i\alpha\beta}\right)-\log\left(1+e^{-2i\alpha\beta}\right)\right)$$ is an odd function of $\alpha$ with a period of $\frac\pi{|\beta|}$ and equals $\pi\alpha$ for $|\alpha|\lt\frac\pi{2|\beta|}$. Furthermore, in general, $$\int_0^\infty\frac{\log\left(\cos^2(\alpha x)\right)}{\beta^2-x^2}\mathrm{d}x=\theta(|\alpha|,\beta)$$ and $\theta(|\alpha|,\beta)=\pi|\alpha|$ for $|\alpha|\le\frac\pi{2|\beta|}$.

Thus, the integral is not totally independent of $\beta$.

• Sir Robjohn. Thank you for another method to solving this problem! – Jeff Faraci Jun 1 '14 at 17:20