Message Boards Message Boards

2
|
7576 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Doing an integral: From Mathematica Version 1.0 to 11.0

Posted 9 years ago

In the book "$Mathematica$ A System for Doing Mathematics by Computer", Addison-Wesley, 1988, § 0.4, p. 7 the following integral is given:

(* V 1.0 *)   
 In[6]:= Integrate[x/(1 - x^3), x]
 Out[6]= -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[-1 + x] + 
     1/6 Log[1 + x + x^2]

now it reads

 (* V 11.0 *)
 In[1]:= Integrate[x/(1 - x^3), x]
 Out[1]= -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[1 - x] + 
     1/6 Log[1 + x + x^2]

The logarithm changed the sign of its argument. The funktion x/(1 - x^3) has a singularity at x = 1, so let's test the result for x > 1:

In[2]:= Clear[f]
f[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[1 - x] + 
1/6 Log[1 + x + x^2]

with

In[6]:= Limit[f[x], x -> \[Infinity]]
Out[6]= -(1/6) (2 I + Sqrt[3]) \[Pi]

The definite integral works because both summands have the same imaginary part:

In[5]:= Limit[f[x], x -> \[Infinity]] - f[2] // Simplify
Out[5]= 1/6 (-Sqrt[3] \[Pi] + 2 Sqrt[3] ArcTan[5/Sqrt[3]] - Log[7])

 In[7]:= N[%5]
 Out[7]= -0.516849

 In[8]:= NIntegrate[x/(1 - x^3), {x, 2, \[Infinity]}]
 Out[8]= -0.516849

the correct solution is

In[10]:= fL[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 
  1/3 Log[Abs[1 - x]] + 1/6 Log[1 + x + x^2]

In[11]:= Limit[fL[x], x -> \[Infinity]]
Out[11]= -(\[Pi]/(2 Sqrt[3]))

In[13]:= fL[2]
Out[13]= -(ArcTan[5/Sqrt[3]]/Sqrt[3]) + Log[7]/6

without spurious imaginary parts, as the integral tables say.

POSTED BY: Udo Krause
4 Replies

Yes, but, with

Clear[f1, f11, fL]
f1[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[-1 + x] + 1/6 Log[1 + x + x^2]
f11[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[1 - x] + 1/6 Log[1 + x + x^2]
fL[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[Abs[1 - x]] + 1/6 Log[1 + x + x^2]

the integral table solution fL pretends to deliver the area under the real valued function (in the sense of Riemann) for $x\in[0,2]$

In[38]:= fL[2] - fL[0] // N
Out[38]= -0.0877506

In[40]:= f11[2] - f11[0] // N
Out[40]= -0.0877506 - 1.0472 I

In[41]:= f1[2] - f1[0] // N
Out[41]= -0.0877506 + 1.0472 I

whereas the correct anti-derivatives do not. Because there is a singularity at x = 1 let's show that fL does the job right. One rotates the function for $x\in[1,2]$ by 180° and considers the difference with the original function for $x\in[0,1]$.

Clear[f, fleft, fright]
f[x_] := x/(1 - x^3)
fleft[x_ /; 0 <= x <= 1] := f[x]
fright[x_ /; 0 <= x <= 1] :=(* Last[RotationTransform[\[Pi],{1,0}][{t,t/(1-t^3)}]]//.t\\[Rule]2-x *)
                            -((2 - x)/(1 - (2 - x)^3))

This way one has

In[137]:= Integrate[x/(1 - x^3) + (2 - x)/(1 - (2 - x)^3), {x, 0, 1}]
Out[137]= 1/18 (Sqrt[3] \[Pi] - 6 Sqrt[3] ArcTan[5/Sqrt[3]] + Log[343])

with other words

In[138]:= Integrate[x/(1 - x^3) + (2 - x)/(1 - (2 - x)^3), {x, 0, 1.}]
Out[138]= -0.0877506

as fL said.

POSTED BY: Udo Krause

Because you intended the argument being of no influence to this question,

Clear[f1, f11, fL]
    f1[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[-1 + x] + 
      1/6 Log[1 + x + x^2]
    f11[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 1/3 Log[1 - x] + 
      1/6 Log[1 + x + x^2]
    fL[x_] := -(ArcTan[(1 + 2 x)/Sqrt[3]]/Sqrt[3]) - 
      1/3 Log[Abs[1 - x]] + 1/6 Log[1 + x + x^2]

you could have said

In[31]:= Simplify[PowerExpand[f1[z + 1] - f11[z + 1], Assumptions -> {}]]
Out[31]= \[Piecewise]   -((I \[Pi])/3)    Arg[z]>0
                          (I \[Pi])/3     True
POSTED BY: Udo Krause

Both are correct antiderivatives.

POSTED BY: Daniel Lichtblau

Maybe I'm wrong, but you can add any (complex) constant to a integral right?

Log(1-x) + I Pi
Log(1-x) + Log(Exp(I Pi))
Log(Exp(I Pi)(1-x))
Log(x-1)

Is this correct?

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract