# Bernstein polynomial

In the mathematical field of numerical analysis, a Bernstein polynomial, named after Sergei Natanovich Bernstein, is a polynomial in the Bernstein form, that is a linear combination of Bernstein basis polynomials.

A numerically stable way to evaluate polynomials in Bernstein form is de Casteljau's algorithm.

Polynomials in Bernstein form were first used by Bernstein in a constructive proof for the Stone–Weierstrass approximation theorem. With the advent of computer graphics, Bernstein polynomials, restricted to the interval [0, 1], became important in the form of Bézier curves.

## Definition

The n+1 Bernstein basis polynomials of degree n are defined as

${\displaystyle b_{\nu ,n}(x)={\binom {n}{\nu }}x^{\nu }\left(1-x\right)^{n-\nu },\quad \nu =0,\ldots ,n,}$

where ${\displaystyle {\tbinom {n}{\nu }}}$ is a binomial coefficient. So, for example, ${\displaystyle b_{2,5}(x)={\tbinom {5}{2}}x^{2}(1-x)^{3}=10x^{2}(1-x)^{3}.}$

The first few Bernstein basis polynomials for blending 1, 2, 3 or 4 values together are:

{\displaystyle {\begin{aligned}b_{0,0}(x)&=1,\\b_{0,1}(x)&=1-x,&b_{1,1}(x)&=x\\b_{0,2}(x)&=(1-x)^{2},&b_{1,2}(x)&=2x(1-x),&b_{2,2}(x)&=x^{2}\\b_{0,3}(x)&=(1-x)^{3},&b_{1,3}(x)&=3x(1-x)^{2},&b_{2,3}(x)&=3x^{2}(1-x),&b_{3,3}(x)&=x^{3}\end{aligned}}}

The Bernstein basis polynomials of degree n form a basis for the vector space Πn of polynomials of degree at most n with real coefficients. A linear combination of Bernstein basis polynomials

${\displaystyle B_{n}(x)=\sum _{\nu =0}^{n}\beta _{\nu }b_{\nu ,n}(x)}$

is called a Bernstein polynomial or polynomial in Bernstein form of degree n.[1] The coefficients ${\displaystyle \beta _{\nu }}$ are called Bernstein coefficients or Bézier coefficients.

The first few Bernstein basis polynomials from above in monomial form are:

{\displaystyle {\begin{aligned}b_{0,0}(x)&=1,\\b_{0,1}(x)&=1-1x,&b_{1,1}(x)&=0+1x\\b_{0,2}(x)&=1-2x+1x^{2},&b_{1,2}(x)&=0+2x-2x^{2},&b_{2,2}(x)&=0+0x+1x^{2}\\b_{0,3}(x)&=1-3x+3x^{2}-x^{3},&b_{1,3}(x)&=0+3x-6x^{2}+3x^{3},&b_{2,3}(x)&=0+0x+3x^{2}-3x^{3},&b_{3,3}(x)&=0+0x+0x^{2}+1x^{3}\end{aligned}}}

## Properties

The Bernstein basis polynomials have the following properties:

