<s>[INST] How to compute the  formula $\sum  \limits_{r=1}^d r \cdot 2^r$? Given $$1\cdot 2^1 + 2\cdot 2^2 + 3\cdot 2^3 + 4\cdot 2^4 + \cdots + d \cdot 2^d = \sum_{r=1}^d r \cdot 2^r,$$
how can we infer to the following solution? $$2 (d-1) \cdot 2^d + 2. $$
Thank you
 [/INST] As noted above, observe that
\begin{eqnarray}
\sum_{r = 1}^{d} x^{r} = \frac{x(x^{d} - 1)}{x - 1}.
\end{eqnarray}
Differentiating both sides and multiplying by $x$, we find
\begin{eqnarray}
\sum_{r = 1}^{d} r x^{r} = \frac{dx^{d + 2} - x^{d+1}(d+1) + x}{(x - 1)^{2}}.
\end{eqnarray}
Substituting $x = 2$, 
\begin{eqnarray}
\sum_{r = 1}^{d} r 2^{r} =  d2^{d + 2} - (d+1) 2^{d+1} + 2 = (d - 1) 2^{d+1} + 2.
\end{eqnarray}
</s>