MathGroup Archive 1991

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

Search the Archive

RE: Integrate bug

  • To: "mathgroup at yoda.ncsa.uiuc.edu"@gte.com
  • Subject: RE: Integrate bug
  • From: blachman%gtewd.dnet at gte.com (NELSON M. BLACHMAN)
  • Date: Mon, 25 Feb 91 17:00:49 -0500

Mathematica (MS-DOS 386/7) 1.2 (September 27, 1989) [With pre-loaded data]
by S. Wolfram, D. Grayson, R. Maeder, H. Cejtin,
   S. Omohundro, D. Ballman and J. Keiper
with I. Rivin, D. Withoff and T. Sherlock
Copyright 1988,1989 Wolfram Research Inc.

In[1]:= Integrate[E^(I x) Cos[x], {x, 0, 2Pi}]

Out[1]= 0  (Wrong!)

In[2]:= Integrate[Cos[ x] Cos[x], {x, 0, 2Pi}]

Out[2]= Pi  (Right!)

In[3]:= Integrate[Sin[ x] Cos[x], {x, 0, 2Pi}]

Out[3]= 0  (Right!)

In[4]:= Integrate[(Cos[x] + I Sin[x]) Cos[x], {x, 0, 2Pi}]

Out[4]= Pi  (Right!)

In[5]:= Integrate[E^(I x) (E^(I x) + E^(-I x))/2, {x, 0, 2 Pi}]

Out[5]= 0  (Wrong!)

In[13]:= Integrate[E^(I x) Cos[x], x]

         -I  2 I x   -I      I x
Out[13]= -- E      + -- Log[E   ]  (Right but absurd!)
         4           2

  Mathematica's error in evaluating the definite integral evidently stems from 
evaluating this absurd logarithm on the wrong Riemann sheet.  Evidently Mma 
notices that 			   E^{I x}       d E^{I x}
		E^{I x} E^{-I x} = ------- = - I --------- / E^{I x},
				   E^{I x}          dx

thus finding the indefinite integral of this expression to be  -I Log[E^{I x}] 
without ever noticing the cancellation that was possible at the very start.

					Nelson M. Blachman
					GTE Government Systems Corp.
					Mountain View, California
					blachman%gtewd.dnet at gte.com


  • Prev by Date: Spirals and shells
  • Next by Date: gray levels
  • Previous by thread: Re: Integrate bug
  • Next by thread: Non-Negative Least Squares (Gaussian)