= Euler-Maclaurin formula
{c}
= Euler–Maclaurin
{c}
{synonym}
= Euler-Maclaurin expansion
{c}
{synonym}
The <Euler-Maclaurin formula> relates a finite <sum> to an <integral> and endpoint <derivatives>. If $a<b$ are <integers>, $p\geq1$ and $f$ has continuous <derivatives> through order $2p$ on $[a,b]$, then
$$
\sum_{k=a}^{b}f(k)=\int_a^b f(x)\,dx+\frac{f(a)+f(b)}2+\sum_{r=1}^{p}\frac{B_{2r}}{(2r)!}\bigl(f^{(2r-1)}(b)-f^{(2r-1)}(a)\bigr)+R_p.
$$
Here $B_{2r}$ are <Bernoulli numbers>. With $\widetilde B_{2p}(x)=B_{2p}(\{x\})$ the <periodic Bernoulli function>, the exact remainder is
$$
R_p=-\frac1{(2p)!}\int_a^b\widetilde B_{2p}(x)f^{(2p)}(x)\,dx.
$$
This form rearranges the last endpoint correction in the NIST statement.<NIST Digital Library of Mathematical Functions/2.10 Sums and Sequences>[§2.10(i), equation 2.10.1; move the constant B_(2p) part of its last integral into the endpoint sum]{ref}
For $f(x)=x^2$ on $[0,n]$ and $p=1$, the remainder vanishes because the second <Bernoulli polynomial> has integral zero over each unit interval. The result is $\sum_{k=1}^n k^2=n^3/3+n^2/2+n/6$, the <square pyramidal number> formula. For other <functions>, retaining or bounding $R_p$ makes the finite truncation a controlled approximation.
Back to article page