# オイラーの和公式

${\displaystyle \sum _{j=0}^{n-1}f(j)=\int _{0}^{n}f(x)dx+\sum _{k=1}^{m}{\frac {B_{k}}{k!}}\left(f^{(k-1)}(n)-f^{(k-1)}(0)\right)+R_{m}}$
${\displaystyle \sum _{j=1}^{n-1}f(j)+{\frac {1}{2}}\left(f(0)+f(n)\right)=\int _{0}^{n}f(x)dx+\sum _{k=1}^{m}{\frac {B_{2k}}{(2k)!}}\left(f^{(2k-1)}(n)-f^{(2k-1)}(0)\right)+R_{2m+1}}$
${\displaystyle R_{m}=(-1)^{m+1}\int _{0}^{n}{\frac {B_{m}(x-\lfloor {x}\rfloor )}{m!}}f^{(m)}(x)dx}$

${\displaystyle B_{1}=-{\frac {1}{2}},B_{2}={\frac {1}{6}},B_{3}=0,B_{4}=-{\frac {1}{30}},B_{5}=0,B_{6}={\frac {1}{42}},B_{7}=0,B_{8}=-{\frac {1}{30}},B_{9}=0,B_{10}={\frac {5}{66}},\cdots }$
${\displaystyle B_{0}(x)=1,B_{1}(x)=x-{\frac {1}{2}},B_{2}(x)=x^{2}-x+{\frac {1}{6}},B_{3}(x)=x^{3}-{\frac {3}{2}}x^{2}+{\frac {1}{2}}x,B_{4}(x)=x^{4}-2x^{3}+x^{2}-{\frac {1}{30}},\dots }$

なお、${\displaystyle f^{(k)}}$は導関数、${\displaystyle \lfloor {x}\rfloor }$床関数を表す。

## 証明

ベルヌーイ多項式の性質(若しくは定義)により

${\displaystyle \int _{0}^{1}{\frac {B_{k-1}(x)}{(k-1)!}}f^{(k-1)}(x)dx=\int _{0}^{1}\left({\frac {B_{k}(x)}{k!}}\right)'f^{(k-1)}(x)=\left[{\frac {B_{k}(x)}{k!}}f^{(k-1)}(x)\right]_{0}^{1}-\int _{0}^{1}{\frac {B_{k}(x)}{k!}}f^{(k)}(x)dx}$

である。有限回の部分積分を繰り返して

${\displaystyle \int _{0}^{1}f(x)dx=\int _{0}^{1}B_{0}(x)f(x)dx=\sum _{k=1}^{m}\left[(-1)^{k-1}{\frac {B_{k}(x)}{k!}}f^{(k-1)}(x)\right]_{0}^{1}+(-1)^{m}\int _{0}^{1}{\frac {B_{m}(x)}{m!}}f^{(m)}(x)dx}$

となるが、これは${\displaystyle f(x)}$ ${\displaystyle f(j+x)}$ に置き換えても成り立つから

{\displaystyle {\begin{aligned}\int _{0}^{n}f(x)dx&=\sum _{j=0}^{n-1}\int _{0}^{1}f(j+x)dx\\&=\sum _{j=1}^{n-1}\sum _{k=1}^{m}\left[(-1)^{k-1}{\frac {B_{k}(x)}{k!}}f^{(k-1)}(x)\right]_{0}^{1}+(-1)^{m}\int _{0}^{n}{\frac {B_{m}(x-\lfloor {x}\rfloor )}{m!}}f^{(m)}(x)dx\end{aligned}}}

である。${\displaystyle B_{1}(0)=-\textstyle {\frac {1}{2}},}$ ${\displaystyle B_{1}(1)=\textstyle {\frac {1}{2}},B_{2k}(0)=B_{2k}(1)=B_{2k},}$ ${\displaystyle B_{2k+1}(0)=B_{2k+1}(1)=B_{2k+1}=0}$ を代入すれば

${\displaystyle \int _{0}^{n}f(x)dx=\sum _{j=0}^{n-1}f(j)-{\frac {1}{2}}f(0)+{\frac {1}{2}}f(n)-\sum _{k=2}^{m}(-1)^{k}{\frac {B_{k}}{k!}}\left(f^{(k-1)}(n)-f^{(k-1)}(0)\right)-R_{m}}$
${\displaystyle R_{m}=(-1)^{m+1}\int _{0}^{n}{\frac {B_{m}(x-\lfloor {x}\rfloor )}{m!}}f^{(m)}(x)dx}$

を得る。移項して形式を整えると

${\displaystyle \sum _{j=0}^{n-1}f(j)=\int _{x=0}^{n}f(x)dx+\sum _{k=1}^{m}{\frac {B_{k}}{k!}}\left(f^{(k-1)}(n)-f^{(k-1)}(0)\right)+R_{m}}$

となる。或いは

{\displaystyle {\begin{aligned}\sum _{j=1}^{n-1}f(j)+{\frac {1}{2}}\left(f(0)+f(n)\right)&=\int _{0}^{n}f(x)dx+\sum _{k=2}^{2m+1}{\frac {B_{k}}{k!}}\left(f^{(k-1)}(n)-f^{(k-1)}(0)\right)+R_{2m+1}\\&=\int _{0}^{n}f(x)dx+\sum _{k=1}^{m}{\frac {B_{2k}}{(2k)!}}\left(f^{(2k-1)}(n)-f^{(2k-1)}(0)\right)+R_{2m+1}\\\end{aligned}}}

となる。