Sum of a weird almost-geometric series: $\frac{1}{365}\sum_{x=1}^{\infty} x\left(\frac{364}{365}\right)^{x-1}$ I've taken Calc 2 before, so I'm sure I've seen this, but it's coming up in some probability homework and I'm having trouble with it. I've looked around the internet a bunch, and I see examples of things similar to this, but not quite this.

$$\frac{1}{365}\sum_{x=1}^{\infty} x\left(\frac{364}{365}\right)^{x-1}$$

Looking at wolfram alpha and such, I know it's 365, because the sum comes out as $365^2$, but I'm having trouble figuring out why. Which really sucks because then immediately after figuring that out, I need to move onto figuring out
$$\left(\frac{1}{365}\sum_{x=1}^{\infty} (x^2)(\frac{364}{365})^{x-1}\right) - \left(\frac{1}{365}\sum_{x=1}^{\infty} x(\frac{364}{365})^{x-1}\right)^2.$$
Like I say, I have no trouble punching all this into calculators and figuring it out, but assuming I'll be tested over this or a problem similar to it, I'd like to just figure out why it is the way it is.
P.S. Sorry for the bad formatting. First time using stack exchange and it took me a while to even figure out what I did haha.
 A: Hint: Consider $f(t)=\sum_{k=0}^\infty\left(t\right)^k=\frac{1}{1-t}$ and take derivatives.
A: Try taking derivatives on both sides of the equation 
$$\frac{1}{1-x}=\sum_{n=0}^{\infty}x^n, |x|<1.$$
A: Basically , you need two infinite sums
$$\sum_{k=0}^\infty x^k$$ and $$\sum_{k=0}^\infty kx^k$$
The first one is $\frac{1}{1-x}$ for $|x|<1$ because of $$\sum_{k=0}^n x^k=\frac{x^{n+1}-1}{x-1}$$
To get the second , you can differentiate the sum, if $|x|<1$ and you will easily get that the second sum is $\frac{x}{(1-x)^2}$ for $|x|<1$
A: This computation appears in the computation for the mean of a geometric distribution, which can be proved using derivatives as shown here.
Alternatively, you can use shifting to avoid using derivatives: let $p=364/365$. Then computing the sum $S$ and multiplying by $p$ to get $pS$, we can subtract these two expressions to find $(1-p)S$ which turns out to be a geometric series.
\begin{align}
S:=\sum_{x=1}^\infty xp^{x-1} & = 1+2p + 3p^2 +4p^3 + \cdots\\
pS &= 0 + p + 2p^2 + 3p^3 + \cdots\\
\frac{1}{365}\sum_{x=1}^\infty x\left(\frac{364}{365}\right)^{x-1}=(1-p)S &= 1+p + p^2 + p^3 + p^4 + \cdots = \frac{1}{1-p} = 364.\\
\end{align}
