# Find the sum $x+x^2+x^3+...+x^n$

One part of a problem requires me to find following sum $$\ x+x^2+x^3+...+x^n\$$ and solution suggests that after first step given sum equals to $$\left(x \frac{1-x^n}{1-x} \right)$$ and I don't see how to get that. Could anyone explain it to me?

• FYI, the sum is of a geometric series. Commented Apr 30, 2020 at 20:56
• I'm embarrassed. I constantly keep forgetting that formula for sum of elements of geometric series exist... It even costed me lots of points on finals recently :-( Commented Apr 30, 2020 at 21:10

Let $$\alpha:=x+\cdots+x^n.$$ Then $$\alpha x=x^2+\cdots+x^{n+1}.$$ Therefore, $$\alpha(x-1)=x^{n+1}-x=x(x^n-1).$$ If $$x\neq 1$$, divide both sides with $$x-1$$, so $$\alpha=x\frac{x^n-1}{x-1},$$ the result you want. If $$x=1$$, $$\alpha=n$$.
Multiply $$x + x^2 + \cdots + x^n$$ by $$1-x$$ and rearrange terms, you get $$\begin{array}{c} x &+& \color{red}{x^2} &+& \color{green}{x^3} &+& \cdots &+&\color{blue}{x^n}\\ &-& \color{red}{x^2} &-& \color{green}{x^3} &-& \cdots &-&\color{blue}{x^n} &-& x^{n+1} \end{array}$$ Notice the massive cancellation of terms, the result simplifies to
$$(1-x)(x + x^2 + \cdots + x^n) = x - x^{n+1} = x(1-x^n)$$ Divide both sides by $$1-x$$, you get what you want to show.