Integral $\int\cos (2nx)\,\log \sin(x)\; dx $ Please help me out wrt this question - 
$$\int_0^\frac{\pi}2  \cos (2nx)\;  \log \sin(x)\; dx = -\frac  {\pi}{4n}$$
Here $n>1$.
I tried doing integration by parts but then how to calculate
$$\int_0^\frac{\pi}2  \cot (x) \,\sin (2nx)\, dx $$
The question is given under Improper Integrals. 
Thank you in advance. I really need to sort this out
 A: A different approach.
By integrating by parts, one has
$$
\begin{align}
\int_0^{\Large \frac{\pi}2}  \cos (2nx)  \log \sin (x)\; dx&=\left[ \frac{\sin (2nx)}{2n}\cdot  \log \sin (x)\right]_0^{\Large \frac{\pi}2} -\frac{1}{2n}\int_0^{\Large \frac{\pi}2}  \sin (2nx)\: \frac{\cos (x)}{\sin (x)}\; dx
\\&=\color{red}{0}-\frac{1}{2n}\int_0^{\Large \frac{\pi}2}  \sin (2nx)\: \frac{\cos (x)}{\sin (x)}\; dx. \tag1
\end{align}
$$Let
$$
u_n:=\int_0^{\Large \frac{\pi}2}  \sin (2nx)\: \frac{\cos (x)}{\sin (x)}\; dx,\quad n\ge1.
$$ One may observe that, for $n\ge1$,
$$
\begin{align}
u_{n+1}-u_n&=\int_0^{\Large \frac{\pi}2}  \left[\frac{}{}\sin (2nx+2x)-\sin(2nx)\right]\cdot \frac{\cos (x)}{\sin (x)}\; dx
\\&=\int_0^{\Large \frac{\pi}2}  \left[2\frac{}{}\sin (x)\cdot \cos(2nx+x)\right]\cdot \frac{\cos (x)}{\sin (x)}\; dx\quad \left({\small{\color{blue}{\sin p-\sin q=2 \sin \frac{p-q}{2}\cdot \cos \frac{p+q}{2}}}}\right)
\\&=\int_0^{\Large \frac{\pi}2} 2\cdot\cos(2nx+x)\cdot \cos (x)\; dx
\\&=\int_0^{\Large \frac{\pi}2} \left[\frac{}{}\cos(2nx+2x)+\cos(2nx)\right] dx\qquad \quad \left({\small{\color{blue}{2\cos a \cos b= \cos (a+b)+ \cos (a-b)}}}\right)
\\\\&=\color{red}{0}  \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \left({\small{\color{blue}{\sin(m\cdot \pi)=0,\, m=0,1,2,\cdots }}}\right)
\end{align}
$$ giving
$$
u_{n+1}=u_n=\cdots=u_1=2\int_0^{\Large \frac{\pi}2}  \cos^2 (x)\; dx=\frac \pi2, \tag2
$$ then inserting $(2)$ in $(1)$ yields

$$
\int_0^{\Large \frac{\pi}2}  \cos (2nx)  \log \sin (x)\; dx=-\frac  {\pi}{4n},\qquad n\ge1
$$ 

as wanted.
A: Here is an approach.
Hint. One may observe that, for $x \in \left(0,\frac \pi2\right)$,
$$
\begin{align}
\log \left(\cos x \right)&=\text{Re}\log \left(\frac{e^{ix}+e^{-ix}}{2}\right)
\\\\&=\text{Re}\left(ix+\log \left(1+e^{-2ix}\right)-\log 2\right)
\\\\&=-\log 2+\text{Re}\left(\log \left(1+e^{-2ix}\right)\right)
\\\\&=-\log 2+\text{Re}\sum_{n=1}^\infty \frac{(-1)^{n+1} }n e^{-2nix}
\\\\&=-\log 2+\text{Re}\sum_{n=1}^\infty \frac{(-1)^{n+1}}n \left(\cos (2nx)-i\sin(2nx)\right)
\\\\&=-\log 2+\sum_{n=1}^\infty \frac{(-1)^{n+1} }n \:\cos (2nx)
\end{align}
$$ then by the uniqueness of the coefficent of a Fourier series one deduce
$$
\frac 2\pi\int_0^{\Large \frac{\pi}2}  \cos (2nx)  \log \cos (x)\; dx = \frac  {(-1)^{n+1}}{2n},\qquad n\ge1.
$$ By the change of variable $u=\dfrac \pi2-x\,,$  $x=\dfrac \pi2-u\,,$ $du=-dx$, giving 
$$
\begin{align} 
&\cos (x)  = \sin (u),
\\
&\cos (2nx) = \cos \left(2n \cdot \frac \pi2- 2n \cdot u \right)=\cos (n \pi-2nu)=(-1)^n \cos (2nu)
\end{align}
$$ one gets

$$
\int_0^{\Large \frac{\pi}2}  \cos (2nu)  \log \sin (u)\; du =(-1)^n\int_0^{\Large \frac{\pi}2}  \cos (2nx)  \log \cos(x)\; dx=-\frac  {\pi}{4n},\qquad n\ge1,
$$ 

as announced.
