easy riemann sum problem goes hard Ok, so here it is the integral
$$\int_{0}^{\pi/2}\left[1 + \sin\left(x\right)\right]\,\mathrm{d}x
$$
which I must compute with the definition. And here is my atempt
$$
\int_{0}^{\pi/2}\left[1 + \sin\left(x\right)\right]\,\mathrm{d}x =
\lim_{n \to \infty}\sum_{k = 1}^{n}\mathrm{f}\left(\xi_{k}\right)
\Delta x =
\lim_{n \to \infty}\sum_{k = 1}^{n}
\left[1 + \sin\left(\frac{k\pi}{2n}\right)\right]\frac{\pi}{2n}$$
and this limit is something strange cause I can't solve it. Is this correct up until here ?. thx.
 A: You are looking to evaluate the limit $$\lim_{n \to \infty}\sum_{k = 1}^{n}
\left[1 + \sin\left(\frac{k\pi}{2n}\right)\right]\frac{\pi}{2n}.$$ Time to simplify! [Warning: this is longer than I expected.] The sum can be split into two parts so that
$$\sum_{k = 1}^{n}
\left[1 + \sin\left(\frac{k\pi}{2n}\right)\right]\frac{\pi}{2n} = \sum_{k = 1}^{n}\frac{\pi}{2n} + \frac{\pi}{2n} \sum_{k = 1}^{n}\sin\left(\frac{k\pi}{2n}\right).$$
The first sum on the right is just $\dfrac \pi 2$.  The second  sum requires a little bit of trigonometry.  The trick is to multiply by a "catalyst". For any number $0 < x < \pi$  you have
$$\sum_{k=1}^n \sin kx = \frac 1 {\sin \frac x2} \sum_{k=1}^n \sin kx \sin \frac x2.$$
The product-to-sum formula from trig states that
$$\sin A \sin B = \frac 12 \left[ \cos(A-B) - \cos(A+B) \right].$$ This means 
$$\sin kx \sin \frac x2 = \frac 12 \left[ \cos(k-\tfrac 12)x - \cos(k+\tfrac 12)x \right]$$ so when you add you can take advantage of telescoping:
$$\sum_{k=1}^n \sin kx \sin \frac x2 = \frac 12 \sum_{k=1}^n \left[ \cos(k-\tfrac 12)x - \cos(k+\tfrac 12)x \right] = \frac 12 \left[ \cos \tfrac x2 - \cos(n+ \tfrac 12)x \right].$$ This gives you at last
$$\sum_{k=1}^n \sin kx = \frac 12 \frac{\cos \tfrac x2 - \cos(n+ \tfrac 12)x}{\sin \tfrac x2}.$$ Evaluate this with $x = \dfrac{\pi}{2n}$ to find
$$ \frac{\pi}{2n} \sum_{k=1}^n \sin \left(\frac{k\pi}{2n} \right) = \frac{ \frac{\pi}{4n}}{\sin \frac{\pi}{4n}} \left[ \cos \tfrac{\pi}{4n} - \cos \tfrac{(2n+1)\pi}{4n}  \right]$$
and finally
$$\sum_{k = 1}^{n}
\left[1 + \sin\left(\frac{k\pi}{2n}\right)\right]\frac{\pi}{2n} = \frac \pi 2 + \frac{ \frac{\pi}{4n}}{\sin \frac{\pi}{4n}} \left[ \cos \tfrac{\pi}{4n} - \cos \tfrac{(2n+1)\pi}{4n}  \right].$$
As you know, $y = \cos x$ is a continuous function and  $\frac{\sin x}{x} \to 1$ as $x \to 0$. Thus the limit evaluates to
$$ \lim_{n \to \infty} \sum_{k = 1}^{n}
\left[1 + \sin\left(\frac{k\pi}{2n}\right)\right]\frac{\pi}{2n} = \frac \pi 2 +  1 \cdot [\cos 0- \cos \tfrac \pi 2] = \frac \pi 2 + 1.$$
