Derivatives of Bernstein polynomials (source code)

= Derivatives of Bernstein polynomials
{title2=$B_n^{(r)}f=(n)_r\sum_{j=0}^{n-r}\Delta_{1/n}^rf(j/n)p_{n-r,j}$}

Differentiating the Bernstein basis $p_{n,j}(x)=\binom njx^j(1-x)^{n-j}$ gives $p_{n,j}'=n(p_{n-1,j-1}-p_{n-1,j})$, with out-of-range terms zero. Telescoping coefficient differences and induction give the displayed formula, where $(n)_r=n!/(n-r)!$ and $0\le r\le n$. For $n>r$, set $g_{n,r}(t)=(n)_r\Delta_{1/n}^rf((n-r)t/n)$; then $B_n^{(r)}f=B_{n-r}g_{n,r}$. The rescaled argument compensates for the different sampling meshes.