Re: Numerical integration and list of points

*To*: mathgroup at smc.vnet.net*Subject*: [mg87665] Re: Numerical integration and list of points*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Tue, 15 Apr 2008 05:51:59 -0400 (EDT)*Organization*: Uni Leipzig*References*: <ftvd4f$d89$1@smc.vnet.net>*Reply-to*: kuska at informatik.uni-leipzig.de

Hi, with Mathematica 6.0.2 both: data = Table[{x, Sin[x]}, {x, 0, Pi, Pi/32}] // N; f = Interpolation[data] Integrate[f[t], {t, 0, Pi}] and NIntegrate[f[t], {t, 0, Pi}] gives 2.0 Regards Jens guerom00 wrote: > Hello everyone, > > I have a function which I read as a list of points. I want then to > estimate its integral. I do more or less this : > > data={{x1,y1},{x2,y2},...,{xN,yN}} > f=Interpolation[data] > NIntegrate[f[x],{x,x1,xN}] > > Is it the correct way ? Because Mathematica hangs without giving me an > answer although it seems a pretty straightforward thing to do... > > Thanks for any suggestions. >