*To*: mathgroup@smc.vnet.net*Subject*: [mg10792] Q: Contour integral*From*: Patrick Van Esch <pvanesch@vub.ac.be>*Date*: Thu, 5 Feb 1998 00:58:36 -0500*Organization*: Vrije Universiteit Brussel

Hi folks, I have the following question: I've been reading "Mathematica for scientists and engineers", and there is an example on how to calculate numerically a contour integral: NContourIntegrate[f_,par:(z_->g_),{t_,a_,b_}]:= NIntegrate[Evaluate[(f/.par)D[g,t]],{t,a,b}] When applying this to a limacon: NContourIntegrate[1/(z-1/2),z->Exp[I t](2Cos[t]+1),{t,0,2 Pi}] one gets the right answer: \!\(3.33066907387546962`*^-16 + 12.5663706143520892`\ I\) (4pi I) However, when modifying the numerical integration into an analytic one, ContourIntegrate[f_,par:(z_->g_),{t_,a_,b_}]:= Integrate[Evaluate[(f/.par)D[g,t]],{t,a,b}] The answer that is obtained is wrong: 2 Pi I Any ideas ? cheers, Patrick. PS: Please, also reply by mail...