Determining Convergence of Power Series 
Flip a fair coin until you get the first "head".  Let X represent the number of flips before the first head appears.  Calculate E[X].

So I solved this problem and you get a power series:
$E[X] = 1*0.5 + 2*0.5^2 + 3*0.5^3+ ...$
This is basically of the form $\sum\limits_{i=0}^{\infty}x_i(0.5)^i.$
I flipped open my calculus book to review how to solve this series but I didn't find anything on how to calculate the limiting value for a power series, just the radius of convergence.  
I see for a sum of infinite geometric series, the value is:
$S_n = a+ ax + ax^2 + ... + ax^n + ... = \cfrac{a}{1-x}$ for |x| < 1.
Can someone please tell me the general approach if there is one for a power series?  
Thank you in advance.
 A: We give an alternative way to do the calculation. The expectation exists, since the series converges. Let it be $a$. On your first toss, two things can happen: (i) You get a head, so $X=1$ or (ii) You get a tail, have wasted a toss, and your expected number of additional tosses is $a$. So with probability $0.5$, your expectation is $1$, and with probability $0.5$ it is $1+a$. It follows that
$$a=(0.5)(1)+(0.5)(1+a).$$
Solve this linear equation for $a$. We get $a=2$.
Remark: We interpreted the phrase "before the first head appears" in the conventional sense, where the successful toss is counted. If we interpret before as meaning strictly before, the power series expression becomes a little nicer, and the mean turns out to be $1$.
A: The general approach to this kind of problem is to sum the series by repeated differentiation and multiplication.  This should produce a solution to any series of the form $\sum_{n=0}^{\infty}n^k x^n$, and, therefore, any series of the form $\sum_{n=0}^{\infty}p(n)x^n$ .  As an example, let's solve your specific series, $\sum_{n=0}^{\infty}nx^n$.  To solve this, recall the formula for a simple geometric series:
$$\sum_{n=0}^{\infty}x^n=\frac1{1-x}$$
Now, differentiate both sides with respect to x to get:
$$\sum_{n=0}^{\infty}nx^{n-1}=\frac1{(1-x)^2}$$
Next, multiply both sides by x, and we have:
$$\sum_{n=0}^{\infty}nx^{n}=\frac x{(1-x)^2}$$
Finally, substitute in $x=1/2$ to get $E[X]=2$, which is the correct result for the expectation of a geometric distribution with p=0.5.
Does that answer your question?  
