MathGroup Archive 2004

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

Search the Archive

Integrate vs. NIntegrate


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.


  • Prev by Date: Re: Factor 2 error in Inverse Laplace Transform
  • Next by Date: Concatenate matrices
  • Previous by thread: Re: RandomReplacement
  • Next by thread: Re: Integrate vs. NIntegrate