1.2. The Euler-MacLaurin formula 3

Proposition 1.2. (Euler-MacLaurin formula) Let 0 y x be two real

numbers and assume that f : [y, x] → R has a continuous derivative on

[y, x]. Then

(1.3)

yn≤x

f(n) =

x

y

f(t) dt+

x

y

(t−t )f (t) dt+( x−x)f(x)−( y−y)f(y).

Proof. Expanding the second integral on the right side of (1.3), we get

I =

x

y

(t − t )f (t) dt =

x

y +1

+

x

x

+

y +1

y

(t − t )f (t) dt

= I1 + I2 + I3,

say. Set a = y and b = x , and let us evaluate separately each of the

integrals Ii.

I1 =

b

a+1

(t − t )f (t) dt =

b−1

k=a+1

k+1

k

(t − k)f (t) dt

=

b−1

k=a+1

k+1

k

tf (t) dt −

b−1

k=a+1

k

k+1

k

f (t) dt

=

b−1

k=a+1

tf(t)

t=k+1

t=k

−

k+1

k

f(t) dt −

b−1

k=a+1

k(f(k + 1) − f(k))

= bf(b) − (a + 1)f(a + 1)

−

b

a+1

f(t) dt + (a + 1)f(a + 1) − bf(b) +

b

n=a+2

f(n).

Therefore,

b

n=a+2

f(n) =

b

a+1

f(t) dt + I1.

On the other hand,

I2 =

x

b

(t − b)f (t) dt =

x

b

tf (t) dt − b

x

b

f (t) dt

= tf(t)

t=x

t=b

−

x

b

f(t) dt − b

x

b

f (t) dt

= (x − x )f(x) −

x

x

f(t) dt.