Property of Bernstein polynomial $\sum_{k=0}^n k^2 B_{n,k} (x) $ $= n(n-1)x^2+nx$ Actually, I have to show:
$$ \sum_{k=0}^n B_{n,k} (x) =1 $$
$$ \sum_{k=0}^n \frac{k}{n} B_{n,k} (x) =x $$
$$ \sum_{k=0}^n \frac{k^2}{n^2} B_{n,k} (x) =x^2+ \frac{1}{n}x(1-x) $$
So the first two claims were easy, but I failed to show the last one.
Remark: $B_{n,k}$ = $\frac{n!}{k!(n-k)!} x^k(1-x)^{n-k}$.
$ \sum_{k=0}^n \frac{k^2}{n^2} B_{n,k} (x) $ = $\frac{1}{n^2} \sum_{k=0}^n k^2 B_{n,k} (x) $ . Is there a trick for $\sum_{k=0}^n k^2 B_{n,k} (x) $ ? Found in another question that $\sum_{k=0}^nk^2B_{n,k}(x)=n(n-1)x^2+nx $, but why?
 A: Evaluating the identity in the title we seek
$$\sum_{k=0}^n k^2 {n\choose k} x^k (1-x)^{n-k}.$$
This is a polyonomial of degree $n$ in $x$ from which we may
extract coefficients with $0\le q\le n$:
$$[x^q] \sum_{k=0}^n k^2 {n\choose k} x^k (1-x)^{n-k}
= \sum_{k=0}^q k^2 {n\choose k} [x^{q-k}] (1-x)^{n-k}
\\ = \sum_{k=0}^q k^2 {n\choose k} (-1)^{q-k} {n-k\choose q-k}
\\ = \sum_{k=2}^q k(k-1) {n\choose k} (-1)^{q-k} {n-k\choose q-k}
+ \sum_{k=1}^q k {n\choose k} (-1)^{q-k} {n-k\choose q-k}
\\ = n(n-1) \sum_{k=2}^q {n-2\choose k-2} (-1)^{q-k} {n-k\choose q-k}
+ n \sum_{k=1}^q {n-1\choose k-1} (-1)^{q-k} {n-k\choose q-k}.$$
We get for the first piece
$$n(n-1) \sum_{k=2}^q {n-2\choose k-2} (-1)^{q-k}
[z^{q-k}] (1+z)^{n-k}
\\ = n(n-1) [z^q] \sum_{k=2}^q {n-2\choose k-2} (-1)^{q-k}
z^k (1+z)^{n-k}.$$
Now here we may extend $k$ beyond $q$ as there is no contribution to
the coefficient extractor:
$$n(n-1) [z^q] \sum_{k=2}^n {n-2\choose k-2} (-1)^{q-k}
z^k (1+z)^{n-k}
\\ = n(n-1) [z^q] (-1)^q z^2 (1+z)^{n-2}
\sum_{k=2}^n {n-2\choose k-2} (-1)^{k-2}
z^{k-2} (1+z)^{-(k-2)}
\\ = n(n-1) [z^q] (-1)^q z^2 (1+z)^{n-2}
\left(1-\frac{z}{1+z}\right)^{n-2}
= n(n-1) [z^q] (-1)^q z^2.$$
This is $$n(n-1) \times [[q=2]].$$
We get for the second piece
$$n [z^q] \sum_{k=1}^n {n-1\choose k-1} (-1)^{q-k}
z^k (1+z)^{n-k}
\\ = - n [z^q] (-1)^q z (1+z)^{n-1}
\sum_{k=1}^n {n-1\choose k-1} (-1)^{k-1}
z^{k-1} (1+z)^{-(k-1)}
\\ = - n [z^q] (-1)^q z (1+z)^{n-1}
\left(1-\frac{z}{1+z}\right)^{n-1}
= - n [z^q] (-1)^q z.$$
This is $$n \times [[q=1]].$$
Collecting the two contributions we get
$$n(n-1)x^2 + nx$$ as claimed.
A: Note that for $0<x<1$, $B_{n,k}(x)=P(X=k)$ where $X$ is a binomial random
variable with parameters $n$ and $x$. Then
$$\sum_{k=0}^n B_{n,k}k^r=E(X^r),$$
the expectation of $X^r$. Knowing the mean and variance the binomial
variable $X$ are $nx$ and $nx(1-x)$ gives $E(X)=nx$ and
$$E(X^2)=\text{Var}(X)+E(X)^2=nx(1-x)+n^2x^2.$$
Even though I assumed $0<x<1$, the formulae remain valid for all real $x$.
A: Define the linear functional transform $\;D_x[f(x)] := x f'(x).\;$ Clearly, $D_x[ x^n ] = n x^n.\;$ The binomial theorem
states that
$$ \sum_{k=0}^n B_{n,k}(x,y) = \sum_{k=0}^n \frac{n!}{k!(n-k)!} x^k y^{n-k} = (x+y)^n.$$
Apply $\;D_x\;$ to both sides to get
$$ \sum_{k=0}^n k\; B_{n,k}(x,y) = \sum_{k=0}^n k\; {n \choose k}\;x^k y^{n-k} =n x (x+y)^{n-1}.$$
Dividing both sides by $\;n\;$ we get
$$\sum_{k=0}^n (k/n)\; B_{n,k} (x,y) = x(x+y)^{n-1}.\;$$
Apply $\;D_x\;$ and divide both sides by $\;n\;$ again to get
$$\sum_{k=0}^n (k/n)^2 B_{n,k} (x,y) =x(x+y)^{n-2}(x+y/n).\;$$
The results you want follow from letting $\;y = 1-x.\;$
