The Euler-Maclaurin integration formulas relate integrals to sums and endpoint derivatives.
They follow from Darboux's formula by substituting
a Bernoulli polynomial for
. Differentiating the identity
|
(1)
|
times gives
|
(2)
|
for .
Hence the endpoint values agree for
, while
|
(3)
| |||
|
(4)
|
The remaining values needed in the substitution are
|
(5)
| |||
|
(6)
| |||
|
(7)
|
where the first two formulas use positive integers
with
and
, respectively, and
is a Bernoulli number.
For a positive integer , the resulting even-order integration formula is
|
(8)
|
This holds when is analytic near the
integration line segment. For a real interval,
continuous derivatives suffice (Whittaker and Watson
1990, p. 128).
For positive integers and
, the finite Euler-Maclaurin sum formula is
|
(9)
|
where
|
(10)
|
and is the periodic Bernoulli
polynomial, with
denoting the floor function.
This finite identity requires
to have
continuous derivatives on
(NIST, §2.10).
An infinite expansion follows if as
. The first terms are
|
(11)
|
(Abramowitz and Stegun 1972, p. 16). Without a vanishing remainder, the infinite expansion need not converge. The Euler-Maclaurin sum formula is implemented in the Wolfram Language as the function NSum with option Method -> "EulerMaclaurin".
For the midpoint version, let , where
and
. Write
and
. The
midpoint samples are
,
, ...,
. For a positive integer
,
|
(12)
|
where
|
(13)
|
This holds when has
continuous derivatives on
.
The infinite midpoint expansion follows when this remainder tends to 0. Its correction
sum has a positive sign. It can also be derived by writing the midpoint sum as
,
where
is the composite trapezoidal
rule with step
, and applying the finite Euler-Maclaurin formula to both terms.