vpasum

Numerical sum of a series in variable-precision arithmetic.

Category: Mathematics > Calculus

Syntax

S = vpasum(f, k, a, b)

Adds the terms of f for the integer index k from a to b.

Description

vpasum evaluates every term numerically with vpa and adds them, in contrast with symsum, which tries to find an exact closed form. It is the tool for sums whose exact value is unknown or unwieldy.

The result is shown with the working precision of digits, 32 significant digits by default.

Input arguments

f
Symbolic expression for the general term.
k
Summation index.
a, b
First and last index.

Output arguments

S
Symbolic number with the numerical value of the sum.

Example

Partial sum of 1/k^2

syms k
S = vpasum(1/k^2, k, 1, 1000)
Output
S = 1.6439345666815598031390580238222

See also

symsum vpa digits sum vpaintegral