Sum of a series (sum)
Sum of an expression over one or more ranges.
How to write it
sum(f, k = a..b)
The sum over the range.
- f
- The expression or function to work on. Takes an expression.
- k = a..b
- The index and its bounds; a bound may be inf. Takes a variable with its range.
sum(f, i = a..b, j = a..b)
A double sum.
- f
- The expression or function to work on. Takes an expression.
- i = a..b
- The first index and its range. Takes a variable with its range.
- j = a..b
- The second index and its range. Takes a variable with its range.
Examples
sum(k, k = 1..10)In the solver,
Open in the solversum(k, k = 1..10)gives55.sum(1/k^2, k = 1..inf)In the solver,
Open in the solversum(1/k^2, k = 1..inf)givespi^2/6.sum(i*j, i = 1..3, j = 1..3)In the solver,
Open in the solversum(i*j, i = 1..3, j = 1..3)gives36.
Related functions
- sum_convergence
Test whether the sum of an expression over a variable converges.
- numeric_sum
Add up an expression over a range, as a decimal.
- series_coefficient
The coefficient of the term of a given order in the series of an expression.
- differences
The differences between neighbouring elements of a list.
- series
Series expansion of an expression about a point.
- find_linear_recurrence
The recurrence a list of terms obeys, given only when it also holds on two more.