# Suppose $f$ is continuously differentiable on $[0,1]$, $|f'(x)|$ is bounded, show that $|\int_0^1 f(x) - \sum^n_{i=1}f(i/n)\cdot 1/n| \le M/n$.

Problem statement: Suppose $f$ is continuously differentiable on $[0,1]$, and that $\sup_{x \in [0,1]}|f'(x)|\le M< \infty$. Show that $$\big|\int_0^1 f(x) - \sum^n_{i=1}f(i/n)\cdot 1/n\big| \le M/n.$$

My attempt at a solution: To start with, I was trying to get the derivative involved, somewhere, so I wrote $$f(i/n) = f(0) + \int^{i/n}_0 f'(x)$$ which gives $$\big|\int_0^1 f(x) - \sum^n_{i=1}f(i/n)\cdot 1/n\big| = \big|\int_0^1 f(x) - \sum^n_{i=1}\int_0^{i/n}f'(x)\cdot 1/n\big|.$$ I was hoping then to bound the integral using the bound on $f'$. But, there's that pesky minus sign in front of the sum that I'm working with, and even if there weren't, the bound doesn't seem to result in anything useful there, since we end up with $$1/n \cdot \sum^n_{i=1}\int_0^{i/n}f'(x) \le f(0) + M/n \sum^n_{i=1}i,$$ which doesn't seem useful to me. I would really appreciate some hints as to the right way to attack this problem!

I would start instead by writing $$\int_0^1 f(x) - \sum_{i=1}^n f(i/n)\cdot (1/n) \\ = \sum_{i=1}^n \int_{(i-1)/n}^{i/n}f(x) - f(i/n) \,dx.$$
Usually these problems with the $f(i/n)$ involved are solved by a clever interchange of integrals and summation.
• So, I've worked with this suggestion, and after much algebra/calculus, I've gotten to $$|\int_0^1 f(x) - \sum^n_{i=1}f(i/n)\cdot1/n| = |sum^n_{i=1}\int^{i/n}_{(i-1)/n}\int_{i/n}^xf'(t)dt \le |sum^n_{i=1}\int^{i/n}_{(i-1)/n}\int_{i/n}^xMdt$$ $$\le \sum^n_{i=1} \int_{(i-1)/n}^{i/n}M(x-i/n)$$ but after working out this integral, I'm getting $$\le \sum^n_{i=1}M(-1/2n^2) \le -1/2 M/n$$ which doesn't seem right, but is so close that I'm hoping you can help me work out where I went wrong... – poppy3345 Aug 26 '15 at 20:50
• I don't think you should have to do a double integral. Instead estimate $f(x) - f(i/n)$ by $f'(x^*) \cdot (1/n)$ (mean value theorem). Also, you forgot your absolute value signs halfway through (so you have $|\cdot| \leq$ something negative, which can't be). – Eric Auld Aug 26 '15 at 22:07
Now bound this last integral (use the integral triangle inequality, replace $|f'(y)|$ by $M$, and then integrate explicitly). Then apply what you get repeatedly to get your result.