<s>[INST] How to find the sum of the following series How can I find the sum of the following series?
$$
\sum_{n=0}^{+\infty}\frac{n^2}{2^n}
$$
I know that it converges, and Wolfram Alpha tells me that its sum is 6 .
Which technique should I use to prove that the sum is 6?
 [/INST] You can also apply the formula for the sum of a geometric series three times in a row :
$$\begin{array}{rcl}
\sum_{n=1}^\infty \frac{n^2}{2^n} 
&=& \sum_{n=1}^\infty (2n-1) \sum_{k=n}^\infty \frac{1}{2^k}  
= \sum_{n=1}^\infty \frac{2n-1}{2^{n-1}} \\
&=& \sum_{k=0}^\infty \frac{1}{2^k} + \sum_{n=1}^\infty 2 \sum_{k=n}^\infty \frac{1}{2^k} 
\\ &=& 2 + \sum_{n=1}^\infty \frac{2}{2^{n-1}} \\
&= & 2 + 2 \cdot 2 = 6 \end{array}$$
Also, if cutting up those geometric series is too hard, there is an easier way to do the same thing :
$$\begin{array}{rcl}
(1-\frac{1}{2})^3 \cdot \sum_{n=1}^\infty \frac{n^2}{2^n} & = &
(1-\frac{1}{2})^2 \cdot \sum_{n=1}^\infty \frac{n^2-(n-1)^2}{2^n} =
(1-\frac{1}{2})^2 \cdot \sum_{n=1}^\infty \frac{2n-1}{2^n} \\
&=& (1-\frac{1}{2}) \cdot \left(\frac{1}{2} + \sum_{n=2}^\infty \frac{(2n-1)-(2n-3)}{2^n} \right) \\
&=& (1-\frac{1}{2}) \cdot \left(\frac{1}{2} + \sum_{n=2}^\infty \frac{2}{2^n} \right) \\
&=& \frac{1}{4} + \frac{2}{4} = \frac{3}{4} = \left(1-\frac{1}{2} \right)^3 \cdot 6
\end{array}$$
</s>