Re: Integrate vs. NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg51437] Re: [mg51419] Integrate vs. NIntegrate
- From: DrBob <drbob at bigfoot.com>
- Date: Sun, 17 Oct 2004 03:05:43 -0400 (EDT)
- References: <200410160821.EAA23758@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
I get a different answer here (with version 5.0.1): N[Simplify[Integrate[Log[f],{x,-Pi,Pi}]/(2*Pi)]]//InputForm 0.6931471805599453 NIntegrate[Log[f],{x,-Pi,Pi}]/(2*Pi)//InputForm 0.693147180559943 + 0.*I Bobby On Sat, 16 Oct 2004 04:21:20 -0400 (EDT), Carlos Felippa <carlos at colorado.edu> wrote: > Which one is the correct answer? > > f=2+Cos[2 x]+ I*Sin[2 x]; > > Print[ N[Simplify[ Integrate[Log[f],{x,-Pi,Pi}]/(2*Pi)]] //InputForm]; > 0.34657359027997264 + 1.5707963267948966*I > > Print[ NIntegrate[Log[f],{x,-Pi,Pi}]/(2*Pi) //InputForm]; > 0.6931471805599428 + 0.*I > > I believe the second one, have doubts about the first. > > > > -- DrBob at bigfoot.com www.eclecticdreams.net
- References:
- Integrate vs. NIntegrate
- From: carlos@colorado.edu (Carlos Felippa)
- Integrate vs. NIntegrate