Closed form of $\sum_{k=0}^{n}k\cdot2^{n-k}$ I am interested in solving the recurrence relation using iterative method. I know how to solve it using generating function and another method using solution of associated linear homogeneous recurrence relation and particular solution described in Rosen's Discrete Math book. I came up with some summation (below) but I don't know how to find its closed form. I checked WolframAlpha and it provided me with this $$\sum_{k=0}^{n}k\cdot2^{n-k}=-n+2^{n+1}-2$$ How to show this?

HINT:
$$\sum_{k=0}^nk2^{n-k}=2^n\sum_{k=0}^nk\left(\frac12\right)^k\;,$$
so you’re done if you can evaluate
$$f(x)=\sum_{k=0}^nkx^k$$
at $x=\frac12$. Start with $g(x)=\sum_{k=0}^nx^k$, differentiate, and multiply by $x$. (I’m assuming that you know a closed form for $g(x)$.)
