# Double summation to find a closed-form formula

I am having trouble using a double summation and rearranging it to find a closed-form formula for the following summation: $$\sum_{i=0}^n i3^i$$

Do I write the double summation like: $$\sum_{i=1}^n \sum_{k=1}^ik3^k$$

And rearrange it like: $$\sum_{i=1}^n k\sum_{k=1}^i3^k$$

And then write the closed-form solution for each individual summation and reduce?

• Hint: $(\sum_{i=1}^n x^k)' = \sum_{i=1}^n kx^{k-1}$ – ninjaaa Aug 23 '16 at 5:26

$$\sum_{i=1}^n i3^i=3+2\times3^2+3\times3^3+...+n\times3^n=(3+3^2+...+3^n)+(3^2+3^3+...+3^n)+...+3^n=\sum_{i=1}^n \sum_{k=i}^n3^k=\sum_{i=1}^n\frac{3^i-3^{n+1}}{1-3}=\frac{1}{2}\sum_{i=1}^n(3^{n+1}-3^i)=\frac{1}{2}(n3^{n+1}-\frac{3-3^{n+1}}{1-3})=\frac{1}{2}(n3^{n+1}-\frac{3}{2}(3^n-1))$$
$$\sum_{i=1}^{n}\sum_{k=1}^{i}k3^{k}=\frac{((n-1)3^{n+1}+n+3)3}{4}$$