$$\int_0^{\pi/2} \ln{(x^2 + \ln^2{(\cos{x})})} \,\mathrm{d}x$$

I was given this integral yesterday by someone on a forum and after a few hours of having a go at it I didn't really get anywhere significant.

My first idea was to use a series of substitutions which would simply the integral into a form where taylor expansions could be used to solve it. Another idea of mine was to use complex numbers to get rid of some of the log terms, changing the $\ln^2{(\cos{x})}$ term could possibly make this integral a lot more manageable.

I'd prefer if someone could help me solve this using basic methods although if there is a more complicated but elegant solution (using contour integration for example) it could still be beneficial to someone else. We don't do the equivalent of Calc III in my school so I am not very familiar with methods which go beyond the Calc II syllabus (DUDIS, Laplace ect..).


marked as duplicate by Fabian, Lucian, Em., hardmath, user147263 Jan 30 '16 at 22:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    $\begingroup$ Why do you believe that there is a closed-form solution? $\endgroup$ – Mark Viola Jan 30 '16 at 16:14
  • 1
    $\begingroup$ @Dr.MV It was given to me after I had spent quite a while on it that the closed form was $\pi \ln{(\ln{2})}$, I was also told that it was possible using methods I was familiar with. $\endgroup$ – Loua Jan 30 '16 at 16:17
  • 3
    $\begingroup$ I think the one idea here would be to use something like $x^2+\log(\cos(x))=|\log(\frac{1+e^{2 i x}}{2})|^2$ and map everything ($z=e^{ix}$) to the unit circle (or some deformed version of it) to employ residue theorem. maybe someone else may finish it from here, i'm much to busy today ... $\endgroup$ – tired Jan 30 '16 at 16:30
  • 2
    $\begingroup$ Actually the $2\pi i \times \text{Res}(z=0)=\pi \log(\log(2))$ so this seems definitly a way to go! Have fun with it guys :) $\endgroup$ – tired Jan 30 '16 at 16:34
  • 7
    $\begingroup$ Other evaluations are here: math.stackexchange.com/questions/915175/… $\endgroup$ – nospoon Jan 30 '16 at 17:20

Note that the integral is

$$2 \operatorname{Re}{\int_0^{\pi/2} dx \, \log{(\log{\cos{x}} + i x)}} $$

which, by using various manipulations of the integrand around the unit circle, we find to be

$$\frac12 \operatorname{Re}{\int_{-\pi}^{\pi} dx \, \log{(\log{\cos{x}} + i x)}} $$

which integral we may express as an integral over a slightly deformed unit circle:

$$-\frac{i}{2} \oint_C \frac{dz}{z} \log{\left [\log{\left(\frac{z+z^{-1}}{2} \right)}+\log{z} \right ]} = -\frac{i}{2} \oint_C \frac{dz}{z} \log{\left [\log{\left(\frac{z^2+1}{2} \right)} \right ]}$$

where $C$ is the unit circle with small semicircular indentations at the poles $z=\pm i$. The contributions from these indentations to the integral is zero as the radius of the indentations goes to zero.

Thus, we have the integral of a holomorphic function over the boundary of a region in which there is a single, simple pole at the origin. By Cauchy's theorem/ the residue theorem, the integral we seek is thus the real part of

$$i 2 \pi \left (-\frac{i}{2} \right ) \log{\log{\frac12}} $$

or $\pi \log{\log{2}} $.


Let me fill in the gaps. Imagine

$$I = \int_{0}^{\pi/2} dx \, \log{(\log{\cos{x}} + i x)}$$


$$\begin{align}I' &= \int_{\pi/2}^{\pi} dx \, \log{(\log{\cos{x}} + i x)} \\ &= \int_{0}^{\pi/2} dx \, \log{\left [\log{\left (-\cos{\left (\frac{\pi}{2} - x \right )}\right )} + i x+i \frac{\pi}{2}\right ]} \\ &= \int_{0}^{\pi/2} dx \, \log{\left [\log{\left (\cos{x}\right )} - i \pi + i \left (\frac{\pi}{2}-x \right )+i \frac{\pi}{2}\right ]}\\ &= \int_{0}^{\pi/2} dx \, \log{(\log{\cos{x}} - i x)}\end{align}$$


$$I+I' =\int_0^{\pi} dx \, \log{(\log{\cos{x}} + i x)}= \int_0^{\pi/2} dx \, \log{(\log^2{\cos{x}}+x^2)} $$


$$\operatorname{Re}{\int_{-\pi}^{\pi} dx \, \log{(\log{\cos{x}} + i x)}} = 2 \int_0^{\pi/2} dx \, \log{(\log^2{\cos{x}}+x^2)}$$

as was to be shown.

  • $\begingroup$ Nice Ron! A neat variant of the approach i proposed in the comments! (+1) $\endgroup$ – tired Jan 30 '16 at 17:00
  • $\begingroup$ @tired: thanks. This is the way I had worked it out before I saw your comments. Nice, you may want to consider putting your thought in an answer. $\endgroup$ – Ron Gordon Jan 30 '16 at 17:20
  • $\begingroup$ Dr.MV already did this (pretty well) :) $\endgroup$ – tired Jan 30 '16 at 17:22

Following the comment left by @tired, we note that we can factor the argument of the quadratic as


Writing $ix=\log(e^{ix})$ we have


Next, we write the integral of interest as


We move to the complex plane by letting $z=e^{ix}$. The integral of interest becomes

$$\begin{align} \int_0^{\pi/2}\log(x^2+\log^2(\cos(x)))\,dx&=\frac12\oint_{|z|=1}\log\left(\left|\log\left(\frac{1+z}{2}\right)\right|\right)\frac{1}{iz}\,dz\\\\ &=\frac12\text{Re}\left(\oint_{|z|=1}\log\left(\log\left(\frac{1+z}{2}\right)\right)\frac{1}{iz}\,dz\right)\\\\ &=\frac12 \text{Re}\left(2\pi i \left(\frac{\log(\log(2))+i\pi}{i}\right)\right)\\\\ &=\pi \log(\log(2)) \end{align}$$

where we tacitly deformed the contour around the branch point singularities at $z=1$ and $z=-1$ and noted that the contributions from integrations around the deformations are zero.

  • $\begingroup$ like i had done it! (+1) as always! Maybe u should mention that in prinicpal one has singularities on the contour of integration which luckily turn out to be integrable... $\endgroup$ – tired Jan 30 '16 at 17:12
  • 1
    $\begingroup$ @tired Yes, I saw your comment and proceeded along that line. I'll add some explanation as to the subtleties. Thanks for the up vote!! - Mark $\endgroup$ – Mark Viola Jan 30 '16 at 17:21
  • $\begingroup$ Dr MV Very cool... $\endgroup$ – imranfat Jan 30 '16 at 17:29
  • $\begingroup$ @imranfat Thank you! Much appreciated. - Mark $\endgroup$ – Mark Viola Jan 30 '16 at 17:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.