Error, (in sum) expecting two arguments
Description
Compatibility
Examples
See Also
A correctly defined sum requires a summand and the index or index range of summation. This error occurs when one of these arguments is not provided.
Note: As a result of updates made in Maple 15, this error message appears in Maple 14 and earlier versions.
Example 1
In the following example, it is unclear whether the argument i represents the summand or the index.
sumi
Solution:
For this example, we assume the intention was for the summand and index to both be i. You must explicitly state both arguments for sum.
sumi,i
12⁢i2−12⁢i
Example 2
In the following example, attempting to sum more than one summand at a time results in an error.
sumi2,i,i
To sum more than one summand at at time, use the map command.
mapsum,i2,i,i
13⁢i3−12⁢i2+16⁢i,12⁢i2−12⁢i
Example 3
In the following example, attempting to calculate the sum of i+j over both index variables results in an error. This statement is not well-defined.
sumi+j,i=1..3,j=6..8
Depending on the interpretation, one possible solution is to express the sum in the following manner: if the indices are meant to be sequenced individually, then the following statement corrects the error and produces the intended result.
sumsumi+j,i=1..3,j=6..8
81
Otherwise, if the indices are meant to be sequenced in tandem, then the following statement corrects the error and produces the intended result.
sumevali+j,j=i+5,i=1..3
27
eval, map, sum
Download Help Document