25
$\begingroup$

It's my first post here and I was wondering if someone could help me with evaluating the definite integral $ \int_0^{\Large\frac{\pi}{4}} \log\left( \cos x\right) \, \mathrm{d}x $ Thanks in advance, any help would be appreciated.

  • 0
    @Souvik : You mean 'evaluating'.2012-09-19

4 Answers 4

22

Write $\log(\cos(x))=\log\left(\frac12 e^{ix}(1+e^{-2ix})\right)\\ =-\log 2 + ix +\sum_{k=1}^\infty\frac{(-1)^{k+1}}{k}e^{-2ikx}.$ Then integrate term by term to obtain $\int_0^{\pi/4}\log(\cos(x))dx=-\frac{\pi}{4}\log 2 +i\frac{\pi^2}{32}+\frac{i}{2}\sum_{k=1}^\infty\frac{(-1)^{k+1}}{k^2}\left[e^{-ik\pi/2}-1\right].$ The odd terms of the series with $e^{-ik\pi/2}$ give rise to the Catalan constant, and the even terms combine with the other infinite series to cancel the $i\pi^2/32$ term.

22

Let $ I=\int_0^{\Large\frac\pi4}\ln(\sin x)\ dx\qquad\text{and}\qquad J=\int_0^{\Large\frac\pi4}\ln(\cos x)\ dx $ then \begin{align} I+J&=\int_0^{\Large\frac\pi4}\ln(\sin x\cos x)\ dx\\ &=\int_0^{\Large\frac\pi4}\ln\left(\frac12\sin 2x\right)\ dx\\ &=\int_0^{\Large\frac\pi4}\ln(\sin 2x)\ dx-\int_0^{\Large\frac\pi4}\ln2\ dx\\ &=\frac12\int_0^{\Large\frac\pi2}\ln(\sin y)\ dy-\frac\pi4\ln2\qquad\color{red}{\Rightarrow}\qquad \text{set}\ y=2x\\ &=-\frac\pi2\ln2 \end{align} and \begin{align} I-J&=\int_0^{\Large\frac\pi4}\ln\left(\frac{\sin x}{\cos x}\right)\ dx\\ &=\int_0^{\Large\frac\pi4}\ln\left(\tan x\right)\ dx\\ &=\int_0^{1}\frac{\ln t}{1+t^2}\ dt\qquad\color{red}{\Rightarrow}\qquad \text{set}\ t=\tan x\\ &=\int_0^{1}\sum_{n=1}^\infty(-1)^n t^{2n}\ln t\ dt\\ &=\sum_{n=1}^\infty(-1)^n\int_0^{1} t^{2n}\ln t\ dt\\ &=-\sum_{n=1}^\infty\frac{(-1)^n}{(2n+1)^2}\\ &=-G, \end{align} where $G$ is Catalan's constant. Therefore $ I=\int_0^{\Large\frac\pi4}\ln(\sin x)\ dx=-\frac12\left(G+\frac\pi2\ln2\right) $ and $ J=\int_0^{\Large\frac\pi4}\ln(\cos x)\ dx=\frac12\left(G-\frac\pi2\ln2\right). $


References :

$[1]\ \ \displaystyle\int_0^{\Large\frac\pi2}\ln(\sin y)\ dy=\int_0^{\Large\frac\pi2}\ln(\cos y)\ dy=-\frac\pi2\ln2$

$[2]\ \ \displaystyle\int_0^1 x^\alpha \ln^k x\ dx=\frac{(-1)^k k!}{(\alpha+1)^{k+1}}, \qquad\text{for }\ k=0,1,2,\ldots$

  • 0
    very very very nice! (+1)2018-11-11
7

$\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{\ds}[1]{\displaystyle{#1}} \newcommand{\dsc}[1]{\displaystyle{\color{red}{#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{\Li}[1]{\,{\rm Li}_{#1}} \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert} \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}$

\begin{align}&\color{#66f}{\large\int_{0}^{\pi/4}\ln\pars{\cos\pars{x}}\,\dd x} = \int_{-\pi/2}^{-\pi/4}\ln\pars{-\sin\pars{x}}\,\dd x = \int_{\pi/4}^{\pi/2}\ln\pars{\sin\pars{x}}\,\dd x \\[5mm]&=\int_{\pi/4}^{\pi/2}\overbrace{\bracks{% -\ln\pars{2} - \sum_{k\ =\ 1}^{\infty}{\cos\pars{2kx} \over k}}}^{\dsc{\ln\pars{\sin\pars{x}}}}\,\dd x =-\,{1 \over 4}\,\pi\ln\pars{2} -\sum_{k\ =\ 1}^{\infty}{1 \over k}\int_{\pi/4}^{\pi/2}\cos\pars{2kx}\,\dd x \\[5mm]&=-\,{1 \over 4}\,\pi\ln\pars{2} -\sum_{k\ =\ 1}^{\infty}{1 \over k}{\sin\pars{k\pi} - \sin\pars{k\pi/2} \over 2k} =-\,{1 \over 4}\,\pi\ln\pars{2} +\half\sum_{k\ =\ 1}^{\infty}{\sin\pars{k\pi/2} \over k^{2}} \\[5mm]&=-\,{1 \over 4}\,\pi\ln\pars{2} +\half\sum_{k\ =\ 0}^{\infty}{\sin\pars{k\pi + \pi/2} \over \pars{2k + 1}^{2}} =-\,{1 \over 4}\,\pi\ln\pars{2} +\half\ \underbrace{\sum_{k\ =\ 0}^{\infty}{\pars{-1}^{k} \over \pars{2k + 1}^{2}}} _{\ds{\mbox{Catalan Constant}\ \dsc{G}}} \\[5mm]&=\color{#66f}{\large-\,{1 \over 4}\,\pi\ln\pars{2} + \half\,G} \end{align}

  • 0
    Wait never-mind I feel like an idiot. $\forall k\in\Bbb Z, \sin(\pi k)=0$2018-11-11
0

The integral: $S=\int_0^\frac{\pi}{4}\log(\cos(x))dx=\frac{1}{4}(2C-\pi \log 2)$ where $C$ is the Catalan constant.

  • 0
    @ Riccardo: This helps us to find the part with $\pi log(2)$ but how do you find the Catalan constant with that ?2012-09-19