Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I want to prove that

$$\int_0^{\pi/2} \frac{\log(\cos x)}{x^2+\log^2(\cos x)}dx = \frac{\pi}{2}\left(1-\frac{1}{\log 2}\right)$$

share|improve this question
What have you tried? In what context did you come across the problem? (Also, try to not to formulate your question as a command, i.e. "Prove that". Some people tend to be offended by this.) –  mrf Mar 9 '13 at 16:51
This is more polite. It's still not a question though, but a statement. The bigger problem is that you offer no context and no hint of your own thoughts, possible failed attempts etc. –  mrf Mar 9 '13 at 16:58
Well then, go ahead and prove it. –  Zarrax Mar 9 '13 at 18:34

3 Answers 3

up vote 23 down vote accepted

Note that for $|x| < \frac{\pi}{2}$, we have

$$ \frac{\log\cos x}{\log^2 \cos x + x^2} = \Re \frac{1}{\log\left( \frac{1+e^{2ix}}{2} \right)}. $$

Thus if $I$ denotes the given integral, we have

\begin{align*} I &= \frac{1}{2}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \Re \frac{1}{\log\left( \frac{1+e^{2ix}}{2} \right)} \, dx \\ &= \frac{1}{4} \mathrm{PV}\int_{-\pi}^{\pi} \Re \frac{1}{\log\left( \frac{1+e^{ix}}{2} \right)} \, dx \\ &= \frac{1}{4} \Re \mathrm{PV}\int_{-\pi}^{\pi} \frac{1}{\log\left( \frac{1+e^{ix}}{2} \right)} \, dx. \end{align*}

Now let $C_{\epsilon}$ be the counter-clockwised contour consisting of the circle of radius 1 centered at the origin, with two semicircular indents $\gamma_{1,\epsilon}$ around $1$ and $\gamma_{2,\epsilon}$ around $-1$ as follows:

enter image description here

By writing

\begin{align*} I = \frac{1}{4} \Re \lim_{\delta\to0^{+}}\left( \int_{-\pi+\delta}^{-\delta} + \int_{\delta}^{\pi-\delta} \right) \frac{1}{\log\left( \frac{1+e^{ix}}{2} \right)} \, dx \end{align*}

and plugging the substitution $z = e^{ix}$, we observe that

\begin{align*} I = \frac{1}{4} \Im \lim_{\epsilon\to 0^{+}}\left(\oint_{C_{\epsilon}} - \int_{\gamma_{1,\epsilon}} - \int_{\gamma_{2,\epsilon}} \right) \frac{dz}{z \log\left(\frac{1+z}{2}\right)} \end{align*}


\begin{align*} f(z) = \frac{1}{z \log\left(\frac{1+z}{2}\right)}. \end{align*}

It is plain from the logarithmic singularity that

\begin{align*} \lim_{\epsilon \to 0^{+}} \int_{\gamma_{2,\epsilon}} f(z) \, dz = 0. \end{align*}

Also it follows that

\begin{align*} \lim_{\epsilon\to 0^{+}} \oint_{C_{\epsilon}} f(z) \, dz &= 2\pi i \operatorname{Res}_{z=0} f(z) = -\frac{2\pi i}{\log 2}, \\ \lim_{\epsilon\to 0^{+}} \int_{\gamma_{1,\epsilon}} f(z) \, dz &= -\pi i \operatorname{Res}_{z=1} f(z) = -2\pi i. \end{align*}

Therefore we have

\begin{align*} I &= \frac{1}{4} \Im \left( 2\pi i - \frac{2\pi i}{\log 2} \right) = \frac{\pi}{2} \left( 1 - \frac{1}{\log 2} \right). \end{align*}

