# Calculating $\sum_{k=1}^\infty \frac{k^2}{2^k}=\frac{1}{2}+\frac{4}{4}+\frac{9}{8}+\frac{16}{16}+\frac{25}{32}+\cdots+\frac{k^2}{2^k}+\cdots$ [duplicate]

I want to know the value of $$\sum_{k=1}^\infty \frac{k^2}{2^k}=\frac{1}{2}+\frac{4}{4}+\frac{9}{8}+\frac{16}{16}+\frac{25}{32}+\cdots+\frac{k^2}{2^k}+\cdots$$ I added up to $k=50$ and got the value $5.999999999997597$, so it seems that it converges to $6.$ But, I don't know how to get the exact value. Is there any other simple method to calculate it?

## marked as duplicate by Martin R, Hans Lundmark, Lord Shark the Unknown, Claude Leibovici, draks ...May 29 '17 at 8:42

If we start with the power series $$\sum_{k=0}^{\infty}x^k=\frac{1}{1-x}$$ (valid for $|x|<1$) and differentiate then multiply by $x$, we get $$\sum_{k=1}^{\infty}kx^k=\frac{x}{(1-x)^2}$$ If we once again differentiate then multiply by $x$, the result is $$\sum_{k=1}^{\infty}k^2x^k=\frac{x(x+1)}{(1-x)^3}$$ and setting $x=\frac{1}{2}$ shows that $$\sum_{k=1}^{\infty}k^22^{-k}=\frac{\frac{3}{4}}{\frac{1}{8}}=6$$ as you guessed.
Start with the geometric series $\frac{1}{1-x} = \sum_i x^i$. Differentiate it once to get $\frac{d}{dx} \left[ \frac{1}{1-x} \right] = \frac{d}{dx} \sum_i x^i = \sum_i i x^{i-1}$. Differentiate again to get $\frac{d^2}{dx^2} \left[ \frac{1}{1-x} \right] = \frac{d^2}{dx^2} \sum_i x^i = \sum_i i (i-1) x^{i-2}$.
Now, plug in $x= \frac{1}{2}$ and adjust indices in teh summations.
Alternatively, note that if $T = \sum_{k \geq 0}k^2 2^{-k}$ then $$T = 2T-T = \sum_{k\geq 0}\frac{2k+1}{2^k} = 2\sum_{k \geq 0}\frac{k}{2^k} + \sum_{k \geq 0}2^{-k}$$
But we can let $S= \sum_{k \geq 0}k2^{-k}$ and note that $$S = 2S-S = \sum_{k\geq 0}2^{-k} = 2.$$
Hence $T = 2\cdot 2 + 2 = 6.$