MathGroup Archive 2000

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

Search the Archive

Re: bug in complex integral?

  • To: mathgroup at
  • Subject: [mg24906] Re: [mg24890] bug in complex integral?
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Sun, 20 Aug 2000 01:34:55 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Whether this is a bug or a limitation of computer algebra  has been often
disputed in this group. Personally I do not think it is reasonable to expect
Mathematica to be able always to deal correctly with what is basically a
topological problem. Instead, I think, the right thing to do is to use the
Cauchy Residue Theorem:

2Pi*I*Residue[1/z, {z, 0}]
2 I Pi


on 8/19/00 10:46 AM, Mark Fisher at mark.fisher at wrote:

> Hi all.
> I'm learning a bit of complex analysis (using the book Visual Complex
> Analysis by Needham, which I think is great), so I turned to Mathematica to
> help
> me come to grips with the material. The first thing I tried---just to
> see that I was following the text at the most basic level---was to
> integrate 1/z in a simple closed contour around the origin. Of course
> the book says the integral is 2 Pi I (assuming a counter-clockwise
> direction for integration). Imagine my surprise when I saw the result:
> In[182]:= Integrate[1/z, {z, 1, I, -1, -I, 1}]
> Out[182]= 0
> By contrast, NIntegrate gets is right:
> In[187]:= NIntegrate[1/z, {z, 1, I, -1, -I, 1}] // Chop
> Out[187]= 6.28319 \[ImaginaryI]
> Apparently, Integrate computes the answer from the Log function, which
> has a branch cut along the negative real axis, thereby adding 2 Pi I to
> the answer. Are there other complex booby traps lying around that I
> should be aware of?
> Just for a lark, I tried to integrate across the singularity at zero:
> Integrate[1/z, {z, 1, 0, I}]. Well the kernel crashed, which in my
> opinion is unnecessarily harsh punishment, but then I'm new to complex
> analysis.
> BTW, I think Bernd Thaller's ComplexPlot package is great. I use it to
> make plots to put on the refrigerator along side my kids' artwork. My
> nine-year-old son lets out a loud shriek when he sees a new one. The
> earlier version of the package (that came with the Mathematica Journal
> article) has a mildly annoying bug with respect to Compile in version 4.
> The latest version, which fixes the bug, can be downloaded from
> Thaller's Visual Quantum Mechanics web page:
> --Mark.
> Mark Fisher
> Economic Advisor
> Research Department
> Federal Reserve Bank of Atlanta
> Atlanta, GA 30303
> 404-521-8757 (voice)
> 404-521-8810 (fax)
> mark.fisher at
> personal web page:

  • Prev by Date: Re: bug in complex integral?
  • Next by Date: Re: Surface Graphics versus Graphics3D features
  • Previous by thread: Re: bug in complex integral?
  • Next by thread: Re: Expanding a nested structure (pattern matching?)[Correction]