share|improve this answer
Well, I'm glad that he did because his evaluation is very creative. –  Random Variable Mar 9 '13 at 18:19
@mrf, That's because I believe that this posting would also help others who share similar questions someday :) –  Sangchul Lee Mar 9 '13 at 18:21
@mrf Bleh, don't make this such a big deal. If you want to answer the question, do so, but don't go around telling people if they should answer or not based on your moral. I think this question is OK as it stands, for example. If the guy shows work, well, then that is great, but maybe he has no clue, or maybe he's lazy. In either case, it is up to you that you care to answer the question. Ultimately, the OP will realize whether showing work or not is to his/her benefit. –  Pedro Tamaroff Mar 9 '13 at 18:25
@RandomVariable, It would become clearer if you notice that $$ \log \left( \frac{1+e^{2ix}}{2} \right) = \log (e^{ix} \cos x) = \log \cos x + ix $$ for $|x| < \pi / 2$. Of course, the branch cut is chosen as the negative real axis as usual. –  Sangchul Lee Mar 9 '13 at 18:46
@RandomVariable, For the first question, that's because of the singularity of the imaginary part. That's also why I introduced the principal value notation. And for the second question, I assumed that the reader is somewhat familiar to various contour integrals... but if you want to confirm, you can plug $z = -1 + \epsilon e^{i\theta}$ and take $\epsilon \to 0$. –  Sangchul Lee Mar 9 '13 at 19:11

Consider $$f(z) = \frac{1}{\log(1-iz)} \frac{1}{1+z^{2}}$$ where the branch cut for $\log (1-iz)$ runs down the imaginary axis from $z=-i$.

Then integrate around a contour that consists of the line segment $[-R,R]$ and the upper half of the circle $|z|=R$, and is indented around the simple pole at the origin.

Since $ z f(z) ->0 $ uniformly as $R \to \infty$, $\displaystyle \int f(z) \ dz$ vanishes along the upper half of $|z|=R$ as $ R \to \infty$.

So we have

$$ \begin{align} \text{PV} \int_{-\infty}^{\infty} \frac{1}{\log(1-ix)} \frac{dx}{1+x^{2}} &= \text{PV} \int_{-\infty}^{\infty} \frac{1}{\frac{1}{2}\log(1+x^{2}) - i\arctan x} \frac{dx}{1+x^{2}} \\ &= \text{PV} \int_{-\infty}^{\infty}\frac{\frac{1}{2} \log(1+x^{2})+ i \arctan x }{\frac{1}{4} \log^{2}(1+x^{2})+ \arctan^{2} x} \frac{dx}{1+x^{2}} \\ &= 2 \pi i \ \text{Res}[f(z), i] + \pi i \ \text{Res}[f(z),0] \\ &= 2 \pi i \left(\frac{1}{2i \log 2} \right) + \pi i \left( -\frac{1}{i} \right) \\ &= \pi \left( \frac{1}{\log 2} - 1\right). \end{align}$$

Equating the real parts on both sides of the equation,

$$ \int_{-\infty}^{\infty} \frac{\frac{1}{2} \log(1+x^{2})}{\frac{1}{4} \log^{2}(1+x^{2}) + \arctan^{2} x} \frac{dx}{1+x^{2}} = \pi \left(\frac{1}{\log 2} -1 \right). $$

Now let $x= \tan u$.


$$ \begin{align} \int_{-\pi /2}^{\pi /2} \frac{\frac{1}{2} \log(\sec^{2}u)}{\frac{1}{4} \log^{2}(\sec^{2}u) + u^{2}} du &= \int_{-\pi/2}^{\pi /2} \frac{\log (\sec u)}{\log^{2}(\sec u)+u^{2}} \ du \\ &= - \int_{-\pi/2}^{\pi/2} \frac{\log(\cos u)}{\log^{2}(\sec u) + u^{2}} \ du \\ &= \pi \left(\frac{1}{\log 2} -1 \right) \end{align}$$

which implies

$$ \int_{0}^{\pi/2} \frac{\log(\cos u)}{u^{2} + \log^{2}(\cos u)} \ du = \frac{\pi}{2} \left(1- \frac{1}{\log 2} \right).$$

share|improve this answer

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\int_{0}^{\pi/2}{\ln\pars{\cos x} \over x^{2} + \ln^{2}\pars{\cos\pars{x}}} \,\dd x = {\pi \over 2}\,\bracks{1 - {1 \over \ln\pars{2}}}}$

