# Integrate perfomance

I have a notebook in Mathematica 4. I'm trying to convert it to use in Mathematica 9. One of the problem is the long computation of definite integral in the new version of Mathematica.

Here's the example:

I understand that the new Mathematica produces more accurate answer, but even NIntegrate loses in speed of calculations. Is there any simple solution to make the integration work faster?

-
I don't know why it's slower, but if this is a calculation you perform more than once, you may benefit by storing the results (i.e., use b[i_]:=b[i]=integral). – Cassini Nov 22 '13 at 18:55

b[i_] := b[i] = Integrate[(Sin[x] - 1) x^i, x]
Timing@N[Sum[(b@i /. x -> 5) - (b@i /. x -> -5), {i, 30}], 8]
(*
{0.359375, -3.7741840*10^20}
*)
-

I found a good solution. The new version of Mathematica is using the symbolic processing, so we can just turn it off.

b[i_] := NIntegrate[(Sin[x] - 1) x^i, {x,-5,5}, Method->{Automatic,"SymbolicProcessing"->0}]

source: Techniques for Accelerating NIntegrate Evaluations http://support.wolfram.com/kb/3442

-
Please add concrete version info, otherwise this will be ambiguous, especially in a few years time ;-) – Yves Klett Nov 22 '13 at 20:11
@YvesKlett Mma 10.0 for XBox. 3 billion devices run Mathematica. – Dr. belisarius Nov 23 '13 at 2:18