Evaluate $\int_0^{\pi/2}\log\cos(x)\,\mathrm{d}x$ How can you evaluate $$\int\limits_0^{\pi/2}\log\cos(x)\,\mathrm{d}x\;?$$
 A: Here is an approach. Making the changes of variables $u=\cos x$ and $u^2=t$ in a row gives 

$$ I = \frac{1}{4}\int _{0}^{1}\!\,{\frac {\ln  \left( t \right) }{\sqrt {1-t}
\sqrt {t}}}{dt}
.$$

To evaluate the above integral, let's consider the following beta function 

$$ F = \int_{0}^{1} t^a (1-t)^b dt = \beta(a+1,b+1)=\frac{\Gamma(a+1)\Gamma(b+1)}{\Gamma(a+b+2)} .$$

Now, our integral follows from $F$ as

$$ I = \lim_{b\to -1/2}\lim_{a\to -1/2}F_a(a,b)=-\frac{\pi\ln 2}{2},\quad F_a =\frac{dF}{da}. $$

A: Here is another solution: As we have $\cos(x)=\frac{e^{ix}+e^{-ix}}{2}=\frac{e^{2ix}+1}{2e^{ix}}$ we get:
$$I=\int_0^{\frac{\pi}{2}} \ln(\cos(x))dx=\int_0^{\frac{\pi}{2}} \ln(e^{2ix}+1)dx-\int_0^{\frac{\pi}{2}} \ln(2)dx-\int_0^{\frac{\pi}{2}} ixdx$$
By using the series expansion of $\ln(x)$ and by calculating the two simple integrals we obtain:
$$I=\int_0^{\frac{\pi}{2}} \sum_{k=0}^\infty \frac{(-1)^k}{k+1}\cdot e^{2ix(k+1)}dx-\frac{\pi}{2}\cdot \ln(2)-i\frac{\pi^2}{8}$$
By swapping the integral and the sum, the integral of the infinite sum can be calculated as follows:
$$\int_0^{\frac{\pi}{2}} \sum_{k=0}^\infty \frac{(-1)^k}{k+1}\cdot e^{2ix(k+1)}dx=\sum_{k=0}^\infty \frac{(-1)^k}{k+1}\cdot \int_0^{\frac{\pi}{2}}e^{2ix(k+1)}dx=\sum_{k=0}^\infty \frac{(-1)^k}{k+1}\cdot \left(\frac{e^{i\pi(k+1)}-1}{2i(k+1)}\right)=\frac{i}{2}\cdot\sum_{k=0}^\infty \frac{(-1)^k}{k+1}\cdot \left(\frac{1-(-1)^{k+1}}{(k+1)}\right)$$
Here I used, that $\frac{1}{i}=-i$. Now, when $k$ is uneven, the expression after the sigma is equal to $0$, this yields:
$$\frac{i}{2}\cdot\sum_{k=0}^\infty \frac{(-1)^k}{k+1}\cdot \left(\frac{1-(-1)^{k+1}}{(k+1)}\right)=\frac{i}{2}\cdot\sum_{k=0}^\infty \frac{2\cdot(-1)^{2k}}{(2k+1)^2}=i\cdot\sum_{k=0}^\infty \frac{1}{(2k+1)^2}=i\cdot\left(\sum_{k=1}^\infty \frac{1}{k^2}-\sum_{k=1}^\infty \frac{1}{(2k)^2}\right)=i\cdot\frac{3}{4}\cdot\zeta(2)=i\frac{\pi^2}{8}$$
Therefore, $I$ can be expressed as follows:
$$I=i\frac{\pi^2}{8}-\frac{\pi}{2}\cdot \ln(2)-i\frac{\pi^2}{8}=-\frac{\pi}{2}\cdot \ln(2)$$
A: For the sake of simplicity, all the integral variables I use are $x$ even there are a lot of substitutions. Because lots of variables could make one confused. 
Let $I$ denote the integral value. By substitute $x$ for $\pi/2-x$, we have:
\begin{equation}
I=\int_0^{\frac{\pi}{2}}\log\cos(x)dx=\int_0^{\frac{\pi}{2}}\log\sin(x)dx
\end{equation}
And then, we have:
\begin{equation}
I=\int_0^{\frac{\pi}{2}}\log(2\cos(\frac{x}{2})\sin(\frac{x}{2}))dx\\
=\frac{\pi}{2}\log2+\int_0^{\frac{\pi}{2}}\log\cos(\frac{x}{2})dx+\int_0^{\frac{\pi}{2}}\log\sin(\frac{x}{2})dx\\
=\frac{\pi}{2}\log2+2\int_0^{\frac{\pi}{4}}\log\cos(x)dx+2\int_0^{\frac{\pi}{4}}\log\sin(x)dx\\
=\frac{\pi}{2}\log2+I_1+I_2
\end{equation}
In the second step from bottom, I use the substitution that $x=x/2$.
For $I_1$, use the substitution that $x=\pi/2-x$ we obtain
\begin{equation}
I_1=2\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}\log\sin(x)dx
\end{equation}
It gives that $I_1+I_2=2I$. So we have
\begin{equation}
I=\frac{\pi}{2}\log2+2I\\
I=-\frac{\pi}{2}\log2
\end{equation}
A: Here is a hint:


