# 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

-
When you write something like log in $\TeX$, it gets interpreted as juxtaposed variable names and is therefore italicized. To get proper formatting for function names, you need to use the corresponding command sequences, e.g. \log. If you have a function name for which there's no command sequence, such as $\operatorname{tr}$, you can get it formatted properly using \operatorname{tr}. –  joriki Apr 11 '12 at 21:30
I think the integrals goes from $\frac{\pi }{n}$ to $\frac{n\pi}{n}$. I think you either ignore left endpoint or the right endpoint, but you can't ignore both of them. The Rieamann sum is the limit of the areas of the rectangles when the mesh goes to zero, and by ignoring the right endpoint, you are sort of ignoring the area of the last rectangle. Am I wrong? –  Boyan Klo Apr 11 '12 at 21:37
It's not only italicization, it's proper spacing and in some cases positioning of subscripts and superscripts. For example $\displaystyle a \lim_{x\to\infty} b$. Note the spacing before and after "$\lim$" and notice where the subscript is. –  Michael Hardy Apr 11 '12 at 21:37
@joriki, now is valid to do $\newcommand{\tr}{\operatorname{tr}}$ so that you can use \tr later in your post. –  leo Apr 11 '12 at 23:41

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}}$$