Explanation for how limit of a sum can be converted to definite integration

In my book it is written that $$\lim_{n\rightarrow\infty}\sum_{r=a}^{r=b}f(\frac{r}{n})\left(\frac{1}{n}\right)$$ can be converted to $$\int_{\lim_{n\rightarrow \infty}(a/n)}^{\lim_{n\rightarrow \infty} (b/n)}f(x)dx$$ Can someone explain how the the sum is being converted to the integration?

I know the first principle of definite integration but cannot figure out why the $r/n$ form is required here. Also how does the limits of $r$ get converted to $a$ and $b$ in the second version?

Also, most websites explain the method of converting the limit of sum to definite integration but none of them explain the intuition behind it.

I was responding to your initial version; I'm a bit confused after your edit. You now have $\lim_{n\rightarrow \infty}(a/n)$ and $\lim_{n\rightarrow \infty}(b/n)$ as bounds for the integral, but those limits are both $0$...?

I'll leave the answer below for now; perhaps you can clarify via comments.

In my book it is written that $$\lim_{n\rightarrow\infty}\sum_{r=an}^{r=bn}f(\frac{r}{n})\left(\frac{1}{n}\right)$$ can be converted to $$\int_{a}^{b}f(x)dx$$ Can someone explain how the the sum is being converted to the integration?

Your book probably covers upper and lower and/or Riemann sums and the definite integral as a limit of (one of) these types of sums.

The more general sum, a Riemann-sum, is formed by partitioning the interval $[a,b]$ into subintervals $[a=x_0,x_1],[x_1,x_2],\ldots,[x_{n-1},x_n=b]$ and picking an arbitrary point $x_i^*$ in each subinterval $[x_{i-1},x_i]$. Then consider the sum: $$\sum_{i=1}^n f\left(x_i^* \right) \left(x_i-x_{i-1} \right)=\sum_{i=1}^n f\left(x_i^* \right) \Delta x_i$$ Taking a limit is subtle in the sense that these sums not only depend on the chosen partition, but also on the selected points $x_i^*$. If (all) the lengths of the subintervals tend to $0$, the sum converges to the definite integral.

The sums become simpler with some specific choices, such as:

• subintervals of equal length $\Delta x_n = \tfrac{b-a}{n}$, so the partition becomes: $$[a,a+\Delta x_n],[a+\Delta x_n,a+2\Delta x_n], \ldots , [a+(n-1)\Delta x_n,a+n\Delta x_n=b]$$
• choosing the point $x_i^* \in [x_{i-1},x_i] = [a+(i-1)\Delta x_n,\color{purple}{a+i\Delta x_n}]$ as $\color{purple}{x_i^*=a+i\Delta x_n}$.

The sum now simplifies to an expression which depends on $n$ only and you take the limit $n \to \infty$: $$\lim_{n \to \infty} \sum_{i=1}^n f\left( a+i\Delta x_n \right) \Delta x_n =\lim_{n \to \infty} \sum_{i=1}^n f\left( a+i \tfrac{b-a}{n} \right) \tfrac{b-a}{n} \tag{*}$$ Interpretation of the sums is now easier: you divide $[a,b]$ into $n$ subintervals of equal length and you pick an end point of each interval where you evaluate $f$.

Now I have the feeling that your sum

$$\lim_{n\rightarrow\infty}\sum_{r=an}^{r=bn}f(\frac{r}{n})\left(\frac{1}{n}\right)$$

mixes the general case where the interval is $[a,b]$ with a more specific case where the interval is $[0,1]$ since in that case, taking $\color{blue}{a=0}$ and $\color{red}{b=1}$, $(*)$ becomes:

$$\lim_{n \to \infty} \sum_{i=1}^n f\left( \color{blue}{0}+i \tfrac{\color{red}{1}-\color{blue}{0}}{n} \right) \tfrac{\color{red}{1}-\color{blue}{0}}{n}=\lim_{n \to \infty} \sum_{i=1}^n f\left(\frac{i}{n} \right) \frac{1}{n}$$