Other approaches to integrate $\int_0^\frac{\pi}{2}\ln(\cos x)dx$ 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.
 A: \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}
A: \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$
A: $$\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)$$
