How to show that $\sum_{i=0}^{n-1}x^i=\frac{1}{1-x}-x^n=\frac{x^n-1}{x-1}$ This is not a homework assignment, but a problem that is bothering me nonetheless. I feel like I should be able to figure this out, but either I'm missing some detail, or I'm doing something completely wrong.
The question arises because I read a theorem in my elementary number theory book that states the following:

$1+x+x^2+x^3+\cdots+x^{n-1}=\frac{x^n-1}{x-1}$

and it goes on to prove it using induction. This got me thinking, because I recall from my Calculus class over the summer that the power series $\sum_{i=0}^n x^i=\frac{1}{1-x}$. So I just decided to try and see if this is right by taking my knowledge from Calculus and using a bit of algebra to manipulate the fraction.
So what I come up with is the following:
\begin{align}
\sum_{i=0}^{n-1} x^i&=\sum_{i=0}^{n} x^i-x^n\\
&=\frac{1}{1-x}-x^n\\
&=\frac{1-x^n+x^{n+1}}{1-x}\\
&=\frac{x^n-1-x^{n+1}}{x-1}
\end{align}
I'm having trouble figuring out how to deal with the $-x^{n+1}$ in the numerator in order to make the fraction equal $\frac{x^n-1}{x-1}$. Where am I going wrong?

In order to show that $\frac{x^n-1}{x-1}=1+x+...+x^n$ just multiply by $x-1$ both sides and observe that most terms cancel. 
The calculus result states that $\sum_{n=0}^\infty x^n=\frac{1}{x-1}$ for $|x|<1$, this follows from the previous result by noting that $\lim_{n\to\infty} x^n=0$. You seem to be confusing the series with the partial sum. 
