TITLE: How to convert into a definite integral
QUESTION [8 upvotes]: Could you show me how to convert the following into a definite integral: 
$$\lim\limits_{n \to \infty} \sum_{k=1}^{3n} \frac{1}{n}\cos\left(\frac{k\pi}{n}\right)\sin\left(\frac{2k\pi}{n}\right)$$
Thank you!

REPLY [8 votes]: It's literally
$$\int_0^3\cos(\pi x)\sin(2\pi x)dx$$
The substitution $u=\pi x$ re-expresses it as
$${1\over\pi}\int_0^{3\pi}\cos(u)\sin(2u)du$$
The basic idea is to think of the $1\over n$ as $\Delta x$, which in the limit becomes a $dx$, and $k/n$ as $x$, which in the limit varies from $0$ when $k=1$ to $3$ when $k=3n$.