       Re: Re: Bug in Integrate ?

• To: mathgroup at smc.vnet.net
• Subject: [mg17927] Re: [mg17913] Re: [mg17879] Bug in Integrate ?
• From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
• Date: Sat, 5 Jun 1999 02:56:00 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Bob,
The expressions are not equivalent for all values of x (as Wil correctly
pointed out). Just try substituting actual values:

In:=
I*(1 + y)*(Log[1 - (I*x)/(1 + y)] -
Log[1 + (I*x)/(1 + y)] -
Log[1 - (I*(1 + x))/(1 + y)] +
Log[1 + (I*(1 + x))/(1 + y)] +
Log[1 - (I*(1 + y))/x] - Log[1 + (I*(1 + y))/x] -
Log[1 - (I*(1 + y))/(1 + x)] +
Log[1 + (I*(1 + y))/(1 + x)]) == 0/.{x->-Random[],y->1}
Out=
False

While

In:=
I*(1 + y)*(Log[1 - (I*x)/(1 + y)] -
Log[1 + (I*x)/(1 + y)] -
Log[1 - (I*(1 + x))/(1 + y)] +
Log[1 + (I*(1 + x))/(1 + y)] +
Log[1 - (I*(1 + y))/x] - Log[1 + (I*(1 + y))/x] -
Log[1 - (I*(1 + y))/(1 + x)] +
Log[1 + (I*(1 + y))/(1 + x)]) == 0/.{x->Random[],y->1}
Out=
True

Your argument makes use of the relations {Log[x_] + Log[y_] -> Log[x*y],
Log[x_] - Log[y_] -> Log[x/y]}] but of course they do not hold in the
whole complex plane e.g.

In:=
Log[(-1)*(-1)]
Out=
0

In:=
Log[-1]+Log[-1]
Out=
2 I Pi

--
Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp
http://eri2.tuins.ac.jp

----------
>From: BobHanlon at aol.com
To: mathgroup at smc.vnet.net
>To: mathgroup at smc.vnet.net
>Subject: [mg17927] [mg17913] Re: [mg17879] Bug in Integrate ?
>Date: Thu, Jun 3, 1999, 3:58 PM
>

