# calculate of $\int_0^\pi \ln\cos x~dx$

I am trying to calculate this integral.I only know that i should use the symmetry of the integrand.what can we do? $$\int_0^\pi \ln\cos x~dx$$

thank you for hint.

-
$\cos x < 0$ for $\frac{\pi}{2} < x \leqslant \pi$. How should that be dealt with? – Daniel Fischer Jun 9 '14 at 18:47
In this site ( M.SE ), it was calculated several times over $\displaystyle\large\left(0,{\pi \over 2}\right)$. – Felix Marin Jun 9 '14 at 18:49

$$I = \int_{0}^\pi \ln\cos x~dx = -\dfrac{\pi\cdot \ln2}{2} + \int_{\pi/2}^{\pi} \ln\cos x~dx = -\frac{\pi\cdot \ln 2}{2} + J$$ Then let $u = x - \pi/2$.So: $\ln\cos x = \ln\sin u$,and: $J = \displaystyle \int_0^{\pi/2} \ln\sin u~du = -\dfrac{\pi\cdot \ln2}{2}$. Thus: $I = -\pi\cdot \ln2$

-
$\cos (u+\pi/2) = -\sin u$. – Daniel Fischer Jun 9 '14 at 19:08
If you had to use \text{sin} then \text{sin}\,x rather than \text{sinx} (with the variable $x$ thus de-italicized and without proper spacing) would be the thing to do. But \ln\sin x gives you $\ln\sin x$, with automatic spacing before and after $\sin$ and "sin" without italics. That is standard usage. I've done some editing. – Michael Hardy Jun 9 '14 at 19:08
yes, thanks of you – Ali Qurbani Jun 9 '14 at 19:11
But you are taking the log of a negative number over $\frac{\pi}{2}$ to $\pi$. So the integral is not defined. – Rene Schipperus Jun 9 '14 at 19:14
$\displaystyle\large x \in \left({\pi \over 2},\pi\right)$ leads to $\displaystyle\large\cos\left(x\right) < 0$ !!!!!!!!!!!!!!!!!... – Felix Marin Jun 9 '14 at 19:24

Ok well I think that integral should be

$$I=\int_0^{\Large\frac{\pi}{2}} \ln \cos x\ dx$$ because $\cos x$ is negative over $\frac{\pi}{2}$ to $\pi$. Note that we can make the transform $x=\dfrac{\pi}{2}-y$ to see that $$I=\int_0^{\Large\frac{\pi}{2}} \ln \sin x\ dx$$ to evaluate this last we set $x=2z$ to get

$$I=2\int_0^{\Large\frac{\pi}{4}} \ln \sin (2z)\ dz=\frac{\pi}{2}\ln 2 + 2\int_0^{\Large\frac{\pi}{4}} \ln \cos (z)\ dz+ 2\int_0^{\Large\frac{\pi}{4}} \ln \sin (z)\ dz$$ and by the same substitution as at the beginning, $$\int_0^{\Large\frac{\pi}{4}} \ln \cos (z)\ dz=\int_{\Large\frac{\pi}{4}}^{\Large\frac{\pi}{2}} \ln \sin (z)\ dz$$

So

$$I=\frac{\pi}{2}\ln 2 + 2\int_{\Large\frac{\pi}{4}}^{\Large\frac{\pi}{2}} \ln \sin (z)\ dz+ 2\int_0^{\Large\frac{\pi}{4}} \ln \sin (z)\ dz$$ Thus $$I=\frac{\pi}{2}\ln 2 +2I$$ and $$I=-\frac{\pi}{2}\ln 2$$

If you then insist of integrating over $0$ to $\pi$ you get $-\pi \ln 2 +\dfrac{\pi}{2} \ln (-1)$

-