# Show using Riemann sum that error approximation is bounded above by $\frac{7}{n}$

Let $f$ be a decreasing function on $[0,1]$ with $f(0) = 7$ and $f(1) = 0$.

Show, using the deﬁnition of the Riemann sum, that the error in approximating $\int_{0}^{1}f(x)dx$ with a Riemann sum using right endpoints and n intervals of equal length is bounded above by $\frac{7}{n}$.

I don't seem to have any idea how to solve this question. Can someone please help me?

• What is the max error over one of the intervals? Add them up. – almagest Apr 26 '16 at 11:53
• Try to do the case $n = 1$ and $n = 2$ first. – levap Apr 26 '16 at 11:54
• I thought of a solution. Is it correct -- We have the Riemann sum as f(1/n).(1/n) + f(2/n).(1/n) + f(3/n).(1/n) + ... . Now, Since f is decreasing between [0,1] and f(0) = 7 and f(1) = 0, f(x) <= 7. Therefore, f(x)/n <= 7/n. Therefore, The Riemann sum is bounded above by 7/n. Is this correct? – Anirudh Gangwal Apr 26 '16 at 12:06
• Not quite. That would give you $49/n$. But the error for $f(\frac{k}{n})\cdot\frac{1}{n}$ is at most $(f(\frac{k-1}{n})-f(\frac{k}{n}))\cdot\frac{1}{n}$. So when you add them up it telescopes to $f(0)\frac{1}{n}$. – almagest Apr 26 '16 at 12:21
• @almagest I don't understand. Could you please give a more elaborate solution? – Anirudh Gangwal Apr 26 '16 at 12:29

## 1 Answer

As you say the Riemann sum is $\sum_{k=0}^nf(\frac{k}{n})\frac{1}{n}$. Over the interval $(\frac{k-1}{n},\frac{k}{n})$ the function is decreasing and we picked the value at the right endpoint, which is the smallest value. So the biggest error in $f(x)$ for any point $x\in(\frac{k-1}{n},\frac{k}{n})$ is $f(\frac{k-1}{n})-f(\frac{k}{n})$. Hence the biggest possible error over that interval is $(f(\frac{k-1}{n})-f(\frac{k}{n}))\cdot\frac{1}{n}$.

Hence the max total error is $\frac{1}{n}\sum_{k=1}^n(f(\frac{k-1}{n})-f(\frac{k}{n}))$. The sum is $f(0)-f(\frac{1}{n})+f(\frac{1}{n})-f(\frac{2}{n})+\dots+f(\frac{n-1}{n})-f(1)$ which is just $f(0)-f(1)=7$. So the max total error is $\frac{7}{n}$.