3 ms·
\sum_{i=0}^n x^i (the sum of all terms x^i as i ranges from 0 to n, inclusive) = (x^{n+1} - 1)/(x-1). Or, if n is positive infinity, you assume that |x| < 1 an
by thaumasiotes 3y ago
\sum_{i=0}^n x^i (the sum of all terms x^i as i ranges from 0 to n, inclusive) = (x^{n+1} - 1)/(x-1).
Or, if n is positive infinity, you assume that |x| < 1 and thus the sum is (0 - 1) / (x-1) = 1/(1-x).
If you need the sum from x^m to x^n, that's equal to the sum from 0 to n minus the sum from 0 to (m-1).
You can derive the formula yourself without difficulty:
sum = 1 + x + x^2 + ... + x^n
(sum)(x) = x + x^2 + ... + x^n + x^{n+1}
(sum)(x) - sum = x^{n+1} - 1
(sum)(x-1) = x^{n+1} - 1
(sum) = (x^{n+1} - 1)/(x-1)