Definite integral of log(sin x) I am solving this question -
$\int_0^{\frac{\pi}{2}} log(\sin x)dx$
But I am unable to solve. Then I see this link.
In George Lowther answer. I understand how he reached to 
$\frac12\int_0^{\pi/2}\log(\sin x\cos x)\,dx$
But I am unable to understand next step. And how this leads to an answer. 
 A: $\newcommand{\bbx}[1]{\,\bbox[8px,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}$

With $\ds{\quad\ln\pars{z} = \ln\pars{\verts{z}} + \,\mrm{arg}\pars{z}\ic\,;\quad
-\pi < \,\mrm{arg}\pars{z} < \pi\,,\quad z \not= 0}$ and the following contour
  $\ds{\pars{~\mbox{where}\ \bbox[#dfd,5px,border:1px groove navy]{R = 1}~}}$


we'll have
\begin{align}
&\int_{0}^{\pi/2}\ln\pars{\sin\pars{x}}\,\dd x =
\left.\Re\int_{0}^{\pi/2}\ln\pars{z - 1/z \over 2\ic z}\,{\dd z \over \ic z}\,
\right\vert_{\ z\ =\ \exp\pars{\ic x}}
\\[5mm] = &\
\left.\Im\int_{0}^{\pi/2}\ln\pars{{1 - z^{2} \over 2z}\,\ic}\,{\dd z \over z}\,
\right\vert_{\ z\ =\ \exp\pars{\ic x}}
\\[1cm] \stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\sim} &\,\,\,
\overbrace{-\Im\int_{1}^{\epsilon}\ln\pars{1 + y^{2} \over 2y}\,{\dd y \over y}}
^{\ds{=\ 0}}\ -\
\Im\int_{\pi/2}^{0}\ln\pars{{1 \over 2\epsilon}\,
\exp\pars{\ic\bracks{{\pi \over 2} - \theta}}}\,\ic\,\dd\theta
\\[5mm] - &\
\Im\int_{\epsilon}^{1}\bracks{%
\ln\pars{1 - x^{2} \over 2x} + {\pi \over 2}\,\ic}\,{\dd x \over x}
\\[1cm] = &\
-\,{1 \over 2}\,\pi\ln\pars{2\epsilon} + {1 \over 2}\,\pi\ln\pars{\epsilon} =
\bbx{\ds{-\,{1 \over 2}\,\pi\ln\pars{2}}}
\end{align}
