       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

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

Out= 0  (Wrong!)

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

Out= Pi  (Right!)

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

Out= 0  (Right!)

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

Out= Pi  (Right!)

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

Out= 0  (Wrong!)

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

-I  2 I x   -I      I x
Out= -- 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)