New in Wolfram Mathematica 6: New Generation Numerical Integration  previous | next 
Automatically Switch between Integration Methods
Mathematica 6 can accurately find numerical integrals of even very pathological functions, automatically switching between state-of-the-art methods.
In[1]:=

Click for copyable input
f = \[Piecewise] {

    {Sin[10 x]/Sqrt[-x], -\[Infinity] < x < 0},

    {1/Sqrt[x], 0 < x < 1},

    {Sin[2000 x] x^2, 1 < x < 2},

    {Cos[2 x]/x, 2 < x < \[Infinity]}

   };
In[2]:=

Click for copyable input
Plot[f, {x, -10, 10}]
Out[2]=

In[3]:=

Click for copyable input
NIntegrate[f, {x, -Infinity, Infinity}]
Out[3]=