Proof of Euler-Maclaurin summation formula

Let a and b be integers such that a<b, and let f:[a,b]\to\mathbf{R} be continuous. We will prove by induction that for all integers k\geq 0, if f is a k+1 times continuously differentiable function,

\displaystyle \sum_{a<n\leq b}f(n)=\int_a^b f(t)\,dt+\sum_{i=0}^k\frac{(-1)^{i+1}B_{i+1}}{(i+1)!}(f^{(i)}(b)-f^{(i)}(a))+\frac{(-1)^k}{(k+1)!}\int_a^b B_{k+1}(t)f^{(k+1}(t)\,dt

where B_i is the i-the Bernoulli number and B_i(t) is the i-th Bernoulli periodic function.

To prove the formula  for k=0, we first write \int_{n-1}^n f(t)\,dt, where n is an integer, using integration by parts:

\displaystyle \int_{n-1}^n f(t)\,dt=\int_{n-1}^n (t-n+\frac{1}{2})'f(t)\,dt=\frac{1}{2}(f(n)-f(n-1))-\int_{n-1}^n (t-n+\frac12)f'(t)\,dt.

Because t-n+\frac12=B_1(t) on the interval (n-1,n), this is equal to

\displaystyle  \int_{n-1}^n f(t)\,dt=\frac{1}{2}(f(n)-f(n-1))-\int_{n-1}^n B_1(t)f'(t)\,dt.