The sum \(S\) of the geometric progression with \(n\) terms, ratio \(r\) and first term \(a\)

is calculated buy multiplying the equation above by \(r\) to obtain

And then subtracting the top equation from the bottom one to obtain

On the right, all but two terms cancel out and we get