Find $\int_0^\pi \sin(x)\,dx$ explicitly A book asks me to prove that:
$$\int_0^{\pi}\sin(x)\,dx = 2$$
Using the identity:
$$\sin\left(\frac{\pi}{n}\right) + \sin\left(\frac{2\pi}{n}\right) + \cdots + \sin\left(\frac{n\pi}{n}\right) = \frac{\cos\left(\frac{\pi}{2n}\right)-\cos\left(\frac{(2n+1)\pi}{2n}\right)}{2\sin\left(\frac{\pi}{2n}\right)}$$
And the famous $\lim_{x\to0}\frac{\sin(x)}{x} = 1$
What I tried:
Using the Right Riemann Sum Method:
$$\int_a^{b}\sin(x)\,dx \approx \Delta x\left[f(a + \Delta x) + f(a + 2\,\Delta x) + \cdots + f(b)\right]$$
By taking $\Delta x = \frac{\pi}{n}$, $a = 0$ and $b = \pi$ we have:
$$\int_0^{\pi}\sin(x)\,dx \approx \Delta x\left[f(\Delta x) + f(2\,\Delta x) + \cdots + f\left(\frac{n\pi}{n}\right)\right] = \frac{\pi}{n}\left[\sin\left(\frac{\pi}{n}\right) + \sin\left(\frac{2\pi}{n}\right) + \cdots + \sin\left(\frac{n\pi}{n}\right)\right] = \frac{\pi}{n}\left[\frac{\cos\left(\frac{\pi}{2n}\right)-\cos\left(\frac{(2n+1)\pi}{2n}\right)}{2\sin\left(\frac{\pi}{2n}\right)}\right]$$
So 
$$\int_0^\pi \sin(x)\,dx = \lim_{n\to\infty} \frac{\pi}{n}\frac{\cos\left(\frac{\pi}{2n}\right)-\cos\left(\frac{(2n+1)\pi}{2n}\right)}{2\sin\left(\frac{\pi}{2n}\right)}$$
I can't see, however, how to prove this limit to be $=2$
 A: Notice that we can rewrite the limit as:
$$
\left[\lim_{n\to\infty} \frac{\frac{\pi}{2n}}{\sin\left(\frac{\pi}{2n}\right)} \right]\left[\cos\left(\lim_{n\to\infty}\frac{\pi}{2n}\right)-\cos\left(\lim_{n\to\infty}\frac{(2n+1)\pi}{2n}\right) \right]
= 1 \cdot [\cos 0 - \cos \pi] = 2
$$
A: Using $$\cos A-\cos B=-2\sin\frac{A+B}{2}\sin\frac{A-B}{2}$$
with $$\lim_{n\to\infty}\frac{\pi/(2n)}{\sin(\pi/(2n))}=1,$$
We have $$\frac{\pi/(2n)}{\sin(\pi/(2n))}\cdot (-2)\sin\left\{\frac{1+(2/n)}{2}\pi\right\}\sin\left(-\frac{\pi}{2}\right)\to 1\cdot (-2)\cdot 1\cdot (-1)=2\ (n\to \infty)$$
A: Without simplifying your last expression (thr numerator is twice the same term of it), we could use Taylor series and, for large values of $n$, you could write $$\cos\left(\frac{\pi}{2n}\right)=1-\frac{\pi ^2}{8 n^2}+\frac{\pi ^4}{384
   n^4}+O\left(\left(\frac{1}{n}\right)^5\right)$$ $$\cos\left(\frac{(2n+1)\pi}{2n}\right)=-1+\frac{\pi ^2}{8 n^2}-\frac{\pi ^4}{384
   n^4}+O\left(\left(\frac{1}{n}\right)^5\right)$$ $$\sin\left(\frac{\pi}{2n}\right)=\frac{\pi }{2 n}-\frac{\pi ^3}{48 n^3}+O\left(\left(\frac{1}{n}\right)^5\right)$$ So $$\frac{\pi}{n}\frac{\cos\left(\frac{\pi}{2n}\right)-\cos\left(\frac{(2n+1)\pi}{2n}\right)}{2\sin\left(\frac{\pi}{2n}\right)}=2-\frac{\pi ^2}{6 n^2}+O\left(\left(\frac{1}{n}\right)^4\right)$$
