Let's say we have
$$
f(r) = \sum_{n=0}^{\infty}r^{n}
$$
Of course, in order for this to make sense we require ${|r|<1}$. So our function is only defined on ${(-1,1)}$. Now, let's take the derivative:
$$
\frac{df}{dr}=\frac{d}{dr}\sum_{n=0}^{\infty}r^n
$$
Now here's the question: can you interchange the sum and derivative operator here? In other words, is it true that
$$
\frac{d}{dr}\sum_{n=0}^{\infty}r^n =^{?} \sum_{n=0}^{\infty}\frac{d}{dr}r^n
$$
in this case - the answer is yes. But this is not always true for a general series involving functions. I'd suggest researching the conditions necessary for doing such interchange for future reference, but for now you can take my word in this case it's okay to do so.
So we get
$$
\frac{df}{dr}=\sum_{n=0}^{\infty}\frac{d}{dr}r^n = \sum_{n=0}^{\infty}nr^{n-1}
$$
The cool thing is, we know an alternative representation for ${f(r)}$. That is
$$
f(r) = \sum_{n=0}^{\infty}r^n = \frac{1}{1-r}
$$
This tells us
$$
\frac{df}{dr}=\sum_{n=0}^{\infty}nr^{n-1} = \frac{d}{dr}\left(\frac{1}{1-r}\right)
$$
Using this knowledge, are you now able to show that
$$
\sum_{n=0}^{\infty}n\frac{1}{2^n} = 2
$$
?