3

I know the following way to do this integral by writing it as $$I=\int_0^\frac{\pi}{2}\ln(\cos(x))dx=\int_0^\frac{\pi}{2}\ln(\sin(x))dx$$ and then $$2I=\int_0^\frac{\pi}{2}\ln(\cos(x)\sin(x))dx$$ Afterwards, it can be converted to $$2I=\int_0^\frac{\pi}{2}\ln(\sin(2x))dx-\int_0^\frac{\pi}{2}\ln(2)dx$$ With substitution $2x=y$ $$2I=\frac{1}{2}\int_0^\pi\ln(\sin(y))dy-\int_0^\frac{\pi}{2}\ln(2)dx$$ $$\implies2I=\frac{1}{2}(2\int_0^\frac{\pi}{2}\ln(\sin(y))dy)-\int_0^\frac{\pi}{2}\ln(2)dx$$ The first integral can be written as $2I$ $$2I=\frac{1}{2}(2I)-\int_0^\frac{\pi}{2}\ln(2)dx$$ $$\implies I=-\int_0^\frac{\pi}{2}\ln(2)dx=-\frac{\pi}{2}\ln(2)$$ But, I want to know some other creative approaches to solve this integral, without using much advanced calculus. Also, please explain thought process behind your solution.

Quanto
  • 97,352

3 Answers3

11

\begin{align} \int_0^\frac{\pi}{2}\ln(\cos x)dx &=\int_0^\frac{\pi}{2}\ln(\sin x)dx \overset{ibp}=-\int_0^\frac{\pi}{2}\frac x{\tan x}dx\\ =&-\int_0^\frac{\pi}{2}\int_0^1 \frac 1{1+t^2\tan^2x}dtdx =-\frac\pi2\int_0^1\frac1{1+t}dt=-\frac\pi2\ln2 \end{align}

Quanto
  • 97,352
  • 1
    @Quanto-how did you come up with this solution(your thought process).? – Philosophical Nature Jul 24 '22 at 11:58
  • @PhilosophicalNature - unlike rule-based differentiation, integration is a backward process, which requires lots of trial and fail – Quanto Jul 24 '22 at 12:39
  • 1
    @PhilosophicalNature If you want a play-by-play: substitute $x\to\frac\pi2-x$; integrate by parts; write $x=\arctan(\tan(x))$ then convert $\arctan$ to an integral (the other answer does something similar with $\ln(1+u^2)$); swap the order of integration and wrap up. – user170231 Jul 25 '22 at 20:28
1

\begin{align}J&=\int_0^{\frac{\pi}{2}}\ln(\cos x)dx\\ &\overset{u=\tan x}=-\frac{1}{2}\int_0^\infty \frac{\ln(1+u^2)}{1+u^2}du\\ &=-\frac{1}{2}\int_0^1 \left(\int_0^\infty \frac{u^2}{(1+tu^2)(1+u^2)}du\right)dt\\ &=-\frac{1}{2}\int_0^1 \left[\frac{\arctan\left(u\sqrt{t}\right)}{(1-t)\sqrt{t}}-\frac{\arctan u}{1-t}\right]_{u=0}^\infty dt\\ &=-\frac{\pi}{4} \int_0^1 \left(\frac{1}{(1-t)\sqrt{t}}-\frac{1}{1-t}\right)dt\\ &=-\frac{\pi}{4} \int_0^1 \frac{1}{(1+\sqrt{t})\sqrt{t}}dt\\ &=-\frac{\pi}{4}\Big[2\ln\left(1+\sqrt{t}\right)\Big]_0^1\\ &=\boxed{-\frac{1}{2}\pi\ln 2} \end{align}

NB: For $0\leq z\leq 1$,$\displaystyle \ln(1+z)=\int_0^1 \frac{z}{1+tz}dt$

FDP
  • 13,647
0

$$\int_{0}^{\pi \over2}\ln(\cos(x))dx=\int_{0}^{\pi \over2}\ln\left({{e^{ix}+e^{-ix}}\over2}\right)dx$$

$$=\int_{0}^{\pi \over2}\ln\left({{e^{ix}+e^{-ix}}}\right)dx-\ln(2)\int_{0}^{\pi \over2}dx$$

$$=\int_{0}^{\pi \over2}\ln\left(e^{ix}({1+e^{-i2x}})\right)dx-{\pi\over2}\ln(2)$$

$$=\int_{0}^{\pi \over2}\ln\left({1+e^{-i2x}}\right)dx+i\int_{0}^{\pi \over2}xdx-{\pi\over2}\ln(2)$$

$\space\space\space\space$We will, of course, ignore any purely imaginary values that crop up which I will indicate with an arrow. Therefore, we have;

$$=\int_{0}^{\pi \over2}\ln\left({1+e^{-i2x}}\right)dx-{\pi\over2}\ln(2)$$

$$=-\sum_{n=0}^{\infty}{(-1)^n\over n}\int_{0}^{\pi \over2}(e^{-i2x})^ndx-{\pi\over2}\ln(2)$$

$$=i\sum_{n=0}^{\infty}{(-1)^n\over 2n^2}\int_{-in\pi}^{0}e^{u}du-{\pi\over2}\ln(2)$$

$$=i\sum_{n=0}^{\infty}{(-1)^{n}\over 2n^2}(-1+e^{-in\pi})-{\pi\over2}\ln(2) \rightarrow i\sum_{n=0}^{\infty}{(-1)^{n}\over 2n^2}e^{-in\pi}-{\pi\over2}\ln(2)$$

$$=i\sum_{n=0}^{\infty}{(-1)^{n} \cdot (\cos(n\pi)-i\sin(n\pi))\over 2n^2}-{\pi\over2}\ln(2) \rightarrow \sum_{n=0}^{\infty}{(-1)^{n} \cdot \sin(n\pi)\over 2n^2}-{\pi\over2}\ln(2)$$

We know that $\sin(n\pi)=0$ for all $n \in \mathbb{Z}$ which leaves us with our final answer...

$$\int_{0}^{\pi \over2}\ln(\cos(x))dx=-{\pi\over2}\ln(2)$$

Volk
  • 1,805