Sum of series in GP $a+ ar+ar^2 + ar^3 +ar^4+ \cdots+ ar^{n-1}=S_n$
$a\left(1+r+r^2 +r^3+\cdots+r^{n-1} \right) = S_n$
Iam trying to get $S_n = \dfrac{a(r^n -1)}{r-1}$
I don't know how to get $1+r+r^2 +r^3+\cdots+r^{n-1}  =\dfrac{r^n -1}{r-1}$
Any help will be appreciated $:)$

Equation (1)
$S_n = a_1 + a_2 + a_3 + a_4 + …....... +a_n$     
Putting value of each term,
Equation (2)
$S_n = a + ar + ar^2 + ar^3 + ar^4 + ... + ar^{n-1}$    
Multiply equation (2) by r,
Equation (3)
$rS_n = ar + ar^2 + ar^3 + ar^4 + ........... + ar^{n}$     
Subtract equation (2) from (3),
$rS_n - S_n = ar^n - a$
$S_n = \frac{a(r^n - 1)}{r - 1}$
