Re: Integrate (undocumented feature)

• To: mathgroup at smc.vnet.net
• Subject: [mg20787] Re: Integrate (undocumented feature)
• From: "Bill Bertram" <wkb at ansto.gov.au>
• Date: Thu, 11 Nov 1999 00:22:55 -0500
• Organization: Australian Nuclear Science and Technology Organisation
• References: <80asap\$it2@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Ersek, Ted R wrote in message <80asap\$it2 at smc.vnet.net>...
>Earlier I wrote about the following results using Version 4.
>-------------------------------------
>
>
>The documentation for NIntegrate says:
>"NIntegrate[f, {x,x0,x1, ... ,xk}] tests for singularities at each of the
>intermediate points xi. If there are no singularities, the result is
>equivalent to an integral from x0 to xk. You can use complex numbers xi to
>specify an integration contour in the complex plane."
>
>Although the documentation doesn't say so it seems this applies to
Integrate
>as well.  When I wrote the previous email I was thinking of the line above,
>but didn't remember that I read this in the documentation for NIntegrate
not
>Integrate.
>
>Below I give convincing evidence that this works with Integrate. Here I
>integrate along a closed contour in the complex plane.  Notice I get the
>same answer when I apply a theorem related to Residues.
>
>In[1]:=
>Integrate[1/(z^2+4),
>    {z,-1,1,1+3I,-1+3I,-1}]
>Out[1]=
>Pi/2
>
>
>In[2]:=
>(2 Pi I)Residue[1/(z^2+4),{z,2I}]
>Out[2]=
>Pi/2

>I think the documentation for Integrate should be changed to mention this
>feature.

Or perhaps it should be avoided altogether!
Consider the following,

Integrate[1/(x - 2I), {x, -1, 1, 1 + 3I, -1 + 3I, -1}] // FullSimplify

this gives  the result  I Pi (wrong by a factor 2)

And upon changing the contour  (still closed and around the singularity)

Integrate[
1/(x - 2I), {x, -1 - I, 1 - I, 1 + 3I, -1 + 3I, -1 - I}] // FullSimplify

the result is 0.

Not the sort of results to inspire confidence in Mathematica's integration
methods!

(NIntegrate does give the correct result for both contours however)

Cheers,

Bill

```

• Prev by Date: Re: Limit[ArcTan]
• Next by Date: Re: LOW-PASS FILTER
• Previous by thread: Integrate (undocumented feature)
• Next by thread: RE: Integrate (undocumented feature)