How to prove $\sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6$? I'd like to find out why
\begin{align}
\sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6
\end{align}
I tried to rewrite it into a geometric series
\begin{align}
\sum_{n=0}^{\infty} \frac{n^2}{2^n} = \sum_{n=0}^{\infty} \Big(\frac{1}{2}\Big)^nn^2
\end{align}
But I don't know what to do with the $n^2$. 

First we compute the sum $S_1=\sum_{n=1}^\infty \frac{n}{2^n}$ using the identity $n=\sum_{k=1}^n1$ $$S_1=\sum_{n=1}^\infty \frac{n}{2^n}=\sum_{n=1}^\infty \sum_{k=1}^n \frac{1}{2^n}=\sum_{ k \leq n }\frac{1}{2^n}=\sum_{k=1}^\infty \sum_{n=k}^\infty \frac{1}{2^n}=\sum_{k=1}^\infty \frac{1/2^k}{1-1/2}=2 \sum_{k=1}^\infty \frac{1}{2^k}=2. $$
Next we compute the sum $S_2=\sum_{n=1}^\infty \frac{n+n^2}{2^{n+1}}$ using the identity $\frac{n+n^2}{2}=\sum_{k=1}^n k$
$$S_2=\sum_{n=1}^\infty \sum_{k=1}^n \frac{k}{2^n}=\sum_{k \leq n} \frac{k}{2^n}=\sum_{k=1}^\infty \sum_{n=k}^\infty \frac{k}{2^n}=\sum_{k=1}^\infty k \frac{1/2^k}{1-1/2}=2 \sum_{k=1}^\infty \frac{k}{2^k}=2S_1=4. $$
Finally the desired sum is $S=2S_2-S_1=6$.
