MathGroup Archive 2001

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

Search the Archive

"Incremental Integration"?


Given a rather messy function  f[x] , I want to make a Table of its integral 
from  x0 up to a set of equally spaced points xn = x0 + n*dx  with maximum value 
xFinal -- in other words

   g[x_] := NIntegrate[f[xi], {xi, x0, x}]

   Table[ {x, g[x]}, {x, x0, xFinal, dx}]

Is Mathematica smart enough to calculate each successive value using the 
previous value plus integration just over the increment in x to the next value?

If not, what would be a clean and readable and also reasonably efficient way to 
code this?

[Note:  For me anyway, there's some emphasis on the "clean and readable" part -- 
avoiding esoteric Mathematica syntax, not taking terseness as the ultimate goal.]

Email cc to poster appreciated.


  • Prev by Date: Path finding in graph theory, Lookig for your help,
  • Next by Date: Re: Compiling functions
  • Previous by thread: Re: Path finding in graph theory, Lookig for your help,
  • Next by thread: Re: "Incremental Integration"?