>
> In a message dated 5/31/99 11:30:03 PM, rcwil at win.tue.nl writes:
>
>>Looking in the archives of this discussion group didn't give me an
>>to my problem:
>>The result that Mathematica gives after integration of this elementary
>>function
>>doesn't seem to be correct in the region -1<x<0:
>>
>>Integrate[Log[(x-s)^2+(y+1)^2],{s,-1,0}]
>>
>>gives:
>>
>>2*(1 + y)*ArcTan[(1 + y)/x] -
>>  2*(1 + y)*ArcTan[(1 + y)/(1 + x)] -
>>  x*(-2 + Log[x^2 + (1 + y)^2]) +
>>  (1 + x)*(-2 + Log[(1 + x)^2 + (1 + y)^2])
>>
>>This expression is not correct for all values of x.
>>Replacing y+1 by y in the previous function and after
>>integration substituting y+1 again gives the correct result
>>for all values of x:
>>
>>Integrate[Log[(x-s)^2+y^2],{s,-1,0}]/.y>y+1
>>
>>-2*(1 + y)*ArcTan[x/(1 + y)] +
>>  2*(1 + y)*ArcTan[(1 + x)/(1 + y)] -
>>  x*(-2 + Log[x^2 + (1 + y)^2]) +
>>  (1 + x)*(-2 + Log[(1 + x)^2 + (1 + y)^2])
>>
>>My questions are: Is this a bug? Did I overlook the archives
>>to correct this problem?
>>
>
> Wil,
>
> The two representations appear to be equivalent
>
> \$Version
>
> "Power Macintosh 3.0 (May 6, 1997)"
>
> integral1 = Integrate[Log[(x-s)^2+(y+1)^2],{s,-1,0}]
>
> 2*(1 + y)*ArcTan[(1 + y)/x] -
>   2*(1 + y)*ArcTan[(1 + y)/(1 + x)] -
>   x*(-2 + Log[x^2 + (1 + y)^2]) +
>   (1 + x)*(-2 + Log[(1 + x)^2 + (1 + y)^2])
>
> integral2 = (Integrate[Log[(x-s)^2+y^2],{s,-1,0}]/.y->y+1)
>
> -2*(1 + y)*ArcTan[x/(1 + y)] +
>   2*(1 + y)*ArcTan[(1 + x)/(1 + y)] -
>   x*(-2 + Log[x^2 + (1 + y)^2]) +
>   (1 + x)*(-2 + Log[(1 + x)^2 + (1 + y)^2])
>
> FullSimplify[integral1 == integral2]
>
> 2*(1 + y)*(ArcTan[x/(1 + y)] - ArcTan[(1 + x)/(1 + y)] +
>      ArcTan[(1 + y)/x] - ArcTan[(1 + y)/(1 + x)]) == 0
>
> FullSimplify[TrigToExp[%]]
>
> I*(1 + y)*(Log[1 - (I*x)/(1 + y)] -
>      Log[1 + (I*x)/(1 + y)] -
>      Log[1 - (I*(1 + x))/(1 + y)] +
>      Log[1 + (I*(1 + x))/(1 + y)] +
>      Log[1 - (I*(1 + y))/x] - Log[1 + (I*(1 + y))/x] -
>      Log[1 - (I*(1 + y))/(1 + x)] +
>      Log[1 + (I*(1 + y))/(1 + x)]) == 0
>
> FullSimplify[% //. {Log[x_] + Log[y_] -> Log[x*y],
>   Log[x_] - Log[y_] -> Log[x/y]}]
>
> True
> ____________________________
>
> Version 4 arrives at log representations directly:
>
> \$Version
>
> "4.0 for Power Macintosh (April 20, 1999)"
>
> integral1 = Integrate[Log[(x - s)^2 + (y + 1)^2], {s, -1, 0}]
>
> I*(2*I + Log[(-I + x - I*y)/x] + y*Log[(-I + x - I*y)/x] -
>   Log[(1 - I + x - I*y)/(1 + x)] -
>   y*Log[(1 - I + x - I*y)/(1 + x)] - Log[(I + x + I*y)/x] -
>   y*Log[(I + x + I*y)/x] + Log[(1 + I + x + I*y)/(1 + x)] +
>   y*Log[(1 + I + x + I*y)/(1 + x)] +
>   I*x*Log[1 + x^2 + 2*y + y^2] -
>   I*Log[2 + 2*x + x^2 + 2*y + y^2] -
>   I*x*Log[2 + 2*x + x^2 + 2*y + y^2])
>
> integral2 = (Integrate[Log[(x - s)^2 + y^2], {s, -1, 0}] /. y -> y + 1)
>
> -I*(-2*I - (1 + y)*Log[(1 - I - I*x + y)/(1 + y)] -
>   (1 + y)*Log[(1 + I*x + y)/(1 + y)] +
>   (1 + y)*Log[(1 + I + I*x + y)/(1 + y)] +
>   (1 + y)*Log[(-I*(x + I*(1 + y)))/(1 + y)] -
>   I*x*Log[x^2 + (1 + y)^2] +
>   I*Log[1 + 2*x + x^2 + (1 + y)^2] +
>   I*x*Log[1 + 2*x + x^2 + (1 + y)^2])
>
> At this point, it is convenient to include the assumption that
> y != -1
>
> FullSimplify[integral1 == integral2, y != -1]
>
> Log[(1 - I + x - I*y)/(1 + x)] + Log[1 + (I*x)/(1 + y)] +
>   Log[1 - (I*(1 + x))/(1 + y)] + Log[(x + I*(1 + y))/x] ==
>  Log[(1 + I + x + I*y)/(1 + x)] + Log[1 - (I*x)/(1 + y)] +
>   Log[1 + (I*(1 + x))/(1 + y)] + Log[(x - I*(1 + y))/x]
>
> FullSimplify[% //. Log[x_] + Log[y_] -> Log[x*y]]
>
> True
>
>
> Bob Hanlon

```

• Prev by Date: Insufficient Memory
• Next by Date: need help hiding display formulas
• Previous by thread: Re: Insufficient Memory
• Next by thread: need help hiding display formulas