Previous Up Next

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.

Examples

sum(1,k,-2,n)
n+1+2           
normal(sum(2*k-1,k,1,n))
n2           
sum(1/(n^2),n,1,10)
1968329
1270080
          
sum(1/(n^2),n,1,+(infinity))
1
6
π 2
          
sum(1/(n^3-n),n,2,10)
27
110
          
sum(1/(n^3-n),n,2,+(infinity))
1
4
          

This result comes from the decomposition of 1/(n^3-n) (see Section 11.6.9).

partfrac(1/(n^3-n))
−
1
n
+
1
2 ⎛
⎝
n−1⎞
⎠
+
1
2 ⎛
⎝
n+1⎞
⎠
          

Hence:

N
∑
n=2
−
1
n
=−
N−1
∑
n=1
1
n+1
=−
1
2
−
N−2
∑
n=2
1
n+1
−
1
N
         
1
2
N
∑
n=2
1
n−1
=
1
2
⎛
⎜
⎜
⎝
N−2
∑
n=0
1
n+1
)=
1
2
(1+
1
2
+
N−2
∑
n=2
1
n+1
⎞
⎟
⎟
⎠
         
1
2
N
∑
n=2
1
n+1
=
1
2
⎛
⎜
⎜
⎝
N−2
∑
n=2
1
n+1
+
1
N
+
1
N+1
⎞
⎟
⎟
⎠
         

After simplification by ∑n=2N−2, it remains:

−
1
2
+
1
2
⎛
⎜
⎜
⎝
1+
1
2
⎞
⎟
⎟
⎠
−
1
N
+
1
2
⎛
⎜
⎜
⎝
1
N
+
1
N+1
⎞
⎟
⎟
⎠
=
1
4
−
1
2N(N+1)

Therefore:

sum(1/(x*(x+1)),x)
−
1
x
          

Previous Up Next