*

*Let $\displaystyle I = \int_{x=0}^{\pi/2} \log \cos x \, dx$.

*By choosing a suitable substitution, show  we also have $\displaystyle I = \int_{x=0}^{\pi/2} \log \sin x \, dx$.

*Using a symmetry argument, also show that $\displaystyle I = \int_{x=\pi/2}^\pi \log \sin x \, dx$.

*Add the results of (1) and (2) together to get an expression for $2I$.

*Transform the integrand using properties of logarithms and a double-angle identity.

*Use (3) to rewrite the result of (5) in terms of $I$ in a second way.

*Solve for $I$.

A: $$
\int_0^{\pi/2} \ln \cos xdx =I=\int_0^{\pi/2} \ln \sin x dx.
$$
By symmetry we have $\ln \cos x=\ln \sin x$ on the interval $[0,\pi/2]$.  This is true for any even/odd function on this interval, as is an exercise in Demidovich-Problems in Analysis.
Thus we have
$$
2I=\int_0^{\pi/2}\ln \cos x dx+ \int_0^{\pi/2} \ln \sin x dx= \int_0^{\pi/2} \ln(\sin x \cos x)dx=\int_0^{\pi/2} \ln\big(\frac{1}{2}\cdot\sin(2x)\big) dx.
$$
All I used was $\ln(a\cdot b)=\ln(a)+\ln(b)$ and $2\sin x \cos x=\sin(2x)$.  Now we split the integral back up to obtain
$$
-\int_0^{\pi/2}\ln(2)dx+\int_0^{\pi/2}\ln(\sin(2x))dx=2I.
$$
Thus we can now substitute $u=2x$ to obtain
$$
-\frac{\pi\ln(2)}{2}+\frac{1}{2}\int_0^\pi \ln \sin (u) du=2I
$$
But the integral of $\ln \sin u$ is 2I, thus we have
$$
-\frac{\pi\ln(2)}{2}+I=2I, \ \to {\boxed{I=-\frac{\pi \ln(2)}{2}.}}
$$
A: How comes I forgot to write my favorite proof?
We have a well-known identity:
$$\prod_{k=1}^{n-1}\sin\left(\frac{\pi k}{n}\right)=\frac{2n}{2^n}\tag{1}$$
and since $\log\sin x$ is an improperly Riemann-integrable function over $(0,\pi)$, it follows that:
$$ \int_{0}^{\pi}\log\sin\theta\,d\theta = \lim_{n\to +\infty}\frac{\pi}{n}\sum_{k=1}^{n-1}\log\sin\left(\frac{\pi k}{n}\right)=-\pi\log 2,\tag{2}$$
so:
$$ \int_{0}^{\pi/2}\log\cos\theta\,d\theta = \int_{0}^{\pi/2}\log\sin\theta\,d\theta = \color{red}{-\frac{\pi}{2}\log 2}.\tag{3}$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[#ffd,5px]{\int_{0}^{\pi/2}\ln\pars{\cos\pars{x}}\,\dd x} =
-\,{1 \over 2}\int_{0}^{\pi/2}\ln\pars{1 + \tan^{2}\pars{x}}\,\dd x
\\[5mm] \stackrel{\tan^{2}\pars{x}\ \mapsto\ x}{=}\,\,\,&
-\,{1 \over 4}\int_{0}^{\infty}x^{-1/2}
\,{\ln\pars{1 + x} \over 1 + x}\,\dd x
\end{align}
Note that $\ds{{\ln\pars{1 + x} \over 1 + x} =
-\sum_{k = 0}^{\infty}H_{k}\pars{-x}^{k} =
\sum_{k = 0}^{\infty}\bracks{-H_{k}\,\Gamma\pars{1 + k}}
{\pars{-x}^{k} \over k!}}$. $\ds{H\ \mbox{and}\ \Gamma}$ are the
Harmonic Number and the Gamma Function, respectively.
With the
Ramanujan's Master Theorem:
\begin{align}
&\bbox[#ffd,5px]{\int_{0}^{\pi/2}\ln\pars{\cos\pars{x}}\,\dd x} =
-\,{1 \over 4}\int_{0}^{\infty}x^{\color{red}{1/2} - 1}
\,{\ln\pars{1 + x} \over 1 + x}\,\dd x
\\[5mm] = &\
-\,{1 \over 4}\
\overbrace{\Gamma\pars{1 \over 2}}^{\ds{\root{\pi}}}\
\braces{-H_{-\color{red}{1/2}}
\,\Gamma\pars{1 - \bracks{\color{red}{1 \over 2}}}}
\\[2mm] = &\
{1 \over 4}\,\pi\
\overbrace{\int_{0}^{1}{1 - t^{-1/2} \over 1 - t}
\,\dd t}^{\ds{H_{-1/2}}}
\,\,\,\stackrel{\large t\ \mapsto\ t^{2}}{=}\,\,\,
{1 \over 4}\,\pi
\int_{0}^{1}{1 - t^{-1} \over 1 - t^{2}}\,2t\,\dd t
\\[5mm] = &\
-\,{1 \over 2}\,\pi
\int_{0}^{1}{\dd t \over 1 + t} =
\bbx{-\,{1 \over 2}\,\pi\ln\pars{2}} \\ &
\end{align}
A: \begin{align}\int_0^{\pi/2}\ln\cos x\ dx\overset{ibp}=&-\int_0^{\pi/2}\frac x{\tan x}dx 
=-\int_0^{\pi/2}\int_0^1 \frac1{1+y^2\tan^2 x}dy \ dx\\
=&-\frac\pi2\int_0^1\frac1{1+y}dy=-\frac\pi2\ln2
\end{align}
A: I first treat the integral as a derivative of a beta function
$$
I(a)=\int_0^{\frac{\pi}{2}} \cos ^a x d x=\frac{1}{2} B\left(\frac{a+1}{2}, \frac{1}{2}\right)
$$
$$
\begin{aligned}
I&\left.=\frac{\partial}{\partial a} I(a)\right|_{a=0} \left.=\left.\frac{1}{4} B\left(\frac{a+1}{2}, \frac{1}{2}\right)\left(\psi\left(\frac{a+1}{2}\right)-\psi\left(\frac{a}{2}+1\right)\right)\right) \right|_{a=0}\\
&=\frac{1}{4} B\left(\frac{1}{2}, \frac{1}{2}\right)\left[\psi\left(\frac{1}{2}\right)-\psi(1)\right]=\frac{1}{4} \pi(-\ln 4) =-\frac{\pi}{2} \ln 2 
\end{aligned}
$$
