100% found this document useful (2 votes)
104 views11 pages

Euler-Maclaurin Formula: 1 Bernoulli Numbers

This document derives the Euler-Maclaurin formula and applies it to numerical integration. It begins by defining the Bernoulli numbers Bn recursively. It then introduces Bernoulli polynomials Bn(t) and establishes some of their key properties. Finally, it derives a local Euler-Maclaurin expansion that expresses the integral of a function F from 0 to 1 in terms of the trapezoidal rule and endpoint derivatives of F, with an error term Rr involving Bernoulli polynomials.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
104 views11 pages

Euler-Maclaurin Formula: 1 Bernoulli Numbers

This document derives the Euler-Maclaurin formula and applies it to numerical integration. It begins by defining the Bernoulli numbers Bn recursively. It then introduces Bernoulli polynomials Bn(t) and establishes some of their key properties. Finally, it derives a local Euler-Maclaurin expansion that expresses the integral of a function F from 0 to 1 in terms of the trapezoidal rule and endpoint derivatives of F, with an error term Rr involving Bernoulli polynomials.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Euler-Maclaurin formula

Michael S. Floater
May 2, 2019

In these notes we derive the Euler-Maclaurin formula and apply it to


numerical integration.

1 Bernoulli numbers
We start by defining the Bernoulli numbers Bn , n = 0, 1, 2, . . .. We define
them as the coefficients in the expansion
X xj ∞
x
= Bj .
ex − 1 j=0
j!

This means that


x
B0 = lim = 1.
x→0 ex
−1
We obtain Bn , n ≥ 1 recursively. By the Maclaurin expansion of ex we have

! ∞ ! ∞ n−1
!
X xi X xj X X Bj
x= Bj = xn ,
i=1
i! j=0
j! n=1 j=0
(n − j)!j!

which implies that


n−1  
X n
Bj = 0, n ≥ 2. (1)
j=0
j

Thus,
1 1
B1 = − B0 = − ,
2 2

1
1 1
B2 = − (B0 + 3B1 ) = ,
3 6
1
B3 = − (B0 + 4B1 + 6B2 ) = 0,
4

and so on, and we find

n 0 1 2 3 4 5 6
Bn 1 -1/2 1/6 0 -1/30 0 1/42

We will show that Bn = 0 for n ≥ 3 and n odd. This follows from the
fact that
x
f (x) := x − (B0 + B1 x)
e −1
is symmetric, i.e., f (x) = f (−x). To show this observe that the constant B0
is trivially symmetric, and so it is sufficient to show that

x x x(ex + 1)
g(x) := + =
ex − 1 2 2(ex − 1)

is symmetric. To show this we compute

−x(e−x + 1) −x(1 + ex )
g(−x) = = = g(x).
2(e−x − 1) 2(1 − ex )

2 Bernoulli polynomials
We define the Bernoulli polynomial of degree n ≥ 0 as
n  
X n
Bn (t) = Bj tn−j .
j=0
j

2
So

B0 (t) = 1,
1
B1 (t) = t − ,
2
1
B2 (t) = t2 − t + ,
6
3 1
B3 (t) = t3 − t2 + t,
2 2
1
B4 (t) = t4 − 2t3 + t2 − ,
30
5 5 1
B5 (t) = t5 − t4 + t3 − t,
2 3 6
5 1 1
B6 (t) = t6 − 3t5 + t4 − t2 + ,
2 2 42

and so on. From the definition and using (1) we deduce the following prop-
erties:
• Endpoint property:
n  
X n
Bn (1) = Bj = Bn = Bn (0), n ≥ 2.
j=0
j

• Differentiation:
n−1  
X n
Bn0 (t) = (n − j) Bj tn−j−1 = nBn−1 (t), n ≥ 1.
j=0
j

• Integration:
Z 1 Z 1
1 0
Bn (t) dt = Bn+1 (t) dt = 0, n ≥ 1.
0 n+1 0

We will also derive the


• Upper bound:
|B2r (t)| ≤ |B2r |, r ≥ 0.

3
To do this we use Fourier series. We define
bn (t) = Bn (t − j),
B j ≤ t ≤ j + 1, j ∈ Z,

the 1-periodic extension of Bn : [0, 1] → R. By repeated differentiation,

n!
Bn(j) (t) = Bn−j (t), j = 0, 1, . . . , n, n ≥ 1,
(n − j)!

which implies that

Bn(j) (0) = Bn(j) (1), j = 0, 1, . . . , n − 2,

bn ∈ C n−2 (R). Consider the Fourier series of B


and therefore B bn ,

X
B
bn (t) = ck e2πikt .
k=−∞

Because Bbn (t) is real, c−k = ck . So letting ck = ak + ibk , we have a−k = ak


and b−k = −bk , and so

X ∞
X
B
bn (t) = a0 + 2 ak cos(2πikt) + 2 bk sin(2πikt).
k=1 k=1

The coefficients of B
bn are
Z 1
ck = Bn (t)e−2πikt dt.
0

