On the exact error of composite trapezoidal rule in the limit Let $f\in C^2[a,b]$ be a twice continuously differentiable function on a closed bounded interval $[a,b]$.
Let
$$T_n(f):=\frac {b-a}{2n} \left (f(a)+f(b)+2\sum_{j=1}^{n-1} f\left(a+j\frac{b-a}{n}\right)\right),\quad\forall n\ge 1.$$
Then, how to prove that $\displaystyle\lim_{n\to \infty} \left(\frac{n}{b-a}\right)^2 \left(\int_a^b f(t)\,dt - T_n(f) \right)=\frac1{12} (f'(a)-f'(b))$ ?
Notice that $T_n(f)$ is the composite Trapezoidal rule with $n$ many partitions.
 A: One may take the exact form of Euler–Maclaurin summation formula for the idea. In our case, it reads $$T_n(f)=\int_a^b f(x)\,dx+\frac{1}{12}\left(\frac{b-a}{n}\right)^2\big(f'(b)-f'(a)-R_n(f)\big),\\R_n(f)=6\int_a^b f''(x)P_2\left(n\frac{x-a}{b-a}\right)dx,$$ where $P_2(x)=B_2(\{x\})$ and $B_2(x)=x^2-x+1/6$ is the second Bernoulli polynomial (and $\{x\}$ stands for the fractional part of $x$: $\{x\}=x-\lfloor x\rfloor$). See the article for a proof. With $h_n=(b-a)/n$, we have $$R_n(f)=6\sum_{k=1}^n\int_{a+(k-1)h_n}^{a+kh_n}\big(f''(x)-f''(a+kh_n)\big)P_2\big((x-a)/h_n\big)\,dx$$ since $\int_{a+(k-1)h_n}^{a+kh_n}P_2\big((x-a)/h_n\big)\,dx=0$.
Now, to prove the needed $\lim_{n\to\infty}R_n(f)=0$, we use the uniform continuity of $f''$ on $[a,b]$. Let $\epsilon>0$ be arbitrary. There is $\delta>0$ such that $|f''(x)-f''(y)|<\epsilon/(b-a)$ for $x,y\in[a,b]$ with $|x-y|<\delta$. Then, for any $n>(b-a)/\delta$, we get $h_n<\delta$ and $|f''(x)-f''(a+kh_n)|<\epsilon/(b-a)$ for $x\in[a+(k-1)h_n,a+kh_n]$; with $|P_2(\cdot)|\leqslant 1/6$, this gives $|R_n(f)|<\epsilon$.
