       Re: What is wrong?

• To: mathgroup at smc.vnet.net
• Subject: [mg7711] Re: [mg7696] What is wrong?
• From: "C. Woll" <carlw at u.washington.edu>
• Date: Wed, 2 Jul 1997 14:21:31 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```On Sun, 29 Jun 1997, Sergio Rojas wrote:

>
>
> In:= Integrate[x*Sin[x]/(x^2+1),{x,0,Infinity}]
>
>         Pi
> Out= ---
>         2 E
>
> In:= f[x_] = Evaluate[ Integrate[x*Sin[x]/(x^2+1),x]] ;
>
> In:= ans = f[Infinity] - f
>
>         E Pi
> Out= ----
>          2
>
> In:= \$Version
>
> Out= DEC OSF/1 Alpha 2.2 (September 9, 1994)
>

Hi Sergio,

Using mma 3.0, the two methods agree. If you look at the result returned
by mma 2.2 for the indefinite integral, you will notice that it has terms
like

CosIntegral[I-x]

whereas mma 3 instead has terms like

CosIntegral[I+x]

Note that the difference between these two expressions depends on which
branch in the complex plane you take, but does not depend on x. Thus,
derivatives of the above expressions will be the same.

Now, the reason for the discrepancy between the two methods in mma 2.2
lies in the fact that the CosIntegral function with a complex argument is
an integral in the complex domain. Anytime you evaluate these types of
integrals, you run the risk of not taking consistent branch cuts.  Thus,
if you are interested in definite integrals of a real function, it is
better to use NIntegrate

Carl Woll

```

• Prev by Date: Problem with Mathematica Student Addition on Win95 using Kreyszig's example?
• Next by Date: Re: Error in basic integrals
• Previous by thread: Re: What is wrong?
• Next by thread: Re: What is wrong?