# How can you evaluate \int_0^{\pi/2}\log\cos(x)dx ?

How can you evaluate
${\int }_{0}^{\frac{\pi }{2}}\mathrm{log}\mathrm{cos}\left(x\right)dx$ ?
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Kirsten Davis
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 $\frac{\pi }{2}-x$, we have:
$I={\int }_{0}^{\frac{\pi }{2}}\mathrm{log}\mathrm{cos}\left(x\right)dx={\int }_{0}^{\frac{\pi }{2}}\mathrm{log}\mathrm{sin}\left(x\right)dx$
And then, we have:
$I={\int }_{0}^{\frac{\pi }{2}}\mathrm{log}\left(2\mathrm{cos}\left(\frac{x}{2}\right)\mathrm{sin}\left(\frac{x}{2}\right)\right)dx$
$=\frac{\pi }{2}\mathrm{log}2+{\int }_{0}^{\frac{\pi }{2}}\mathrm{log}\mathrm{cos}\left(\frac{x}{2}\right)dx+{\int }_{0}^{\frac{\pi }{2}}\mathrm{log}\mathrm{sin}\left(\frac{x}{2}\right)dx$
$=\frac{\pi }{2}+2{\int }_{0}^{\frac{\pi }{4}}\mathrm{log}\mathrm{cos}\left(x\right)dx+2{\int }_{0}^{\frac{\pi }{4}}+2{\int }_{0}^{\frac{\pi }{4}}\mathrm{log}\mathrm{sin}\left(x\right)dx$
$=\frac{\pi }{2}\mathrm{log}2+{I}_{1}+{I}_{2}$
In the second step from bottom, I use the substitution that $x=\frac{x}{2}$
For ${I}_{1}$, use the substitution that $x=\frac{\pi }{2}-x$ we obtain
${I}_{1}=2{\int }_{\frac{\pi }{4}}^{\frac{\pi }{2}}\mathrm{log}\mathrm{sin}\left(x\right)dx$
It gives that ${I}_{1}+{I}_{2}=2I$. So we have
$I=\frac{\pi }{2}\mathrm{log}2+2I$
$I=-\frac{\pi }{2}\mathrm{log}2$
###### Not exactly what you’re looking for?
Shawn Kim
${\int }_{0}^{\frac{\pi }{2}}\mathrm{ln}\mathrm{cos}xdx=I={\int }_{0}^{\frac{\pi }{2}}\mathrm{ln}\mathrm{sin}xdx$
By symmetry we have $\mathrm{ln}\mathrm{cos}x=\mathrm{ln}\mathrm{sin}x$ on the interval $\left[0,\pi .2\right]$. 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}^{\frac{\pi }{2}}\mathrm{ln}\mathrm{cos}xdx+{\int }_{0}^{\frac{\pi }{2}}\mathrm{ln}\mathrm{sin}xdx={\int }_{0}^{\frac{\pi }{2}\mathrm{ln}\left(\mathrm{sin}x\mathrm{cos}x\right)dx={\int }_{0}^{\frac{\pi }{2}}\mathrm{ln}\left(\frac{1}{2}\cdot \mathrm{sin}\left(2x\right)\right)dx}$
All I used was $\mathrm{ln}\left(a\cdot b\right)=\mathrm{ln}\left(a\right)+\mathrm{ln}\left(b\right)$ and $2\mathrm{sin}x\mathrm{cos}x=\mathrm{sin}\left(2x\right)$. Now we split the integral back up to obtain
$-{\int }_{0}^{\frac{\pi }{2}}\mathrm{ln}\left(2\right)dx+{\int }_{0}^{\frac{\pi }{2}}\mathrm{ln}\left(\mathrm{sin}\left(2x\right)\right)dx=2I$
But the integral of $\mathrm{ln}\mathrm{sin}u$ is $2I$, thus we have
$-\frac{\pi \mathrm{ln}\left(2\right)}{2}+I=2I\to I=-\frac{\pi \mathrm{ln}\left(2\right)}{2}$
###### Not exactly what you’re looking for?
Vasquez

We have a well-known identity:
$\prod _{k=1}^{n-1}\mathrm{sin}\left(\frac{\pi k}{n}\right)=\frac{2n}{{2}^{n}}$
and since $\mathrm{log}\mathrm{sin}x$ is an improperly Riemann-integrable function over $\left(0,\pi \right)$, it follows that:
${\int }_{0}^{\pi }\mathrm{log}\mathrm{sin}\theta d\theta =\underset{n\to +\mathrm{\infty }}{lim}\frac{\pi }{n}\sum _{k=1}^{n-1}\mathrm{log}\mathrm{sin}\left(\frac{\pi k}{n}\right)=-\pi \mathrm{log}2$
so:
${\int }_{0}^{\pi /2}\mathrm{log}\mathrm{sin}\theta d\theta ={\int }_{0}^{\pi /2}\mathrm{log}\mathrm{sin}\theta d\theta =-\frac{\pi }{2}\mathrm{log}2$