       a bug in Integrate (2nd message)

• To: mathgroup at smc.vnet.net
• Subject: [mg122251] a bug in Integrate (2nd message)
• From: dimitris <dimmechan at yahoo.com>
• Date: Sat, 22 Oct 2011 06:07:58 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com

```int = 1/((x^2 + x + 1)*Sqrt[x^2 - x + 1]);

As I told in the previous message Mathematica gives wrong result for
the following integral

Integrate[int, {x, -1, 0}]

the problem is (I guess from what I figured out in the previous
message) that after applying the Risch algorithm and gets an
antiderivative

intMath = Integrate[int, x]

Mathematica uses the fundamental theorem of Calculus incorrectly
failing to take into account the jump singularity that possesses the
antiderivative in the integration range.

Let's figure out where is this jump.

In:= ff = Expand[intMath]

Out:=(-(1/2))*Sqrt[(1/3)*(1 + I*Sqrt)]*
ArcTan[(3*(1 - x + x^2)*(I*Sqrt - x + x^2))/(3*I + Sqrt -
2*Sqrt*x^4 -
Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2] +
2*x^3*(3*I + Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]) +
x*(3*I - 3*Sqrt + Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2])
+
x^2*(-3*I + Sqrt +
Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]))] - (1/2)*
Sqrt[(1/3)*(1 - I*Sqrt)]*
ArcTan[(3*(I*Sqrt + x - x^2)*(1 - x + x^2))/(3*I - Sqrt +
2*Sqrt*x^4 + Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2] +
x^3*(6*I - 2*Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2]) +
x*(3*I + 3*Sqrt - Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2])
-
x^2*(3*I + Sqrt +
Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2]))] + (1/4)*I*
Sqrt[(1/3)*(1 - I*Sqrt)]*
Log[16*(1 + x + x^2)^2] - (1/4)*I*Sqrt[(1/3)*(1 + I*Sqrt)]*
Log[16*(1 + x + x^2)^2] +
(1/4)*I*Sqrt[(1/3)*(1 + I*Sqrt)]*
Log[(1 + x + x^2)*(11*I + 4*Sqrt + (11*I + 4*Sqrt)*x^2 +
10*I*Sqrt[1 - I*Sqrt]*Sqrt[1 - x + x^2] -
x*(17*I + 4*Sqrt +
8*I*Sqrt[1 - I*Sqrt]*Sqrt[1 - x + x^2]))] -
(1/4)*I*Sqrt[(1/3)*(1 - I*Sqrt)]*
Log[(1 + x + x^2)*(-11*I + 4*Sqrt + (-11*I + 4*Sqrt)*x^2 -
10*I*Sqrt[1 + I*Sqrt]*Sqrt[1 - x + x^2] +
x*(17*I - 4*Sqrt +
8*I*Sqrt[1 + I*Sqrt]*Sqrt[1 - x + x^2]))]

In:= Length[ff]

Out= 6

In:= ({#1, Plot[Evaluate[Re[ff[[#1]]]], {x, -3, 3}]} & ) /@
Range[Length[ff]]

The first two terms of ff (which contain ArcTan) have jump in the same
point.

In:= ff[]
ff[]

Out= (-(1/2))*Sqrt[(1/3)*(1 + I*Sqrt)]*
ArcTan[(3*(1 - x + x^2)*(I*Sqrt - x + x^2))/
(3*I + Sqrt - 2*Sqrt*x^4 -
Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2] +
2*x^3*(3*I + Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]) +
x*(3*I - 3*Sqrt + Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]) +

x^2*(-3*I + Sqrt + Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]))]

Out= (-(1/2))*Sqrt[(1/3)*(1 - I*Sqrt)]*
ArcTan[(3*(I*Sqrt + x - x^2)*(1 - x + x^2))/
(3*I - Sqrt + 2*Sqrt*x^4 +
Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2] +
x^3*(6*I - 2*Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2]) +
x*(3*I + 3*Sqrt - Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2]) -

x^2*(3*I + Sqrt + Sqrt[3 + 3*I*Sqrt]*Sqrt[1 - x + x^2]))]

In particular the jump is at the point:

In:= (N[#1, 20] & )[Re[Select[
x /. Solve[3*I + Sqrt - 2*Sqrt*x^4 -
Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2] +
2*x^3*(3*I + Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]) +
x*(3*I - 3*Sqrt +
Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]) +
x^2*(-3*I + Sqrt +
Sqrt[3 - 3*I*Sqrt]*Sqrt[1 - x + x^2]) == 0], -1 <
Re[#1] < 0 && Abs[Abs[#1] - 0.7] < 0.1 & ][[
1]]]]

Out= -0.72241927849008646432307690472106948257`20.

or in symbolic form

jump = 1/6 + Re[(I*(1 + I*Sqrt)*(1 -
5*I*Sqrt))/(12*(-71*I + 9*Sqrt +
Sqrt[-5022 - 918*I*Sqrt])^(1/3)) -
(1/12)*I*(1 - I*Sqrt)*(-71*I + 9*Sqrt +
Sqrt[-5022 - 918*I*Sqrt])^(1/3)];

Unfortunately, Mathematica fails to evaluate the side limits

Limit[intMath,x->jump,Direction->1]
and
Limit[intMath,x->jump,Direction->-1]

The package NLimit fails as well.

So I think the only solution is to help a bit Mathematica in order to
get an antiderivative continuous in the whole real axis.
The question is how?

Dimitris Anagnostou

P.S. In another forum a user gave the following antiderivative:

intUser=ArcTan[(Sqrt*(1 + x))/Sqrt[1 - x + x^2]]/Sqrt +
ArcTanh[(Sqrt[2/3]*(-1 + x))/Sqrt[1 - x + x^2]]/Sqrt;

which is correct in the whole complex plane

D[intUser, x] - 1/((x^2 + x + 1) Sqrt[x^2 - x + 1]) // FullSimplify
0

and possesses no jump in the whole real axis.

Hence the definite integral in the range [-1,0] is

In:= FullSimplify[int /. x -> 0 - int /. x -> -1]

Out= (3/13)*Sqrt[3*(4 + Sqrt)]

In:= N[%] (*check*)

Out= 0.956959

```

• Prev by Date: Re: count the number of sub-list in a list
• Next by Date: Re: strange error
• Previous by thread: a bug in Integrate
• Next by thread: Re: a bug in Integrate (2nd message)