Evaluating integral using Riemann sums It is given that: $$\sin\frac{\pi }{n} \sin\frac{2\pi }{n}\cdots\sin\frac{(n-1)\pi }{n}=\frac{n}{2^{n-1}}$$
It is asked to use the above identity to evaluate the following improper integral:
$$\int_0^\pi  \log(\sin x) \, dx$$
I used the definition of the integral in terms of Riemann sums:
$$\begin{align*}\int_0^\pi \log(\sin x) \, dx
&=\lim_{n\rightarrow \infty }\frac{\pi }{n}\left[\sum_{k=1}^{k=n-1}\log\left(\sin\left(\frac{k\pi }{n}\right)\right)\right]\\
&=\lim_{n\rightarrow \infty }\frac{\pi }{n}\left[\log\left(\sin\frac{\pi }{n}\sin\frac{2\pi }{n}\cdots\sin\frac{(n-1)\pi }{n}\right)\right]\\
&=\lim_{n\rightarrow \infty }\frac{\pi }{n}\Big(\log n-(n-1)\log 2\Big)\\
&=-\pi \log 2
\end{align*}$$
However, this integral is improper, so $\log(\sin(\pi ))=\log(0)=-\infty $. I am kind of cheating in my solution, because the Riemann sum above should be:  $$\sum_{k=1}^{k=n-1}\log\left(\sin\left(\frac{k\pi }{n}\right)\right)+\frac{\pi }{n}\log\left(\sin\left(\frac{n\pi }{n}\right)\right)\;,$$ but I have no idea how to deal with the last term of the sum since $\sin\left(\frac{n\pi }{n}\right)=\sin(\pi)=0 $. 
Can anyone show me how to deal with this?
Also, if someone knows how to prove the first identity: $$\sin\frac{\pi }{n}\sin\frac{2\pi }{n}\cdots\sin\frac{(n-1)\pi }{n}=\frac{n}{2^{n-1}}$$
 please write down your proof below? Thanks
 A: As for the improper integral I have another approach which seems to me more obvious
$$
I=\int\limits_{0}^{\pi}\log(\sin(x))dx=
\int\limits_{0}^{\pi/2}\log(\sin(x))dx+\int\limits_{\pi/2}^{\pi}\log(\sin(x))dx=
$$
$$
\int\limits_{0}^{\pi/2}\log(\sin(x))dx+\int\limits_{0}^{\pi/2}\log(\cos(x))dx=
\int\limits_{0}^{\pi/2}\log\left(\frac{1}{2}\sin(2x)\right)dx=
$$
$$
\int\limits_{0}^{\pi/2}\log\left(\sin(2x)\right)dx-
\int\limits_{0}^{\pi/2}\log(2)dx=
\frac{1}{2}\int\limits_{0}^{\pi}\log(\sin(x))dx-
\int\limits_{0}^{\pi/2}\log(2)dx=
$$
$$
\frac{1}{2}I-\frac{\pi}{2}\log{2}
$$
Hence, $I=-\pi\log(2)$.
As for the last identity there is quite elementary solution. Denote $\xi=e^{\frac{i\pi}{n}}$ then
$$
\prod\limits_{k=1}^{n-1}\sin\frac{\pi k}{n}=
\prod\limits_{k=1}^{n-1}\frac{\xi^{k}-\xi^{-k}}{2i}=
\frac{1}{2^{n-1}}\frac{\xi^{-\frac{n(n-1)}{2}}}{i^{n-1}}\prod\limits_{k=1}^{n-1}(\xi^{2k}-1)
$$
If $n$ is even $\xi^{\frac{n(n-1)}{2}}=(\xi^{\frac{n}{2}})^{n-1}=i^{n-1}$. If $n$ is odd $\xi^{\frac{n(n-1)}{2}}=(\xi^n)^{\frac{n-1}{2}}=(-1)^{\frac{n-1}{2}}=(i^2)^{\frac{n-1}{2}}=i^{n-1}$. So in both cases
$$
\frac{\xi^{-\frac{n(n-1)}{2}}}{i^{n-1}}=(-1)^{n-1}
$$
Numbers $\{\xi^{2k}-1:k\in\{0,\ldots,n-1\}\}$ are roots of the equation $(x+1)^n=1$. After exapndig by binomial formula and canceling out $x$ we conclude that $\{\xi^{2k}-1:k\in\{1,\ldots,n-1\}\}$ are roots of the equation $x^n+nx^{n-1}+\ldots+n=0$. Then by Vieta's formulas we conclude
$$
\prod\limits_{k=1}^{n-1}(\xi^{2k}-1)=(-1)^{n-1}n
$$
Now we summarizee results and see
$$
\prod\limits_{k=1}^{n-1}\sin\frac{\pi k}{n}=\frac{n}{2^{n-1}}
$$
