How to obtain the sum of the following series? $\sum_{n=1}^\infty{\frac{n^2}{2^n}}$ It seems that I'm missing something about this. 
First of all, the series is convergent: $\lim_{n\rightarrow\infty}\frac{2^{-n-1} (n+1)^2}{2^{-n} n^2}=\frac{1}{2}$ (ratio test)
What I tried to do is to find a limit of a partial sum $\lim_{n\rightarrow\infty}S_n$ as follows: $S_n=\frac{\frac{1}{6} n (n+1) (2 n+1)}{\frac{1-\left(\frac{1}{2}\right)^n}{2 \left(1-\frac{1}{2}\right)}}$. Still, the limit is $\infty$ and I'm clearly doing something wrong.

$$
\begin{align}
\sum_{n=0}^\infty x^n=\frac1{1-x}&\implies\sum_{n=0}^\infty\frac1{2^n}=2\tag{1}\\
\sum_{n=0}^\infty nx^{n-1}=\frac1{(1-x)^2}&\implies\sum_{n=0}^\infty\frac{n}{2^{n-1}}=4\tag{2}\\
\sum_{n=0}^\infty n(n-1)x^{n-2}=\frac2{(1-x)^3}&\implies\sum_{n=0}^\infty\frac{n(n-1)}{2^{n-2}}=16\tag{3}
\end{align}
$$
Adding $\color{#CCC}{x^2=}\frac14$ times $(3)$ to $\color{#CCC}{x=}\frac12$ times $(2)$ gives
$$
\color{#CCC}{\sum_{n=0}^\infty n^2x^n=\frac{x(1+x)}{(1-x)^3}\implies}\sum_{n=0}^\infty\frac{n^2}{2^n}=6\tag{4}
$$
