Re: Numerical integration
- To: mathgroup at smc.vnet.net
- Subject: [mg78822] Re: Numerical integration
- From: dh <dh at metrohm.ch>
- Date: Tue, 10 Jul 2007 06:35:57 -0400 (EDT)
- References: <f6sh65$7ob$1@smc.vnet.net>
Hi Jose, your integral can be looked at as a contour integral on a circle around -1 with radius 1 of the following function: Exp[I t](Exp[I t] - 1)Sec[Exp[I t] - 1] dt == z Sec[z] /I dz by resdiue theory the integral is 2 Pi I time the residue at the pole at z=-Pi/2 what gives Pi^2 = 9.8696. If I compute: N[Integrate[h[t], {t, 0, 2Pi}]] in version 5.1 I get the wrong result of -3.58, on the other hand: N[Integrate[h[t], {t, 0, 2Pi}]] in version6 I get the correct result. Therefore, you seesm to have found an bug that has been corrected in version 6. hope this helps, Daniel José Carlos Santos wrote: > Hi all: > > I detected a problem concerning numerical integration under Mathematica > 5.1. Consider this function: > > h[t_] := Exp[I t](Exp[I t] - 1)Sec[Exp[I t] - 1] > > If I compute: > > N[Integrate[h[t], {t, 0, 2Pi}]] > > I get -3.58642. But if I compute > > N[Integrate[Re[h[t]], {t, 0, 2Pi}] + Integrate[Im[h[t]], {t, 0, 2Pi}]I] > > instead of getting the same answer, I get -9.869604401106042 + > 2.2377264147293624^(-16)I. Of course, the imaginary part doesn't bother > me, but why are the results so different? BTW the difference is equal > to 2*pi. > > Best regards, > > Jose Carlos Santos >