TITLE: Closed form of: $\displaystyle \int_0^{\pi/2}x^{n}\ln{(\sin x)}dx $
QUESTION [6 upvotes]: $\displaystyle \int_0^{\pi/2}x^{n}\ln{(\sin x)}dx $
Does a closed form of the above integral exists?
$n$ is a positive integer

REPLY [4 votes]: I want to add a proof which uses complex analysis:
First observe that our integral can be split as follows:
$$
I_n=-\underbrace{\int_0^{\pi/2}dx\left(ix^{n+1}+\log(\frac{1}{2i})x^n\right)}_{A_n}+\underbrace{\int_0^{\pi/2}dxx^n\log(1-e^{-2ix})}_{B_n}
$$
The first part is trivial and yields $A_n=\log(\frac{1}{2i})\frac{x^{n+1}}{n+1}+i\frac{x^{n+2}}{n+2}$+
To calculate $B_n$,
define the complex valued function 
$$
f(z)=\log(1-e^{2z})
$$
Now we integrate this function over a rectangle in the complex plane with vertices $\{0,\frac{\pi}{2},\frac{\pi}{2}-iR,-iR\}$
Because $f(z)$ is analytic in the chosen domain, the contour integral yields zero (Note that we have taken the limit $R\rightarrow\infty$,where the upper vertical line vanishs) 
$$
\oint f(z)=\underbrace{\int_0^{\pi/2}dxx^n\log(1-e^{-2ix})}_{B_n}+i\underbrace{\int_0^{\infty}dy(\frac{\pi}{2}-iy)^n\log(1+e^{-2y})}_{K_n}+i\underbrace{\int_0^{\infty}dy(-iy)^n\log(1-e^{-2y})}_{J_n}=0
$$
$K_n$ and $J_n$ are now straightforwardly calculated by using the Taylor expansion  of $\log(1+z)$ and the binomial theorem
$$
K_n=\int_0^{\infty}dy(\frac{\pi}{2}-iy)^n\log(1+e^{-2y})=\sum_{k=1}^n\binom{n}{k}\left(\frac{\pi}{2}\right)^{n-k}(-i)^k\int_0^{\infty}dy\sum_{q=1}^{\infty}(-1)^{q+1}\frac{y^ke^{-2yq}}{q}=\\ 
\sum_{k=0}^n\binom{n}{k}\left(\frac{\pi}{2}\right)^{n-k}(-i)^k\frac{k!}{2^{k+1}}\sum_{q=1}^{\infty}\frac{(-1)^{q+1}}{q^{k+2}}=\\
\sum_{k=0}^n\binom{n}{k}\left(\frac{\pi}{2}\right)^{n-k}(-i)^k\frac{k!}{2^{k+2}}\left(1-\frac{1}{2^{k+1}}\right)\zeta(k+2)
$$
by the same technique 
$$
J_n=\int_0^{\infty}dy(-iy)^n\log(1+e^{-2y})=(-i)^n \frac{n!}{2^{n+2}} \zeta(n+2)
$$
yielding:

$$
I_n=B_n+A_n=J_n+K_n+A_n=\\
(-i)^{n+1} \frac{n!}{2^{n+1}} \zeta(n+2)+\sum_{k=0}^n\binom{n}{k}\left(\frac{\pi}{2}\right)^{n-k}(-i)^{k+1}\frac{k!}{2^{k+2}}\left(1-\frac{1}{2^{k+1}}\right)\zeta(k+2)\\
-i\frac{\pi^{n+2}}{2^{n+2}}\frac{2n+1}{(n+2)(n+1)}-\log(2)\frac{\pi^{n+1}}{2^{n+1}}
$$

Please note, that the imaginary part of the right hand side has to be zero (because our integral is real), which gives us a disturbing summation formula:

$$
\Im\left[\sum_{k=0}^n\binom{n}{k}\left(\frac{\pi}{2}\right)^{n-k}(-i)^{k+1}\frac{k!}{2^{k+2}}\left(1-\frac{1}{2^{k+1}}\right)\zeta(k+2)\right]=\\ (-1)^{n} \frac{n!}{2^{n+2}} \zeta(n+1)\delta_{n+1,2j}+\frac{\pi^{n+2}}{2^{n+2}}\frac{2n+1}{(n+2)(n+1)}
$$