How to prove this integral equality? The question is prove that$$ \lim_{n \to \infty} n^2 \left( \int_a^bf(x) \, \mathrm{d}x - \frac{b-a}{n} \sum_{i=1}^{n} f(a+(2i-1) \frac{b-a}{2n} )\right)= \frac{ (b-a)^2 }{24}\left( f'(b)-f'(a)\right).$$
It is a second question in my text book, the first is
$$ \lim_{n \to \infty} n\left( \sum_{i=1}^{n}f(a+i \frac{b-a}{n})\frac{b-1}{n}-\int_a^{b}f(x) \,\mathrm{d}x\right)= \frac{b-a}{2}[f(b)-f(a)]. $$
I use Lagrange mean value theorem and Integral mean theorem solve it.However, I can not use same way solve the question I asked. Thanks for any advice.(May be Taylor expansion will be help??)
I use RRL's answer to solve this question.Thanks for RRL.
Set $x_i =a+i \frac{b-a}{n} $
$$LHS = \sum_{i=1}^n \int_{x_{i-1}}^{x_i}f(x) \, dx- \sum_{i=0}^n\int_{x_{i-1}}^{x_i}f(c_i) \, dx \qquad \ c_i = \frac{x_i+x_{i-1}}{2} = a+(2i-1)\frac{b-a}{2n}  $$
Get two part together.
$$
=\sum_{i=1}^n \int_{x_{i-1}}^{x_i}[f(x)-f(c_i)] \, dx $$
Use Taylor expansion.
$$\sum_{i=1}^n \int _{x_{i-1}}^{x_i}[ f(c_i)(x-c_i)+\frac{f''(\xi)}{2}(x-c_i)^2] \, dx
$$
Notice the first part equal to $0$. For $c_i$ is average number. Then
$$\sum_{i=1}^n \int _{x_{i-1}}^{x_i}\frac{f''(\xi)}{2}(x-c_i)^2 \, dx $$
Mean value theorem and integrate:
$$ \sum_{i=1}^n \frac{f''(\eta)}{2} \frac{1}{3}\times2 \times(\frac{ b-a}{2n})^3 \, dx$$
then let $n^3 $ back, and simplify.
$$ \frac{(b-a)^2}{24} \sum_{i=1}^n f''( \eta ) \frac{b-a}{n} $$
This is integral definiton. So
$$ =RHS $$
I did not solve it, because I want to expand at the point $a+(2i-1) \frac{b-a}{2n} $. But it did not help. By the way, RRL's anther way that I can not understand.
 A: Define the points
$$x_i = a + i\frac{b-a}{n}, \\ c_i = \frac{x_{i-1} +x _i}{2} = a + (2i-1)\frac{b-a}{2n}.$$
Assuming that $f \in C^2([a,b]),$ consider the Taylor expansion with remainder
$$f(x) = f(c_i) + f'(c_i)(x - c_i) + \frac{1}{2}f''(\xi_x)((x - c_i)^2.$$
Integrate both sides over $[x_{i-1},x_i],$ to get
$$ \int_{x_{i-1}}^{x_i}f(x) \, dx = \frac{b-a}{n}f(c_i) + f'(c_i)\int_{x_{i-1}}^{x_i}(x - c_i) \, dx  + \frac{1}{2}\int_{x_{i-1}}^{x_i}f''(\xi_x)(x- c_i)^2 \, dx.  $$
By the mean value theorem for integrals, there is a point $\alpha_{i,n} \in [x_{i-1},x_i]$, such that
$$\int_{x_{i-1}}^{x_i}f''(\xi_x)(c_i - x)^2 \, dx= f''(\alpha_{i,n})\int_{x_{i-1}}^{x_i}(c_i - x)^2 \, dx = \frac{2}{3}f''(\alpha_{i,n})\left(\frac{b-a}{2n}\right)^{3}.$$
We also have
$$\int_{x_{i-1}}^{x_i}(x - c_i) \, dx = 0.$$
Hence,
$$\int_{x_{i-1}}^{x_i}f(x) \, dx - \frac{b-a}{n}f(c_i) =  \frac{(b-a)^3}{24n^3}f''(\alpha_{i,n}).$$
Summing both sides over $i = 1,2, \ldots, n,$ we get
$$\int_{a}^{b}f(x) \, dx - \frac{b-a}{n}\sum_{n=1}^nf(c_i) = \frac{(b-a)^3}{24n^3}\sum_{n=1}^nf''(\alpha_{i,n}),$$
and
$$n^2 \left( \int_{a}^{b}f(x) \, dx - \frac{b-a}{n}\sum_{n=1}^nf(c_i) \right) = \frac{(b-a)^2}{24}\frac{b-a}{n}\sum_{n=1}^n f''(\alpha_{i,n}).$$
Note that
$$ \frac{b-a}{n}\sum_{n=1}^n \inf_{[x_{i-1},x_i]}f''(x)  \leqslant \frac{b-a}{n}\sum_{n=1}^nf''(\alpha_{i,n}) \leqslant \frac{b-a}{n}\sum_{n=1}^n\sup_{[x_{i-1},x_i]}f''(x). $$
As the right and left sides of the inequality are lower and upper Darboux sums, taking the limit as $n \to \infty$ and applying the squeeze theorem we obtain
$$\lim_{n \to \infty}\frac{b-a}{n}\sum_{n=1}^nf''(\alpha_{i,n}) = \int_a^b f''(x) \, dx = f'(b) - f'(a).$$
Thus,
$$\lim_{n \to \infty}n^2 \left( \int_{a}^{b}f(x) \, dx - \frac{b-a}{n}\sum_{n=1}^nf(c_i) \right) = \frac{(b-a)^2}{24}[f'(b) - f'(a)].$$
Alternatively
Assuming that $f \in C^2([a,b]),$ consider the Taylor expansion with remainder
$$f(c_i) = f(x) + f'(x)(c_i - x) + \frac{1}{2}f''(\xi)((c_i - x)^2.$$
Integrate both sides over $[x_{i-1},x_i],$ to get
$$\frac{b-a}{n}f(c_i) = \int_{x_{i-1}}^{x_i}f(x) \, dx + \int_{x_{i-1}}^{x_i}f'(x)(c_i - x) \, dx  + \frac{1}{2}\int_{x_{i-1}}^{x_i}f''(\xi)(c_i - x)^2 \, dx.  $$
Perform partial integration of the second integral on the right-hand side with $u = f'(x)$ and $dv = (c_i - x)dx.$ Since the second-derivative is bounded on $[a,b]$ we obtain
$$\frac{b-a}{n}f(c_i) = \int_{x_{i-1}}^{x_i}f(x) \, dx - \left.\frac{1}{2}(c_i-x)^2f'(x)\right|_{x_{i-1}}^{x_i} +O(1/n^3).$$
Now simplify and sum both sides over $i = 1,2 , \ldots, n$ to finish.
