Periodic Bernoulli function (source code)

= Periodic Bernoulli function
{title2=$\widetilde B_n(x)=B_n(\{x\})$}

The periodic Bernoulli function is the periodic extension $\widetilde B_n(x)=B_n(\{x\})$ of the <Bernoulli polynomial>, where $\{x\}=x-\lfloor x\rfloor$ is the <fractional part>. It has period one. For example, $\widetilde B_2(x)=\{x\}^2-\{x\}+1/6$.

For $n\ge2$, its Fourier expansion is
$$
\widetilde B_n(x)=-\frac{n!}{(2\pi i)^n}\sum_{k\ne0}\frac{e^{2\pi ikx}}{k^n}.
$$
The series is absolutely convergent. For $n=1$ the same formula holds away from the integers and describes a sawtooth. At an integer the symmetric Fourier value is zero, whereas the literal fractional-part convention gives $B_1(0)=-1/2$; endpoint conventions must therefore be distinguished.<NIST Digital Library of Mathematical Functions>[Section 24.8(i), equations 24.8.1–24.8.3 and the n=1 interval restriction]{ref}

Periodic Bernoulli functions occur in the remainder of the <Euler-Maclaurin formula>, connecting errors in discrete summation with periodic oscillation between successive integers.