How to prove $\sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6$?
First observe that the sum converges (by, say, the root test).
We already know that $\displaystyle R := \sum_{n=0}^\infty \frac{1}{2^n} = 2$.
Let $S$ be the given sum. Then $\displaystyle S = 2S - S = \sum_{n=0}^\infty \frac{2n+1}{2^n}$.
Now use the same trick to compute $\displaystyle T := \sum_{n=0}^\infty \frac{n}{2^n}$: we have $\displaystyle T = 2T - T = \sum_{n=0}^\infty \frac{1}{2^n} = R = 2$. Hence $S = 2T + R = 6$.
One can continue like this to compute $\displaystyle X:= \sum_{n=0}^\infty \frac{n^3}{2^n}$. We have $\displaystyle X = 2X-X = \sum_{n=0}^\infty \frac{3n^2+3n+1}{2^n} = 3S+3T+R = 26$. Sums with larger powers can be computed in the same way.
If Calculus is allowed, using infinite geometric series formula for $|r|<1$ $$\sum_{0\le n<\infty}r^n=\frac1{1-r}$$
Differentiating wrt $r$ $$\sum_{0\le n<\infty}nr^{n-1}=\frac1{(1-r)^2}$$
$$\implies \sum_{0\le n<\infty}nr^n=\frac r{(1-r)^2}=\frac{1-(1-r)}{(1-r)^2}=\frac1{(1-r)^2}-\frac1{(1-r)}$$
Differentiating wrt $r$ (fixed sign error!)
$$\implies \sum_{0\le n<\infty}n^2r^{n-1}=\frac2{(1-r)^3}-\frac1{(1-r)^2}$$
$$\implies \sum_{0\le n<\infty}n^2r^n=\frac{2r}{(1-r)^3}-\frac r{(1-r)^2}$$
Here $\displaystyle r=\frac12$
Consider $$ \frac{1}{1-z} = \sum_{n=0}^{\infty} z^n $$ Differentiating and multiplying by $z$, one has $$ \frac{z}{(1-z)^2} = z\sum_{n=1}^{\infty} nz^{n-1} = \sum_{n=1}^{\infty} nz^n $$ Repeating the above process, $$ \sum_{n=1}^{\infty} n^2z^n = \frac{z(1+z)}{(1-z)^3} $$ Now plug in $z=1/2$