Show with induction that $\sum_{k=1}^{n} \frac{k^{2}}{2^{k}} = 6 - \frac{n^2+4n+6}{2^{n}}$ Show with induction that
$\sum_{k=1}^{n} \frac{k^{2}}{2^{k}} = 6 - \frac{n^2+4n+6}{2^{n}}$
n = 1
$LHS = \frac{1}{2}$
$RHS = 6 - \frac{1+4+6}{2} = \frac{1}{2}$
n = p
$LHS_{p} = \frac{1^{2}}{2^{1}} + \frac{2^{2}}{2^{2}} + \frac{3^{2}}{2^{3}} + ... \frac{p^{2}}{2^{p}}$
$RHS_{p} = 6 - \frac{P^2+4p+6}{2^{p}}$
n = p + 1
$LHS_{p+1} = \frac{1^{2}}{2^{1}} + \frac{2^{2}}{2^{2}} + \frac{3^{2}}{2^{3}} + ... \frac{p^{2}}{2^{p}} + \frac{(p+1)^{2}}{2^{(p+1)}}$
$RHS_{p+1} = 6 - \frac{(p+1)^2+4(p+1)+6}{2^{(p+1)}}$
Show that, $RHS_{p+1} = RHS +  \frac{(p+1)^{2}}{2^{(p+1)}}$
$6 - \frac{(p+1)^2-4(p+1)+6}{2^{(p+1)}} =  6 - \frac{P^2+4p+6}{2^{p}} + \frac{(p+1)^{2}}{2^{(p+1)}}$
 A: I will assume the correct formula is:
$$\sum_{k=1}^n \dfrac{k^2}{2^k} = 6-\dfrac{n^2+4n+6}{2^n}$$
Assume this is true for $n=p$ and try to prove for $n=p+1$:
$$\begin{align*}\sum_{k=1}^{p+1} \dfrac{k^2}{2^k} & = \sum_{k=1}^p \dfrac{k^2}{2^k} + \dfrac{(p+1)^2}{2^{p+1}} \\ & = 6-\dfrac{p^2+4p+6}{2^p}+\dfrac{(p+1)^2}{2^{p+1}} \qquad \text{ by the induction assumption}\\& = 6-\dfrac{p^2+4p+6}{2^p}\cdot \dfrac{2}{2} - \left(-\dfrac{p^2+2p+1}{2^{p+1}}\right) \\ & = 6 - \dfrac{2p^2+8p+12}{2^{p+1}} -\left(- \dfrac{p^2+2p+1}{2^{p+1}}\right) \\ & = 6 - \left( \dfrac{2p^2+8p+12}{2^{p+1}} - \dfrac{p^2+2p+1}{2^{p+1}}\right) \\ & = 6 - \dfrac{2p^2+8p+12-(p^2+2p+1)}{2^{p+1}} \\ & = 6 - \dfrac{p^2+6p+11}{2^{p+1}} \\ & = 6 - \dfrac{(p^2+2p+1)+(4p+4)+6}{2^{p+1}} \\ & = 6 - \dfrac{(p+1)^2+4(p+1)+6}{2^{p+1}}\end{align*}$$
A: Hint: The left-hand side is given by $$\frac{(k+1)^2}{2^{k+1}}-\frac{k^2-4k+6}{2^k}=-2^{-k-1} \left(k^2-10 k+11\right)$$
and the right-hand side: $$-{\frac {{k}^{2}-2\,k+3}{{2}^{k+1}}}$$ so your formula is not true.
