To convert a limit of a sum into a definite integral, manipulate the expression into the form $\lim_{n\to\infty} \frac{1}{n} \sum f(\frac{r}{n})$. In this form, replace $\frac{1}{n}$ with $dx$, $\frac{r}{n}$ with $x$, and the summation with an integral sign. The limits of integration are typically from 0 to 1 if the sum is from $r=0$ to $n-1$.