<s>[INST] 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.
 [/INST] Suppose $|x|<1$ at the last you put $x=\frac12$
$$s_1=1+x+x^2+x^3+x^4+...=\frac{1}{1-x}$$nw find $s'_1$
$$s'_1=0+1+2x+3x^3+4x^3+5x^4+...+nx^{n-1}+...=(\frac{1}{1-x})'\\1+2x+3x^2+4x^3+...=\frac{1}{(1-x)^2}$$now multiply by $x$
$$S_2=xS'_1=x^1+2x^2+3x^3+4x^4+5x^5+...=\frac{x}{(1-x)^2}$$
now find $S_2'$
$$S'_2=1+2^2x^1+3^2x^2+4^2x^3+5^2x^4+...+(n^2x^{n-1})+...=(\frac{x}{(1-x)^2})'$$finally :multiply by $x$
$$xS'_2=1^2x+2^2x^2+3^2x^3+4^2x^4+...(n^2x^n)+...=x(\frac{x}{(1-x)^2})'\\
\sum_{n=2}^{\infty}n^2x^n=x(\frac{x}{(1-x)^2})'-x$$put $x=\frac12$
$$\sum_{n=2}^{\infty}n^2(\frac{1}{2})^n=\sum_{n=2}^{\infty}\frac{n^2}{2^n}$$
for adjustment $$\sum_{n=2}^{\infty}\frac{n^2}{2^n}=(\sum_{n=1}^{\infty}\frac{n^2}{2^n} )-\frac{1^2}{2^1}$$ you can find $$x(\frac{x}{(1-x)^2})'-x$$ then put $x=\frac12$
</s>