# Turning infinite sum into integral

Could someone explain how one can replace infinite sum with integral?

Examples (or you may use your own, it doesn't matter as I want to understand principles):

$$\frac{1}{n} \sum_{i=1}^{n} \sin \frac{i-1}{n} \pi$$

$$\frac{1}{n} \sum_{i=1}^{n} \sqrt{1 + \frac{i}{n}}$$

I see that $\frac{1}{n}$ denote partition, so my problem is that I don't know how to figure out the function, hence, the integrand.

• Are you looking for something like $\dfrac{\displaystyle \int_{x=0}^{\pi} \sin(x)\, dx }{ \displaystyle \int_{x=0}^{\pi}\, dx}$ and $\dfrac{\displaystyle \int_{x=0}^{1} \sqrt{1+x} \, dx }{ \displaystyle \int_{x=0}^{1} \, dx}$ so in effect finding the mean of the summands or integrand? Or do you want bounds? – Henry Jul 10 '15 at 15:02
• – lab bhattacharjee Jul 10 '15 at 15:02
• These are not infinite sums. If one finds $\displaystyle\lim_{n\to\infty} \sum_{i=1}^n a_n$, that can be considered an infinite sum. But $\displaystyle \lim_{n\to\infty} \frac 1 n \sum_{i=1}^n a_n$ is somewhat different from that. Notice that if you push the $1/n$ inside the sum, getting $\displaystyle \lim_{n\to\infty} \sum_{i=1}^n \frac{a_n} n$, then as $n$ increases, one isn't just adding more terms, but actually changing the terms that were already there by dividing them by a larger value of $n$. In $\displaystyle\lim_{n\to\infty} \sum_{i=1}^n a_n$, increasing $n$ merely adds more terms. – Michael Hardy Jul 10 '15 at 17:45
• Bravo, @MichaelHardy, you explained well what I tried to say much more briefly in my answer. – Rory Daulton Jul 10 '15 at 17:51
• @RoryDaulton : Thank you. – Michael Hardy Jul 10 '15 at 17:57

The Left-hand Rectangular Approximation Method (LRAM) says that, if $f(x)$ is continuous on $[a,b]$,

$$\int_a^b f(x)\,dx=\lim_{n\to\infty}\frac {b-a}{n}\sum_{i=1}^n f\left(a+\frac{b-a}n (i-1) \right)$$

Comparing that with your first sum, we see that $\ a=0,\ b=\pi, f(x)=\sin x/\pi$. So, the limit of your sum as $n\to\infty$ is

$$\frac{1}{\pi}\int_0^{\pi} \sin x\,dx$$

Note that this is not your sum, as you asked, not even an infinite sum, but a limit of sums.

The Right-hand Rectangular Approximation Method (RRAM) says that, if $f(x)$ is continuous on $[a,b]$,

$$\int_a^b f(x)\,dx=\lim_{n\to\infty}\frac {b-a}{n}\sum_{i=1}^n f\left(a+\frac{b-a}n i \right)$$

Comparing that with your second sum, we see that $f(x)=\sqrt x,\ a=1,\ b=2$. So the limit of your sum as $n\to\infty$ is

$$\int_1^2 \sqrt x\,dx$$

Note: The main difference in these two methods is that LRAM has the term $f(a)$ but not the term $f(b)$ while RRAM has the term $f(b)$ but not the term $f(a)$ in the sum. This is due to the different indices on the sum.

• Thank you! Very clear explanation! – push Jul 10 '15 at 18:16
• @push: Thanks, I try, especially in my calculus class. Do take note of what MichaelHardy wrote in his comment. – Rory Daulton Jul 10 '15 at 18:17

The basic idea is this:

If $f$ is a positive increasing function then $f(n) \le \int_n^{n+1} f(x) dx \le f(n+1)$.

Similarly, if $f$ is a positive decreasing function then $f(n) \ge \int_n^{n+1} f(x) dx \ge f(n+1)$.

For increasing $f$, $\sum_{i=0}^{n-1} f(i) \le \int_0^{n} f(x) dx \le \sum_{i=0}^{n-1} f(i+1)$ or $\sum_{i=0}^{n} f(i)-f(n) \le \int_0^{n} f(x) dx \le \sum_{i=0}^{n} f(i)-f(0)$ or $f(0) \le \sum_{i=0}^{n} f(i)-\int_0^{n} f(x) dx \le f(n)$.

For a decreasing function, the inequalities are reversed.

From this you can show that for a bounded piecewise monotonic function, the sum converges to the integral.