Summation by parts of $\sum_{k=0}^{n}k^{2}2^{k}$

You wrongly calculated the difference of $x^2$. Plug it directly into the definition.

(And you can always check your calculation by looking at small values of $n$. In particular, you should have 0 for $n=0$. To locate the error, "binary search" is advisable: Put $n=0$ somewhere in the middle to see if the error was in the first half or the second half, etc.)


I calculated it again by pen and paper after letting a little time passing. And I got it! I made some basic mistakes, which I am ashamed of now, that I see them. But you learn by any *kind* of mistakes, don't ya? ;-)

Here the correct calculation:

First I calculated

\begin{equation*} \sum_{k=0}^{n} k 2^{k} \end{equation*}

by summation by parts. I chose $x=u$ and $\Delta 2^x=v$. This gave me $\Delta x=1$ and $v=2^x$. I see the descrete integration of $2^x$ behaves like the analytical integration of $e^x$. (I hope the vocabular I used here is correct, English is not my native language. :-))

$$ \begin{eqnarray*} \sum_{k=0}^{n} k 2^{k} &=& \sum_{0}^{n+1}x2^{x} \\ &=& \left[x2^{x}\right]_{0}^{n+1}-\sum_{0}^{n+1}2^{x+1}\cdot 1 \\ &=& \left(n+1\right)2^{n+1}-2\sum_{0}^{n+1}2^{x} \\ &=& \left(n+1\right)2^{n+1}-2\left(2^{n+1}-1\right) \\ &=& n2^{n+1}+2^{n+1}-2\cdot2^{n+1}+2 \\ &=& n2^{n+1}-2^{n+1}+2 \\ &=& 2^{n+1}\left(n-1\right)+2 \end{eqnarray*} $$ Now I can evaluate

\begin{equation*} \sum_{k=0}^{n} k^2 2^{k} \end{equation*}

For that I chose $x^2=u$ and $\Delta 2^x=v$. This gave me $\Delta x=2x+1$ and $v=2^x$. Now summation by parts and some basic calculations yields

$$ \begin{eqnarray*} \sum_{k=0}^{n}k^{2}2^{k} &=& \sum_{0}^{n+1}x^{2}2^{x} \\ &=& \left[x^{2}2^{x}\right]_{0}^{n+1}-\sum_{0}^{n+1}2^{x+1}\left(2x+1\right) \\ &=& \left(n+1\right)^{2}2^{n+1}-\left(\sum_{0}^{n+1}2x2^{x+1}+2^{x+1}\right) \\ &=& \left(n^{2}+2n+1\right)2^{n+1}-\left(4\sum_{0}^{n+1}x2^{x}+2\sum_{0}^{n+1}2^{x}\right)\\ &=& \left(n^{2}+2n+1\right)2^{n+1}-\left(4\left(\left(n-1\right)2^{n+1}+2\right)+2\left[2^{x}\right]_{0}^{n+1}\right) \\ &=& \left(n^{2}+2n+1\right)2^{n+1}-\left(4\left(\left(n-1\right)2^{n+1}+2\right)+2\left(2^{n+1}-1\right)\right) \\ &=& \left(n^{2}+2n+1\right)2^{n+1}-\left(4\left(\left(n2^{n+1}-2^{n+1}\right)+2\right)+2\cdot2^{n+1}-2\right) \\ &=& \left(n^{2}+2n+1\right)2^{n+1}-\left(4\left(n2^{n+1}-2^{n+1}\right)+8+2\cdot2^{n+1}-2\right) \\ &=& \left(n^{2}+2n+1\right)2^{n+1}-\left(4n2^{n+1}-42^{n+1}+8+2\cdot2^{n+1}-2\right) \\ &=& \left(n^{2}+2n+1\right)2^{n+1}-4n2^{n+1}+42^{n+1}-8-2\cdot2^{n+1}+2 \\ &=& 2^{n+1}\left(\left(n^{2}+2n+1\right)-4n+4-2\right)-8+2 \\ &=& 2^{n+1}\left(n^{2}-2n+3\right)-6 \\ &=& 2^{n+1}\left((n-2)n+3\right)-6 \end{eqnarray*} $$

which is exacly what WolframAlpha proclaims. Thanks to anyone who suggested corrections. :-)

Tags:

Summation