# Definite integral involving logarithm of cosine

Does anyone know the provenance of or the answer to the following integral

$$\int_0^\infty\ \frac{\ln|\cos(x)|}{x^2} dx$$

Thanks.

• Have you tried complexifying the integral? – dylan7 Mar 9 '15 at 22:23
• He may not have tried it, but I did, and I got nowhere. However, I did not notice that I could be integrating the analytic complex function $\frac{1}{2} \frac{\ln(\cos^2z)}{z^2}$ which has poles on the real axis at odd multiples of $\pi/2$. Maybe this can be done in that way. – Mark Fischler Mar 9 '15 at 22:55

Lucian's answer is just fine (as always), but from $$\sum_{n\in\mathbb{Z}}\frac{1}{(x+n\pi)^2}=\frac{1}{\sin^2 x}\tag{1}$$ for any $x\in(-\pi,\pi)$ it also follows that: $$I = \frac{1}{2}\int_{0}^{+\infty}\frac{\log\cos^2 x}{x^2}\,dx = \frac{1}{2}\int_{-\pi/2}^{\pi/2}\frac{\log\cos x}{\sin^2 x}\,dx=-\frac{1}{2}\int_{0}^{+\infty}\frac{\log(1+t^2)}{t^2}\,dt$$ by replacing $x$ with $\arctan t$ in the last step. Integration by parts now leads to: $$I = -\int_{0}^{+\infty}\frac{dt}{1+t^2} = \color{red}{-\frac{\pi}{2}}.\tag{2}$$ Someone may ask now: How to prove $(1)$?

Well, for such a purpose, start from the Weierstrass product for the sine function: $$\frac{\sin z}{z}=\prod_{n\geq 1}\left(1-\frac{z^2}{\pi^2 n^2}\right)$$ then consider the logarithm of both sides and differentiate it twice with respect to $z$.

Hint: Let $I(n)=\displaystyle\int_0^\infty\frac{1-\cos^{2n}x}{x^2}~dx.~$ Prove first that $I(n)=n\pi~\dfrac{\displaystyle{2n\choose n}}{4^n}~,~$ then evaluate $I'(0)$.

• (+1) Maybe it is not easy to recognize at first sight that $I$ is given by the derivative of a beta function at some point, but I agree this is the fastest technique. – Jack D'Aurizio Mar 10 '15 at 1:46

This integral is equal to $$\frac{1}{2} \int_0^\infty \frac{\ln (\cos^2 x)}{x^2} dx = \frac{1}{2}(-\pi) = -\frac{\pi}2$$

The easiest place to remember seeing this is Gradshteyn and Ryzhik, where it appears as definite integral 4.322.6. The source quoted there is Fikhtebgik'ts, G. M. (http://en.wikipedia.org/wiki/Grigorii_Fichtenholz on Wikipedia) in the book Kurs differntsial'nogo i integral'ogo ischizdat, Vloume 2, page 686.

The book is pictured on the WP page. Quoting the Wiki description, "Fichtenholz's books about analysis are widely used in Eastern European and Chinese universities due to its exceptionality of detailed and well-ordered presentation of material about mathematical analysis. "

If this is an example of content in an introductory class on calculus, I think I am glad it has not been translated into English for me to have read as an undergraduatei!

• Honestly, I think this integral can be solved also without mentioning obscure references (even if they are really good books). – Jack D'Aurizio Mar 10 '15 at 1:50
• nice catch - belated thanks – user2052 Feb 27 '18 at 22:37