13.3.3 Discrete summation
The sum command can evaluate sums, series,
and find discrete antiderivatives.
A discrete antiderivative of a sum ∑nf(n) is
an expression G such that G|x=n+1−G|x=n=f(n), which means
that ∑n=MNf(n)=G|x=N+1−G|M.
-
To evaluate a sum or series, sum takes four arguments:
-
expr, an expression.
- k, the name of the variable.
- n0 and n1, integers (the bounds of the sum).
- sum(expr,k,n0,n1) returns the sum
∑k=n0n1expr.
- To find a discrete antiderivative, sum takes two arguments:
-
expr, an expression.
- x, the name of the variable.
- sum(expr,x) returns a discrete
antiderivative.
Examples
sum(1/(n^2),n,1,+(infinity)) |
sum(1/(n^3-n),n,2,+(infinity)) |
This result comes from the decomposition of 1/(n^3-n) (see
Section 11.6.9).
Hence:
After simplification by ∑n=2N−2, it remains:
− | | + | | ⎛
⎜
⎜
⎝ | 1+ | | ⎞
⎟
⎟
⎠ | − | | + | | ⎛
⎜
⎜
⎝ | | + | | ⎞
⎟
⎟
⎠ | = | | − | | |
Therefore:
-
for N=10 the sum is equal to 1/4−1/220=27/110,
- for N=+∞ the sum is equal to 1/4 because 1/2N(N+1)
approaches zero when N approaches infinity.