Integrate (undocumented feature)
- To: mathgroup at smc.vnet.net
- Subject: [mg20715] Integrate (undocumented feature)
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Wed, 10 Nov 1999 00:17:35 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Earlier I wrote about the following results using Version 4. ------------------------------------- In[1]:= Integrate[Sqrt[2-Sin[x]],{x,1,4}] Out[1]= (*** Wrong answer ***) -2*EllipticE[(-4 + Pi/2)/2, -2] + 2*EllipticE[(-1 + Pi/2)/2, -2] + 4*EllipticF[I*ArcSinh[1/Sqrt[2]], -2] In[2]:= Integrate[Sqrt[2-Sin[x]],{x,1,Pi/2,4}] Out[2]= (*** Right answer ***) -2*EllipticE[(-4 + Pi/2)/2, -2] + 2*EllipticE[(-1 + Pi/2)/2, -2] ------------------------------- Then Bob Hanlon replied: I cannot find any documentation in the on-line Help nor at http://www.dot.net.au/~elisha/ersek/Tricks.html for use of the additional (third of four) argument in the iterator in Integrate (Pi/2 in this case). What is this argument doing and where is its use documented? ------------------------------- ANSWER: 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}]//FullSimplify 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. -------------------------------- Regards, Ted Ersek For Mathematica tips, tricks see http://www.dot.net.au/~elisha/ersek/Tricks.html