Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1993
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1993

[Date Index] [Thread Index] [Author Index]

Search the Archive

NIntegrate vs. N[Integrate]

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: NIntegrate vs. N[Integrate]
  • From: Mangalam Vasudaven <TVASUDAVE at cc.curtin.edu.au>
  • Date: 21 Jul 1993 13:23:54 +0800

Hello Mathgroup,
I was always under the impression that it is a lot more efficient to use
NIntegrate when one is trying to get approximate values of definite integrals
than surround it by N[].  But while playing around with some gamma integrals
I found that NIntegrate took sixty times as much time as the second method.
BTW, Mathematica Book, in page 683, confirms my original impression.

p[x_]:= Integrate[(y^6)*(E^-y)/6!,{y,0,x}]
NIntegrate[ p[x]*(1-p[x]),{x,0,200}]
Now, the NIntegrate took 336.36 seconds.  And
N[Integrate[p[x]*(1-p[x]),{x,0,200},10]
took just 5.66 seconds, giving an answer accurate to more decimal places than
NIntegrate, incidently.
Why does this happen?  Being a novice to Mathematica, I could not figure out
why.  If it is of any relevance, I am running version 2.2 under windows.

M. Vasudaven
Curtin University of Technology
Perth








  • Prev by Date: Electronic circuit simulator
  • Next by Date: pattern matching
  • Previous by thread: Re: Electronic circuit simulator
  • Next by thread: Re: NIntegrate vs. N[Integrate]