We find Z 1
c0 = Bn (t) dt = 0, n ≥ 1,
0
and for k 6= 0,
1 Z 1
e−2πikt

ck = Bn (t) +n Bn−1 (t)e−2πikt dt =
−2πik 0 0
Z 1
n! −n!
··· = n−1
B1 (t)e−2πikt dt = = ak + ibk .
(2πik) 0 (2πik)n

4
It follows that a0 = b0 = 0 and for k 6= 0,

(2r)!
ak = (−1)r−1 , bk = 0, if n = 2r,
(2πk)2r

(2r − 1)!
ak = 0, bk = (−1)r , if n = 2r − 1.
(2πk)2r−1
We now deduce that

b2r (t) = (−1)r−1 2(2r)!
X cos(2πkt)
B ,
k=1
(2πk)2r

and ∞
b2r−1 (t) = (−1)r 2(2r − 1)!
X sin(2πkt)
B 2r−1
.
k=1
(2πk)
From this we obtain the claimed upper bound since

X 1
|B
b2r (t)| ≤ 2(2r)! = |B
b2r (0)| = |B2r |.
k=1
(2πk)2r

3 Local Euler-Maclaurin expansion


We next use the Bernoulli polynomials to expand the integral of a function
F : [0, 1] → R in terms of the trapezoidal rule and endpoint derivatives of
odd order. We use integration by parts successively.

Lemma 1 For r ≥ 0 and F ∈ C 2r+2 [0, 1],


Z 1 r+1
1 X B2k
F (t) dt = (F (0) + F (1)) − (F (2k−1) (1) − F (2k−1) (0)) + Rr ,
0 2 k=1
(2k)!

where Z 1
1
Rr := B2r+2 (t)F (2r+2) (t) dt.
(2r + 2)! 0

5
Proof. Using integration by parts twice,
Z 1 Z 1 h i1 Z 1
F (t) dt = B0 (t)F (t) dt = B1 (t)F (t) − B1 (t)F 0 (t) dt
0 0 0 0
1 1
Z
1 1 h
0
i 1
= (F (0) + F (1)) − B2 (t)F (t) + B2 (t)F 00 (t) dt
2 2 0 2 0
1 B2 0
= (F (0) + F (1)) − (F (1) − F 0 (0)) + R0 ,
2 2
which proves the lemma in the case r = 0. Otherwise, suppose r ≥ 1, and
assume that the lemma holds with r replaced by r − 1. Then again using
integration by parts twice,
Z 1
1
Rr−1 = B2r (t)F (2r) (t) dt
(2r)! 0
Z 1
1 h
(2r)
i1 1
= B2r+1 (t)F (t) − B2r+1 (t)F (2r+1) (t) dt
(2r + 1)! 0 (2r + 1)! 0
Z 1
1 h
(2r+1)
i 1 1
=− B2r+2 (t)F (t) + B2r+2 (t)F (2r+2) (t) dt
(2r + 2)! 0 (2r + 2)! 0
1
=− (F (2r+1) (1) − F (2r+1) (0)) + Rr ,
(2r + 2)!

which completes the proof. 2

The Bernoulli polynomial B2r+2 (t) in the remainder term Rr is not of one
sign, so we cannot apply the mean value theorem. However, we can fix this
by combining Rr with the last term in the expansion.

Lemma 2 For r ≥ 0 and F ∈ C 2r+2 [0, 1], there is some ξ ∈ (0, 1) such that
Z 1 r
1 X B2k
F (t) dt = (F (0) + F (1)) − (F (2k−1) (1) − F (2k−1) (0)) − R,
0 2 k=1
(2k)!

where
B2r+2
R= F (2r+2) (ξ).
(2r + 2)!

6
Proof. The last term in the expansion in Lemma 1 plus the remainder can
be written as
B2r+2
− (F (2r+1) (1) − F (2r+1) (0)) + Rr
(2r + 2)!
Z 1
B2r+2
=− F (2r+2) (t) dt + Rr = −R,
(2r + 2)! 0
where Z 1
1
R := (B2r+2 − B2r+2 (t))F (2r+2) (t) dt.
(2r + 2)! 0

Using the upper bound on B2r (t) of the previous section, the difference B2r −
B2r (t) is of one sign in [0, 1], because

sgn(B2r )(B2r − B2r (t)) = |B2r | − sgn(B2r )B2r (t) ≥ |B2r | − |B2r (t)| ≥ 0.

So by the mean value theorem, there is some ξ ∈ (0, 1) such that


Z 1
1 B2r+2
R= (B2r+2 − B2r+2 (t)) dt F (2r+2) (ξ) = F (2r+2) (ξ).
(2r + 2)! 0 (2r + 2)!
2

4 Global Euler-Maclaurin expansion


We apply the local expansion to obtain the global one. Given an interval
[a, b] choose n ≥ 1 and let h = (b − a)/n and xi = a + ih, i = 0, 1, . . . , n.
Theorem 1 For r ≥ 0 and f ∈ C 2r+2 [a, b], there is some ξ ∈ (a, b) such
that
Z b r
X B2k 2k (2k−1)
f (x) dx = T (h) − h (f (b) − f (2k−1) (a)) − R,
a k=1
(2k)!

