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.