TITLE: Induction: $\sum_{k=0}^n \binom nk k^2 = n(1+n)2^{n-2}$
QUESTION [23 upvotes]: I found crazy (for me at least) induction example, in fact it just would be nice to prove. (Even have problems with starting) Any hints are highly valued: $$0^2\binom{n}{0}+1^2\binom{n}{1}+2^2\binom{n}{2}+\cdots+n^2\binom{n}{n}=n(1+n)2^{n-2} $$

REPLY [8 votes]: Although a year late, here is a proof using the properties
$$
k\binom{n}{k}=n\binom{n-1}{k-1}\tag{1}
$$
and
$$
\sum_{k=0}^n\binom{n}{k}=2^n\tag{2}
$$
Thus,
$$
\begin{align}
\sum_{k=0}^nk^2\binom{n}{k}
&=\sum_{k=0}^nnk\binom{n-1}{k-1}\tag{3}\\
&=\sum_{k=0}^nn\binom{n-1}{k-1}+\sum_{k=0}^nn(k-1)\binom{n-1}{k-1}\tag{4}\\
&=\sum_{k=0}^nn\binom{n-1}{k-1}+\sum_{k=0}^nn(n-1)\binom{n-2}{k-2}\tag{5}\\
&=n2^{n-1}+n(n-1)2^{n-2}\tag{6}\\[9pt]
&=n(n+1)2^{n-2}\tag{7}
\end{align}
$$
Explanation:
$(3)$: apply $(1)$
$(4)$: $k=1+(k-1)$
$(5)$: apply $(1)$
$(6)$: apply $(2)$ to both sums
$(7)$: $2n+n(n-1)=n(n+1)$