This may be a simple question, but I was slightly confused. I was looking at the second line $S_n(x)=1-x^{n+1}/(1-x)$. I was confused how they derived this. I know the infinite sum of a geometric series is $1/(1-x)$. I just can't figure out how the partial sums, $S_n(x)$, have $1-x^{n+1}$ on the numerator. How was this derived?
Thank you.
Example 5.20. The geometric series $$ \sum_{n=0}^\infty x^n = 1 + x + x^2 + x^3 + \dotsb $$ has partial sums $$ S_n(x) = \sum_{k=0}^n x^k = \frac{1 - x^{n+1}}{1 - x} \cdotp $$ Thus, $S_n(x) \to 1/(1-x)$ as $n \to \infty$ if $|x| < 1$ and diverges if $|x| \geq 1$, meaning that $$ \sum_{n=0}^\infty x^n = \frac{1}{1-x} \qquad \text{pointwise on $(-1,1)$}. $$ (Original image here.)
Observe that $$ \frac{1}{x-1}(x^{k+1}-x^{k})=x^k\quad (x\neq 1) $$ whence $$ \sum_{k=0}^n x^k=\sum_{k=0}^n\frac{1}{x-1}(x^{k+1}-x^{k})=\frac{1}{x-1}(x^{n+1}-1) =\frac{1-x^{n+1}}{1-x};\quad (x\neq 1) $$ since the sum telescopes.