Approximate Sums Numerically

    Note:   Use only in the MuPAD Notebook Interface. This functionality does not run in MATLAB.

If the sum command cannot compute a sum, MuPAD® returns an unresolved sum. For example, try to compute the following sum:

sum(exp(x)^(-x), x = 0..infinity)

The reasons MuPAD cannot compute the closed form of a particular sum are the same as the reasons for not computing an integral:

  • The antidifference does not exist in a closed form.

  • The antidifference exists, but MuPAD cannot find it.

  • MuPAD can find the antidifference on a larger computer, but runs out of time or memory on the available machine.

If MuPAD cannot compute a definite sum, try to approximate it numerically:

S := sum(exp(x)^(-x), x = 0..infinity);

If you know in advance that the antidifference cannot be computed in a closed form, skip trying to calculate this sum symbolically. For such expressions, call the numeric::sum function to perform numeric summation directly. Trying to calculate a symbolic sum, and then approximating it numerically can be much slower than applying numeric summation from the beginning:

numeric::sum(exp(x)^(-x), x = 0..infinity)

Was this topic helpful?