Re: Integrate vs NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg89150] Re: Integrate vs NIntegrate
- From: dh <dh at metrohm.ch>
- Date: Tue, 27 May 2008 07:14:38 -0400 (EDT)
- References: <g1e35c$er3$1@smc.vnet.net>
Hi Armen, we cross a branch cut at x=2, as you may see by: Plot[Re@f[x],{x,0,3}] If you integrate from 0 to 2 and from 2+epsilon to 3, where epsilon is small enough for your purpose, you will get the same result from Integrate and NIntegrate. hope this helps, Daniel Armen Kocharyan wrote: > Dear group, > > > Why do I get different results (Res1, Res2) in Mathematica 6.0.1.0? > > > *q=-1/2; a=0; b=3;* > > *h[x_]=(1+x^3)^q;* > > *f[x_]=Integrate[h[x],x];* > > *Res1=N[f[b]-f[a]]* > > *Res2=NIntegrate[h[x],{x,a,b}]* > > ** > > *Res1 = -2.55387-2.42865 i* > > *Res2 = 1.65267* > > > > I'm assuming that Res2 is the correct answer. > > > > Regards, > > Armen > > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>