SumTools
Summation
compute closed forms of definite and indefinite sums
DefiniteSummation
compute closed forms of definite sums
IndefiniteSummation
compute closed forms of indefinite sums
Calling Sequence
Parameters
Options
Description
Examples
Summation(f, k)
Summation(f, k=m..n, parametric)
Summation(f, k=alpha)
Summation(f, expr)
DefiniteSummation(f, k=m..n, parametric)
DefiniteSummation(f, k=alpha)
DefiniteSummation(f, k=expr)
IndefiniteSummation(f, k)
f
-
expression; specified summand
k
name; summation index
m, n
integers or expressions
parametric
(optional) literal name
alpha
RootOf expression
expr
expression not containing k
If the option parametric is specified for a definite sum, then a result is returned that is valid for all possible integer values of any parameters occurring in the summand or the summation bounds. In general, the result is expressed in terms of piecewise functions.
The IndefiniteSummation(f, k) command computes a closed form of the indefinite sum of f with respect to k, that is, it finds a function g⁡k such that g⁡k+1−g⁡k=f⁡k.
The DefiniteSummation(f, k=m..n) command computes a closed form of the definite sum of f⁡k over the specified range m..n.
For notational convenience, there are two special cases:
- The DefiniteSummation(f, k=alpha) command, where alpha is a RootOf structure, computes the definite sum of f⁡k over the index of the specified RootOf
- The DefiniteSummation(f, k=expr) command is used for function evaluation at a specified point. This is an equivalence of eval(f, k=expr).
The Summation(f, ...) command is the combination of DefiniteSummation and IndefiniteSummation commands.
For a specified summation problem give to Summation, there is a preprocess that classifies whether the summation is a definite or indefinite sum. It then calls either IndefiniteSummation or DefiniteSummation as appropriate.
If Summation, IndefiniteSummation, or DefiniteSummation fails to compute a closed form, the unevaluated sum returns.
Note: The sum routine recognizes various resummation methods and thus is able to give the 'correct' value for various classes of divergent sums. If the environment variable _EnvFormal is set to true, sum uses this technique.
If _EnvFormal is set to false, then Maple tries harder to determine whether the given definite sum is divergent and returns infinity, -infinity, or unevaluated in that case. Note that this may slow down the computation.
In that case, Maple also tries to recognize removable singularities in the summation interval.
By default, _EnvFormal is unassigned.
For more information, see sum,details.
with⁡SumTools:
Two examples of indefinite sums.
Example 1.
F≔binomial⁡n2+k,k⁢2−k
F≔n2+kk⁢2−k
Sum⁡F,k=IndefiniteSummation⁡F,n
∑k⁡n2+kk⁢2−k=n⁢n2+kk⁢2−k2⁢k+1+n+1⁢n2+12+kk⁢2−k2⁢k+1
Example 2.
F≔n2binomial⁡2⁢n,n⁢n2+3⁢n+2
F≔n22⁢nn⁢n2+3⁢n+2
Sum⁡F,n=IndefiniteSummation⁡F,n
∑n⁡n22⁢nn⁢n2+3⁢n+2=−4⁢2⁢n−1⁢∏_i=1n−1⁡_i+12⁢2⁢_i+1n+1⁢n+∑n⁡n2−14⁢n+8⁢∏_i=1n−1⁡_i4⁢_i+22⁢n+2
Examples of definite sums:
F≔binomial⁡2⁢n+1,2⁢k2
F≔2⁢n+12⁢k2
Sum⁡F,k=0..n=DefiniteSummation⁡F,k=0..n
∑k=0n⁡2⁢n+12⁢k2=4⁢n+12⁢n
F≔22⁢k⁢Γ⁡k−n⁢Γ⁡k+n⁢zksqrt⁡π⁢Γ⁡2⁢k+1
F≔22⁢k⁢Γ⁡−n+k⁢Γ⁡k+n⁢zkπ⁢Γ⁡2⁢k+1
DefiniteSummation⁡F,k=0..∞
∑k=0∞⁡22⁢k⁢Γ⁡−n+k⁢Γ⁡k+n⁢zkπ⁢Γ⁡2⁢k+1
It is necessary to specify the domain of convergence:
Sum⁡F,k=0..∞=DefiniteSummation⁡F,k=0..∞assumingabs⁡z≤1
∑k=0∞⁡22⁢k⁢Γ⁡−n+k⁢Γ⁡k+n⁢zkπ⁢Γ⁡2⁢k+1=−π⁢cos⁡2⁢n⁢arcsin⁡z⁢csc⁡π⁢nn
Summation⁡k32,k=1..∞
∞
Summation⁡−1k,k=1..∞
∑k=1∞⁡−1k
Parametric case discussions may be returned:
F≔binomial⁡2⁢k−3,k4k
F≔2⁢k−3k4k
Sum⁡F,k=0..n=Summation⁡F,k=0..n,parametric
∑k=0n⁡2⁢k−3k4k=2⁢n−1n⁢2⁢n+44n+1n≤034n=12⁢n−1n⁢2⁢n+44n+1+382≤n
Summation⁡1k,k=a..b
∑k=ab⁡1k
Summation⁡1k,k=a..b,parametric
0a=b+1Ψ⁡b+1−Ψ⁡a1≤aand0≤bΨ⁡−b−Ψ⁡1−aa≤0andb≤−1FAILotherwise
If _EnvFormal is set to true, the Summation command returns the class for recognized divergent sums.
_EnvFormal≔true
F≔22⁢k⁢Γ⁡k−n⁢Γ⁡k+n⁢zksqrt⁡π⁢Γ⁡2⁢k+1:
Sum⁡F,k=0..∞=Summation⁡F,k=0..∞
ζ⁡−32
−12
See Also
product
RootOf
sum
Download Help Document