• ${\displaystyle b_{\nu ,n}(x)=0}$, if ${\displaystyle \nu <0}$ or ${\displaystyle \nu >n.}$
• ${\displaystyle b_{\nu ,n}(x)\geq 0}$ for ${\displaystyle x\in [0,\ 1].}$
• ${\displaystyle b_{\nu ,n}\left(1-x\right)=b_{n-\nu ,n}(x).}$
• ${\displaystyle b_{\nu ,n}(0)=\delta _{\nu ,0}}$ and ${\displaystyle b_{\nu ,n}(1)=\delta _{\nu ,n}}$ where ${\displaystyle \delta }$ is the Kronecker delta function: ${\displaystyle \delta _{ij}={\begin{cases}0&{\text{if }}i\neq j,\\1&{\text{if }}i=j.\end{cases}}}$
• ${\displaystyle b_{\nu ,n}(x)}$ has a root with multiplicity ${\displaystyle \nu }$ at point ${\displaystyle x=0}$ (note: if ${\displaystyle \nu =0}$, there is no root at 0).
• ${\displaystyle b_{\nu ,n}(x)}$ has a root with multiplicity ${\displaystyle \left(n-\nu \right)}$ at point ${\displaystyle x=1}$ (note: if ${\displaystyle \nu =n}$, there is no root at 1).
• The derivative can be written as a combination of two polynomials of lower degree:
${\displaystyle b'_{\nu ,n}(x)=n\left(b_{\nu -1,n-1}(x)-b_{\nu ,n-1}(x)\right).}$
• The transformation of the Bernstein polynomial to monomials is
${\displaystyle b_{\nu ,n}(x)={\binom {n}{\nu }}\sum _{k=0}^{n-\nu }{\binom {n-\nu }{k}}(-1)^{n-\nu -k}x^{\nu +k}=\sum _{\ell =\nu }^{n}{\binom {n}{\ell }}{\binom {\ell }{\nu }}(-1)^{\ell -\nu }x^{\ell },}$
and by the inverse binomial transformation, the reverse transformation is[2]
${\displaystyle x^{k}=\sum _{i=0}^{n-k}{\binom {n-k}{i}}{\frac {1}{\binom {n}{i}}}b_{n-i,n}(x)={\frac {1}{\binom {n}{k}}}\sum _{j=k}^{n}{\binom {j}{k}}b_{j,n}(x).}$
• The indefinite integral is given by
${\displaystyle \int b_{\nu ,n}(x)dx={\frac {1}{n+1}}\sum _{j=\nu +1}^{n+1}b_{j,n+1}(x).}$
• The definite integral is constant for a given n:
${\displaystyle \int _{0}^{1}b_{\nu ,n}(x)dx={\frac {1}{n+1}}\quad \ \,{\text{for all }}\nu =0,1,\dots ,n.}$
• If ${\displaystyle n\neq 0}$, then ${\displaystyle b_{\nu ,n}(x)}$ has a unique local maximum on the interval ${\displaystyle [0,\ 1]}$ at ${\displaystyle x={\frac {\nu }{n}}}$. This maximum takes the value
${\displaystyle \nu ^{\nu }n^{-n}\left(n-\nu \right)^{n-\nu }{n \choose \nu }.}$
• The Bernstein basis polynomials of degree ${\displaystyle n}$ form a partition of unity:
${\displaystyle \sum _{\nu =0}^{n}b_{\nu ,n}(x)=\sum _{\nu =0}^{n}{n \choose \nu }x^{\nu }\left(1-x\right)^{n-\nu }=\left(x+\left(1-x\right)\right)^{n}=1.}$
• By taking the first derivative of ${\displaystyle (x+y)^{n}}$ where ${\displaystyle y=1-x}$, it can be shown that
${\displaystyle \sum _{\nu =0}^{n}\nu b_{\nu ,n}(x)=nx.}$
• The second derivative of ${\displaystyle (x+y)^{n}}$ where ${\displaystyle y=1-x}$ can be used to show
${\displaystyle \sum _{\nu =1}^{n}\nu (\nu -1)b_{\nu ,n}(x)=n(n-1)x^{2}.}$
• A Bernstein polynomial can always be written as a linear combination of polynomials of higher degree:
${\displaystyle b_{\nu ,n-1}(x)={\frac {n-\nu }{n}}b_{\nu ,n}(x)+{\frac {\nu +1}{n}}b_{\nu +1,n}(x).}$

## Approximating continuous functions

Let ƒ be a continuous function on the interval [0, 1]. Consider the Bernstein polynomial

${\displaystyle B_{n}(f)(x)=\sum _{\nu =0}^{n}f\left({\frac {\nu }{n}}\right)b_{\nu ,n}(x).}$

It can be shown that

${\displaystyle \lim _{n\to \infty }{B_{n}(f)}=f}$

uniformly on the interval [0, 1].[3] The word uniformly signifies that the polynomial converges on the entire interval [0, 1] at the same rate (or better). This is a more stringent form of convergence than pointwise convergence, which only requires that the limit is achieved at each value of x on [0, 1], with (possibly) separate rates at each point. Specifically, uniform convergence assures that

${\displaystyle \lim _{n\to \infty }\sup \left\{\,\left|f(x)-B_{n}(f)(x)\right|\,:\,0\leq x\leq 1\,\right\}=0.}$

Bernstein polynomials thus provide one way to prove the Weierstrass approximation theorem that every real-valued continuous function on a real interval [a, b] can be uniformly approximated by polynomial functions over ${\displaystyle \mathbb {R} }$.[4]

A more general statement for a function with continuous kth derivative is

${\displaystyle {\left\|B_{n}(f)^{(k)}\right\|}_{\infty }\leq {\frac {(n)_{k}}{n^{k}}}\left\|f^{(k)}\right\|_{\infty }\quad \ {\text{and}}\quad \ \left\|f^{(k)}-B_{n}(f)^{(k)}\right\|_{\infty }\to 0,}$

${\displaystyle {\frac {(n)_{k}}{n^{k}}}=\left(1-{\frac {0}{n}}\right)\left(1-{\frac {1}{n}}\right)\cdots \left(1-{\frac {k-1}{n}}\right)}$

is an eigenvalue of Bn; the corresponding eigenfunction is a polynomial of degree k.

### Proof

Suppose K is a random variable distributed as the number of successes in n independent Bernoulli trials with probability x of success on each trial; in other words, K has a binomial distribution with parameters n and x. Then we have the expected value ${\displaystyle \operatorname {\mathcal {E}} \left[{\frac {K}{n}}\right]=x\ }$ and

${\displaystyle p(K)={n \choose K}x^{K}\left(1-x\right)^{n-K}=b_{K,n}(x)}$
${\displaystyle \lim _{n\to \infty }{P\left(\left|{\frac {K}{n}}-x\right|>\delta \right)}=0}$

for every δ > 0. Moreover, this relation holds uniformly in x, which can be seen from its proof via Chebyshev's inequality, taking into account that the variance of 1n K, equal to 1n x(1x), is bounded from above by 1(4n) irrespective of x.

Because ƒ, being continuous on a closed bounded interval, must be uniformly continuous on that interval, one infers a statement of the form

${\displaystyle \lim _{n\to \infty }{P\left(\left|f\left({\frac {K}{n}}\right)-f\left(x\right)\right|>\varepsilon \right)}=0}$

uniformly in x. Taking into account that ƒ is bounded (on the given interval) one gets for the expectation

${\displaystyle \lim _{n\to \infty }{\operatorname {\mathcal {E}} \left(\left|f\left({\frac {K}{n}}\right)-f\left(x\right)\right|\right)}=0}$

uniformly in x. To this end one splits the sum for the expectation in two parts. On one part the difference does not exceed ε; this part cannot contribute more than ε. On the other part the difference exceeds ε, but does not exceed 2M, where M is an upper bound for |ƒ(x)|; this part cannot contribute more than 2M times the small probability that the difference exceeds ε.

Finally, one observes that the absolute value of the difference between expectations never exceeds the expectation of the absolute value of the difference, and

${\displaystyle \operatorname {\mathcal {E}} \left[f\left({\frac {K}{n}}\right)\right]=\sum _{K=0}^{n}f\left({\frac {K}{n}}\right)p(K)=\sum _{K=0}^{n}f\left({\frac {K}{n}}\right)b_{K,n}(x)=B_{n}(f)(x)}$

See for instance Koralov & Sinai (2007).[5]