Integral method for approximating sums

We wish to approximate a sum Sn=∑k=1nf(k)S_n = \sum_{k=1}^n f(k). If f(k)f(k) is either weakly increasing or weakly decreasing over some interval [1,n][1,n] we can approximate it using an integral.

Let In=∫x=0nf(x)dxI_n = \int_{x=0}^n f(x) dx.

If f(x)f(x) is weakly increasing over [1,n][1,n] we can say In+f(1)≤Sn≤In+f(n)I_n + f(1) \le S_n \le I_n + f(n).

If f(x)f(x) is weakly decreasing over [1,n][1,n] we can say In+f(1)≥Sn≥In+f(n)I_n + f(1) \ge S_n \ge I_n + f(n).