Numerical Evaluation of Sums and Products

NSum[f,{i,imin,imax}]find a numerical approximation to the sum
NSum[f,{i,imin,imaxdi}]use step in the sum
NProduct[f,{i,imin,imax}]find a numerical approximation to the product

Numerical sums and products.

This gives a numerical approximation to .
In[1]:=
Click for copyable input
Out[1]=
There is no exact result for this sum, so the Wolfram Language leaves it in a symbolic form.
In[2]:=
Click for copyable input
Out[2]=
You can apply N explicitly to get a numerical result.
In[3]:=
Click for copyable input
Out[3]=

The way NSum works is to include a certain number of terms explicitly, and then to try and estimate the contribution of the remaining ones. There are three approaches to estimating this contribution. The first uses the EulerMaclaurin method, and is based on approximating the sum by an integral. The second method, known as the Wynn epsilon method, samples a number of additional terms in the sum, and then tries to fit them to a polynomial multiplied by a decaying exponential. The third approach, useful for alternating series, uses an alternating signs method; it also samples a number of additional terms and approximates their sum by the ratio of two polynomials (Padé approximation).

option name
default value
MethodAutomaticAutomatic, , , or
NSumTerms15number of terms to include explicitly
VerifyConvergenceTruewhether the convergence of the series should be verified

Special options for NSum.

If you do not explicitly specify the method to use, NSum will try to choose between the or methods. In any case, some implicit assumptions about the functions you are summing have to be made. If these assumptions are not correct, you may get inaccurate answers.

The most common place to use NSum is in evaluating sums with infinite limits. You can, however, also use it for sums with finite limits. By making implicit assumptions about the objects you are evaluating, NSum can often avoid doing as many function evaluations as an explicit Sum computation would require.

This finds the numerical value of by extrapolation techniques.
In[4]:=
Click for copyable input
Out[4]=
You can also get the result, albeit much less efficiently, by constructing the symbolic form of the sum, then evaluating it numerically.
In[5]:=
Click for copyable input
Out[5]=

NProduct works in essentially the same way as NSum, with analogous options.