${\sf\mbox{The integration can be performed without "leaving" the first quadrant !!!}}$.

We close the arc $\ds{\braces{z = \expo{\ic\theta}\ \mid\ 0 < \theta < {\pi \over 2}}}$ with the 'segments' $\ds{\braces{z=y\ic\ \mid\ y \in \pars{0,1}}}$ and $\ds{\braces{z=x \mid\ x \in \pars{0,1}}}$. The contour is properly indented as explained below.

\begin{align} &\color{#c00000}{% \int_{0}^{\pi/2}{\ln\pars{\cos x} \over x^{2} + \ln^{2}\pars{\cos\pars{x}}}\,\dd x} =\Re\int_{0}^{\pi/2}{\dd x \over \ln\pars{\cos\pars{x}} + x\ic} \\[3mm]&=\Re \int_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {1 \over \ln\pars{\bracks{z^{2} + 1}/\bracks{2z}} + \ln\pars{z}} \,{\dd z \over \ic z} \\[3mm]&=\Im \int_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {1 \over \ln\pars{\bracks{z^{2} + 1}/2}}\,{\dd z \over z} \\[3mm]&=\Im\left\lbrack\left.% -\int_{0}^{-\pi/2}{1 \over \ln\pars{\bracks{z^{2} + 1}/2}}\,{\dd z \over z} \right\vert_{z\ =\ \ic\ +\ \epsilon\expo{\ic\theta}} -\int_{1 - \epsilon}^{\epsilon}{1 \over \ln\pars{\bracks{-y^{2} + 1}/2}} \,{\ic\,\dd y \over \ic y} \right. \\[3mm]&\phantom{=\Im\left\lbrack a\right.}\color{#00f}{\left. -\int_{\pi/2}^{0}{1 \over \ln\pars{\bracks{z^{2} + 1}/2}}\,{\dd z \over z} \right\vert_{z\ =\ \epsilon\expo{\ic\theta}}} -\int_{\epsilon}^{1 - \epsilon}{1 \over \ln\pars{\bracks{x^{2} + 1}/2}} \,{\dd x \over x} \\[3mm]&\phantom{=\left\lbrack a\right.}\left.\color{#00f}{\left.-\int_{\pi}^{\pi/2} {1 \over \ln\pars{\bracks{z^{2} + 1}/2}}\,{\dd z \over z}\right\vert_{z\ =\ 1\ +\ \epsilon\expo{\ic\theta}}}\right\rbrack \end{align} The above integration is evaluated along the first quadrant, as explained above, and it's $\ds{"\epsilon\mbox{-indented}"}$ around $\ds{z = \ic, 0\ \mbox{and}\ 1}$. In the $\ds{\epsilon \to 0^{+}}$ limit, the contribution to the final result arises from the $\ds{\color{#00f}{\mbox{above blue terms}}}$

\begin{align} &\color{#c00000}{% \int_{0}^{\pi/2}{\ln\pars{\cos x} \over x^{2} + \ln^{2}\pars{\cos\pars{x}}}\,\dd x} \\[3mm]&=\lim_{\epsilon \to 0^{+}}\bracks{\left.% -\pars{-\,{\pi \over 2}}\,{1 \over \ln\pars{\bracks{z^{2} + 1}/2}} \right\vert_{z\ =\ \epsilon\expo{\ic\theta}} -\int_{\pi}^{\pi/2}{\epsilon\expo{\ic\theta}\,\dd\theta \over \ln\pars{1 + \epsilon\expo{\ic\theta} + \epsilon^{2}\expo{2\ic\theta}/2}}} \\[3mm]&=-\,{\pi \over 2}\,{1 \over \ln\pars{2}} + {\pi \over 2} \end{align}

$$\color{#66f}{\large% \int_{0}^{\pi/2}{\ln\pars{\cos x} \over x^{2} + \ln^{2}\pars{\cos\pars{x}}} \,\dd x = {\pi \over 2}\,\bracks{1 - {1 \over \ln\pars{2}}}} \approx {\tt -0.6953} $$

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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