where
n−1
h X
T (h) = (f (a) + f (b)) + h f (xi ),
2 i=1

and
B2r+2
R= (b − a)h2r+2 f (2r+2) (ξ).
(2r + 2)!

7
Proof. Let F (t) = f (xi−1 + ht), t ∈ [0, 1], i = 1, . . . , n. Then Lemma 2 gives
Z xi Z 1
f (x) dx = h F (t) dt =
xi−1 0
r
h X B2k 2k (2k−1)
(f (xi−1 ) + f (xi )) − h (f (xi−1 ) − f (2k−1) (xi )) − Ri ,
2 k=1
(2k)!

where
B2r+2 2r+3 (2r+2)
Ri = h f (ξi )
(2r + 2)!
for some ξi ∈ (xi−1 , xi ). Summing this equation over i = 1, . . . , n yields the
desired expansion except that the remainder term is
n n
X B2r+2 2r+3 X (2r+2)
R= Ri = h f (ξi ).
i=1
(2r + 2)! i=1

However, an application of the mean value theorem gives


n
X
f (2r+2) (ξi ) = nf (2r+2) (ξ)
i=1

for some ξ ∈ (a, b), and this leads to the remainder term as claimed. 2

5 Applications
5.1 Endpoint corrections
We can view the endpoint derivatives in the Euler-Maclaurin expansion as
correction terms that greatly improve the accuracy of the trapezoidal rule, if
they are available. From Theorem 1 we have

Corollary 1 For r ≥ 0 and f ∈ C 2r+2 [a, b],


Z b r
X B2k 2k (2k−1)
f (x) dx = T (h) − h (f (b) − f (2k−1) (a)) + O(h2r+2 )
a k=1
(2k)!

as h → 0.

8
5.2 Superconvergence of the trapezoidal rule
For some functions, the trapezoidal rule itself has higher accuracy than usual.
Corollary 2 Suppose r ≥ 0 and f ∈ C 2r+2 [a, b]. If f (2k−1) (b) = f (2k−1) (a)
for k = 1, . . . , r, then
Z b
f (x) dx = T (h) + O(h2r+2 ) as h → 0.
a

This we will be the case for any r ≥ 0 for functions f ∈ C ∞ (R) that are
periodic with period b − a. In fact for some functions of this type, the
trapezoidal rule is exact.
Theorem 2 Let [a, b] = [0, 2π] and let
n−1
X n−1
X
f (x) = ak cos(kx) + bk sin(kx),
k=0 k=1

for any choice of ak and bk in R. Then T (h) is exact for f .


Proof. It is sufficient to show that T (h) is exact for f (x) := eikx , k =
0, 1, . . . , n − 1. The integral of this f is
Z 2π (
2π, k = 0;
f (x) dx =
0 0, k > 0.
On the other hand, since f (0) = f (2π),
n−1  !
1 X 2jπ
T (h) = h (f (0) + f (2π)) + f
2 j=1
n
n−1   n−1
X 2jπ X
=h f =h e2jkiπ/n .
j=0
n j=0

So if k = 0,
T (h) = hn = 2π,
and if 1 ≤ k ≤ n − 1,
n−1
X e2kiπ − 1
T (h) = h (e2kiπ/n )j = h = 0.
j=0
e2kiπ/n − 1
2

9
5.3 Sums of p-th powers
We can also use the expansion to obtain a formula for sums of p-th powers.
Corollary 3 For p ≥ 1,
n−1
X 1
jp = (Bp+1 (n) − Bp+1 ).
j=1
p+1

The first examples are


n−1
X 1 1
j = n2 − n,
j=1
2 2
n−1
X 1 1 1
j 2 = n3 − n2 + n,
j=1
3 2 6
n−1
X 1 1 1
j 3 = n4 − n3 + n2 ,
j=1
4 2 4
n−1
X 1 1 1 1
j 4 = n5 − n4 + n3 − n,
j=1
5 2 3 30
n−1
X 1 1 5 1
j 5 = n6 − n5 + n4 − n2 ,
j=1
6 2 12 12

Proof. Let f (x) = xp , p ≥ 1, and [a, b] = [0, n]. Then


Z b Z n
np+1
f (x) = xp dx = .
a 0 p+1
With h = 1, the trapezoidal rule for f on [0, n] is
n−1
1 X
T (h) = np + j p.
2 j=1

Let r be such that p = 2r or p = 2r + 1. Then Theorem 1 gives


Z n r
p
X B2k p!
x dx = T (h) − np−2k+1 ,
0 k=1
(2k)! (p − 2k + 1)!

10
and therefore,
n−1 r 
np+1

X
p 1 p 1 X p+1
j = − n + B2k np−2k+1
j=1
p + 1 2 p + 1 k=1
2k
p  
1 X p+1
= Bk np−k+1
p + 1 k=0 k
1
= (Bp+1 (n) − Bp+1 ).
p+1
2

11

You might also like