Proving $\sum^n_{k=0} k^2 {n\choose k} = (n+n^2)2^{n-2}$ We can start with the expression of the binomial expansion, $\sum^n_{k=0} {n\choose k} x^ky^{n-k}= (x+y)^n$. Setting $x=y=1$ gives $\sum^n_{k=0} {n\choose k} = 2^n$
Differentiating both sides with respect to $x$ gives $\sum^n_{k=0} k{n\choose k} x^{k-1}y^{n-k} = n(x+y)^{n-1}$, and substituting $x=y=1$ gives $\sum^n_{k=0} k{n\choose k} = n2^{n-1}$
Differentiating again gives $\sum^n_{k=0} k^2{n\choose k} x^{k-2}y^{n-k} = (n^2-n)(x+y)^{n-2}$, and substituting $x=y=1$ gives $$\sum^n_{k=0} k^2{n\choose k} = (n^2-n)2^{n-2}$$
However, the identity is $$\sum^n_{k=0} k^2{n\choose k} = (n^2+n)2^{n-2}$$
I don't seem to have lost a sign somewhere, where is my mistake?

For a combinatorial proof, count committees of any size chosen from $n$ people, including a secretary and a treasurer, where these two roles might be the same person.  The LHS conditions on the size $k$ of the committee, choosing the members in $\binom{n}{k}$ ways and then choosing one of these $k$ to be the secretary and one of these $k$ to be the treasurer.  For the RHS, choose either one secretary-treasurer and $n-1$ other members or one secretary, one treasurer (different than the secretary), and $n-2$ other members, yielding
$$n 2^{n-1} + n(n-1) 2^{n-2} = (n^2+n)2^{n-2}.$$
