Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  The Teacher's Book /  More Mathematics /  Integration and Sums /

15.4 Numerical Mathematics in Mathematica

One of the most important features of Mathematica TE is its ability to give you exact, symbolic, results for computations. There are, however, computations where it is just mathematically impossible to get exact "closed form" results. In such cases, you can still often get approximate numerical results.

There is no "closed form" result for . Mathematica TE returns the integral in its original symbolic form.

In[1]:=Integrate[Sin[Sin[x]], {x, 0, 1}]

Out[1]=

You can now take the symbolic form of the integral and ask for its approximate numerical value.

In[2]:=N[%]

Out[2]=

When Mathematica TE cannot find an explicit result for something like a definite integral, it returns a symbolic form. You can take this symbolic form and try to get an approximate numerical value by applying N.

By giving a second argument to N, you can specify the numerical precision.

In[3]:=N[ Integrate[Sin[Sin[x]], {x, 0, 1}], 40 ]

Out[3]=

If you want to evaluate an integral numerically in Mathematica TE, then using Integrate and applying N to the result is not the most efficient way to do it. It is better instead to use the function NIntegrate, which immediately gives a numerical answer, without first trying to get an exact, symbolic result. You should realize that even when Integrate does not in the end manage to give you an exact result, it may spend a lot of time trying to do so.

NIntegrate evaluates numerical integrals directly without first trying to get a symbolic result.

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

Out[4]=

Symbolic and numerical versions of some Mathematica functions.

Mathematica options for numerical functions. (See Section 3.2.)