Integer-frequency endpoint expansion of cosine integrals (source code)

= Integer-frequency endpoint expansion of cosine integrals
{title2=$a_k=(-1)^{k-1}[h^{(2k-1)}(2\pi)-h^{(2k-1)}(0)]$}

For smooth $h$ on $[0,2\pi]$ and positive integer $n$, repeatedly integrating $\int h(t)\cos(nt)\,dt$ twice eliminates the sine endpoint terms and yields only even inverse powers of $n$. The exact remainder after $M$ pairs is $(-1)^Mn^{-2M}\int h^{(2M)}\cos(nt)$, which is $o(n^{-2M})$ by the <Riemann-Lebesgue lemma>. Without integer frequencies an $n^{-1}$ sine endpoint term generally remains.