Calculating the sum of $f(x) = \sum_{n=0}^{\infty} {n \cdot 2^n \cdot x^n}$

Solution 1:

$$\sum_{n=1}^\infty nt^n=t\frac{d}{dt}\left(\sum_{n=1}^\infty t^n\right)=t\frac{d}{dt}\left(\frac{t}{1-t}\right)=\frac{t}{(1-t)^2}$$

Now with $t=2x$ we find $$\sum_{n=1}^\infty n(2x)^n=\frac{2x}{(1-2x)^2}$$

Solution 2:

I believe you can sum the series at the point you left off, $$ \frac{\int f(x) dx}{x} = 1 + 2x + (2x)^2 + (2x)^3 + ... = \frac{1}{1-2x} $$ So, we work back to $f$ by itself, $$ \int f(x) dx = \frac{x}{1-2x} $$ We take derivatives, $$ f(x) = \frac{(1-2x) - x (-2)}{(1-2x)^2} = \frac{1}{(1-2x)^2} $$