This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / The Mathematica Book / A Practical Introduction to Mathematica / Numerical Mathematics /

1.6.2 Numerical Sums, Products and Integrals

Numerical sums, products and integrals.

Here is a numerical approximation to .

In[1]:= NSum[1/i^3, {i, 1, Infinity}]

Out[1]=

NIntegrate can handle singularities at the end points of the integration region.

In[2]:= NIntegrate[1/Sqrt[x (1-x)], {x, 0, 1}]

Out[2]=

You can do numerical integrals over infinite regions.

In[3]:= NIntegrate[Exp[-x^2], {x, -Infinity, Infinity}]

Out[3]=

Here is a double integral over a triangular domain. Note the order in which the variables are given.

In[4]:= NIntegrate[ Sin[x y], {x, 0, 1}, {y, 0, x} ]

Out[4]=