Re: problem with Integrate
- To: mathgroup at smc.vnet.net
- Subject: [mg23199] Re: problem with Integrate
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Mon, 24 Apr 2000 01:12:06 -0400 (EDT)
- Organization: Wolfram Research, Inc.
- References: <8d94s6$i4a@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jack Michel CORNIL wrote: > > Hello, > > I am reading a paper about classical algorithmic methods > for integrating rational function and I am very > surprised that Mathematica is unable to give a "good" > expression of the following integral > > p = 7*x^13 + 10*x^8 + 4*x^7 - 7*x^6 - 4*x^3 - 4*x^2 + 3*x + 3; > > q = x^14 - 2*x^8 - 2*x^7 - 2*x^4 - 4*x^3 - x^2 + 2*x + 1; > > Integrate[p/q, x] > > 1/2*RootSum[#1^14 - 2*#1^8 - 2*#1^7 - 2*#1^4 - 4*#1^3 - > #1^2 + 2*#1 + 1 & , > (7*log*(x - #1)*#1^13 + 10*log*(x - #1)*#1^8 + > 4*log*(x - #1)*#1^7 - 7*log*(x - #1)*#1^6 - > 4*log*(x - #1)*#1^3 - 4*log*(x - #1)*#1^2 + > 3*log*(x - #1)*#1 + 3*log*(x - #1))/ > (7*#1^13 - 8*#1^7 - 7*#1^6 - 4*#1^3 - 6*#1^2 - #1 + > 1) & ] > > then the Rothstein/Trager method with a calculus > of resultant gives quickly a good expression with > two logarithmic functions. > > Do I understand that for rational functions Mathematica > uses only the elementary methods teached to students > in an introductory course about integration ? > > Or is there some option for the function Integrate > asking Mathematica using other algorithms ? Following up in e-mail (where I was sent a reference along with the preferred result), I ran this and related examples in a debugger. I found that we avoid the Rothstein-Trager form whenever roots of the relevant resultant are not all linear (over the rationals). This avoidance turns out to be a good idea, often enough, because the complexity of the R-T form actually can get quite bad if fed roots of, say, a cubic polynomial. But for many purposes quadratic roots give a nicer result than the likes of what is shown above. So experimentally I changed our development version to allow R-T to have quadratic roots from the resultant. If we verify that this causes no harm after extensive testing then it will appear in a future release. > By the way, I found a bug (I suppose) when using twice > the function Integrate as follow > > y = (-7*Sqrt[2]*x^6 + 7*x^6 + 2*Sqrt[2]*x - 4*x + 2*Sqrt[2] - 3)/ > (2*(x^7 + Sqrt[2]*x^2 + Sqrt[2]*x - x - 1)); > > Integrate[y, x] > > -(1/2)*RootSum[#1^7 + Sqrt[2]*#1^2 + Sqrt[2]*#1 - #1 - > 1 & , (7*Sqrt[2]*log*(x - #1)*#1^6 - > 7*log*(x - #1)*#1^6 - 2*Sqrt[2]*log*(x - #1)*#1 + > 4*log*(x - #1)*#1 - 2*Sqrt[2]*log*(x - #1) + > 3*log*(x - #1))/(7*#1^6 + 2*Sqrt[2]*#1 + Sqrt[2] - > 1) & ] > > Integrate[y, x] > > -(1/2)*RootSum[#1^7 + Sqrt[2]*#1^2 + Sqrt[2]*#1 - #1 - > 1 & , (-7*log*(x - #1)*#1^6 + 7*log*(x - #1)* > Integrate`A*1[6]*#1^6 + 4*log*(x - #1)*#1 - > 2*log*(x - #1)*Integrate`A*1[6]*#1 + > 3*log*(x - #1) - 2*log*(x - #1)*Integrate`A*1[6])/ > (7*#1^6 + 2*Integrate`A*1[6]*#1 + Integrate`A*1[6] - > 1) & ] > > I don't understand the appearing of Integrate`A*1[6] > in the second expression . > Such a thing was not existing in Release 3 This was an bug caused by internal caching of some intermediate computations (which in this case involve the internal variables that leaked out above). This too is fixed in our development version which will go into a future release. At present, to flush the appropriate cache, one can do: Developer`ClearCache["Symbolic"] Daniel Lichtblau Wolfram Research