Euler–Maclaurin Summation
Build a finite sum from its integral, endpoint and derivative corrections and see the correction that makes it exact.
By Riano · Published · Updated · Report a correction
Euler–Maclaurin Summation
The Euler–Maclaurin summation formula expresses a finite discrete sum Σk=1N f(k) as the continuous definite integral ∫0N f(x) dx plus half-endpoint and Bernoulli odd-derivative boundary corrections:
Σk=1N f(k) ≈ ∫0N f(x) dx + (f(N) - f(0))/2 + (B2/2!)(f'(N) - f'(0)) + (B4/4!)(f'''(N) - f'''(0)) + ..., with B2 = 1/6 and B4 = -1/30.
Worked Example: Sum of Squares up to N = 4
Evaluate each Euler–Maclaurin term for f(x) = x2 on k = 1, 2, 3, 4 (N = 4):
- Exact finite sum:
12 + 22 + 32 + 42 = 1 + 4 + 9 + 16 = 30. - Integral term:
∫04 x2 dx = [x3/3]04 = 64/3 ≈ 21.333333333333332. - Endpoint term:
(f(4) - f(0)) / 2 = (16 - 0) / 2 = 8. - B2 derivative term: since
f'(x) = 2x,(B2/2!)(f'(4) - f'(0)) = (1/12)(8 - 0) = 2/3 ≈ 0.6666666666666666. - B4 derivative term: since
f'''(x) = 0, theB4term is0, and the cumulative estimate64/3 + 8 + 2/3 = 30is exact with Absolute error = 0.
Interactive Experiment
Explore how polynomial degree determines which Bernoulli correction closes the gap in the Euler–Maclaurin Summation interactive workspace:
- With Power = Square, Upper N = 4, and Correction = B2, verify that Integral term = 21.333333333333332, Endpoint term = 8, and B2 term = 0.6666666666666666 sum to Selected estimate = 30 (error
0). - Set Power = Cube, Upper N = 2, and Correction = Endpoints. Note that
4 + 4 = 8misses Exact finite sum = 9 by the omitted B2 term = 1. - Switch Power = Fourth power with Upper N = 2 and Correction = B2. Observe that
32/5 + 8 + 8/3 = 256/15 ≈ 17.066666666666666overshoots17by1/15becausef'''(x) = 24xrequires the negative B4 term = -1/15. - Change Correction to B4 on Fourth power (with Upper N = 1 or 2) to see the negative fourth-order Bernoulli term restore exactness.
Limitations and Assumptions
For polynomials f(x) = xp with p ∈ {2, 3, 4}, derivatives of order five and higher vanish identically, so the Euler–Maclaurin expansion terminates finitely at B2 (for p = 2, 3) or B4 (for p = 4). One must not infer that the Euler–Maclaurin series converges for general smooth non-polynomial functions (such as 1/x or e-x), where the Bernoulli numbers B2m grow factorially and the series is typically asymptotic rather than convergent.
References
The Bernoulli numbers, endpoint derivative corrections, and integral remainder form of the Euler–Maclaurin summation formula are detailed in the following reference:
Experience it interactively
Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Euler–Maclaurin Summation module.
Try Euler–Maclaurin Summation on Riano →