Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Q: Why did the lone ranger kill Tonto? A: He found out what "kimosabe" really means.


sci / sci.math.symbolic / Re: A rational integral and Rioboo's algorithm

SubjectAuthor
* A rational integral and Rioboo's algorithmSam Blake
`* Re: A rational integral and Rioboo's algorithmclicliclic@freenet.de
 +* Re: A rational integral and Rioboo's algorithmRichard Fateman
 |`* Re: A rational integral and Rioboo's algorithmclicliclic@freenet.de
 | `* Re: A rational integral and Rioboo's algorithmSam Blake
 |  `* Re: A rational integral and Rioboo's algorithmSam Blake
 |   `* Re: A rational integral and Rioboo's algorithmclicliclic@freenet.de
 |    `- Re: A rational integral and Rioboo's algorithmclicliclic@freenet.de
 `- Re: A rational integral and Rioboo's algorithmclicliclic@freenet.de

1
Subject: A rational integral and Rioboo's algorithm
From: Sam Blake
Newsgroups: sci.math.symbolic
Date: Tue, 2 Jan 2024 00:59 UTC
X-Received: by 2002:ad4:4aee:0:b0:67f:955d:1b32 with SMTP id cp14-20020ad44aee000000b0067f955d1b32mr177660qvb.12.1704157182618;
Mon, 01 Jan 2024 16:59:42 -0800 (PST)
X-Received: by 2002:ac8:7d90:0:b0:428:b97:588e with SMTP id
c16-20020ac87d90000000b004280b97588emr675987qtd.3.1704157182402; Mon, 01 Jan
2024 16:59:42 -0800 (PST)
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.math.symbolic
Date: Mon, 1 Jan 2024 16:59:42 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=110.143.17.66; posting-account=wlWA4gkAAABfPzIzZZgzF-hX5pK428zY
NNTP-Posting-Host: 110.143.17.66
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com>
Subject: A rational integral and Rioboo's algorithm
From: samuel.thomas.blake@gmail.com (Sam Blake)
Injection-Date: Tue, 02 Jan 2024 00:59:42 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 44
View all headers

Hi All,

For fun I have been implementing the rational integral routines from Bronstein's Symbolic Integration I in Mathematica. As part of my testing I stumbled across the following example integral

\int x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4) dx

Rubi does well on this example

In[66]:= Int[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]

Out[66]= -(ArcTan[(1 + 2 x)/Sqrt[7 - 4 Sqrt[2]]]/(
2 Sqrt[2 (7 - 4 Sqrt[2])])) +
ArcTan[(1 + 2 x)/Sqrt[7 + 4 Sqrt[2]]]/(2 Sqrt[2 (7 + 4 Sqrt[2])]) -
ArcTanh[(7 + 4 (1/2 + x)^2)/(4 Sqrt[2])]/(2 Sqrt[2])

While my rational function integrator returns

In[67]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]

Out[67]= 1/2 (((-1 + I Sqrt[7 - 4 Sqrt[2]]) Log[
1/2 (1 - I Sqrt[7 - 4 Sqrt[2]]) + x])/(
2 (2 + 5/2 (-1 + I Sqrt[7 - 4 Sqrt[2]]) +
3/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^2 +
1/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 -
I Sqrt[7 - 4 Sqrt[2]]) Log[
1/2 (1 + I Sqrt[7 - 4 Sqrt[2]]) + x])/(
2 (2 + 5/2 (-1 - I Sqrt[7 - 4 Sqrt[2]]) +
3/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^2 +
1/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 +
I Sqrt[7 + 4 Sqrt[2]]) Log[
1/2 (1 - I Sqrt[7 + 4 Sqrt[2]]) + x])/(
2 (2 + 5/2 (-1 + I Sqrt[7 + 4 Sqrt[2]]) +
3/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^2 +
1/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^3)) + ((-1 -
I Sqrt[7 + 4 Sqrt[2]]) Log[
1/2 (1 + I Sqrt[7 + 4 Sqrt[2]]) + x])/(
2 (2 + 5/2 (-1 - I Sqrt[7 + 4 Sqrt[2]]) +
3/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^2 +
1/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^3)))

I find similar results from AXIOM and FriCAS. Is this a limitation of Rioboo's algorithm?

Cheers,

Sam

Subject: Re: A rational integral and Rioboo's algorithm
From: clicliclic@freenet.d
Newsgroups: sci.math.symbolic
Organization: Killfiles, Unlimited
Date: Tue, 2 Jan 2024 20:32 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.killfile.org!.POSTED.port-92-200-24-192.dynamic.as20676.net!not-for-mail
From: nobody@nowhere.invalid (clicliclic@freenet.de)
Newsgroups: sci.math.symbolic
Subject: Re: A rational integral and Rioboo's algorithm
Date: Tue, 02 Jan 2024 21:32:27 +0100
Organization: Killfiles, Unlimited
Message-ID: <659472DB.FF089BF@nowhere.invalid>
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: flea.killfile.org; posting-host="port-92-200-24-192.dynamic.as20676.net:92.200.24.192";
logging-data="3616495"; mail-complaints-to="news@news.killfile.org"
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de
View all headers

Sam Blake schrieb:
>
> For fun I have been implementing the rational integral routines from
> Bronstein's Symbolic Integration I in Mathematica. As part of my
> testing I stumbled across the following example integral
>
> \int x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4) dx
>
> Rubi does well on this example
>
> In[66]:= Int[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
>
> Out[66]= -(ArcTan[(1 + 2 x)/Sqrt[7 - 4 Sqrt[2]]]/(
> 2 Sqrt[2 (7 - 4 Sqrt[2])])) +
> ArcTan[(1 + 2 x)/Sqrt[7 + 4 Sqrt[2]]]/(2 Sqrt[2 (7 + 4 Sqrt[2])]) -
> ArcTanh[(7 + 4 (1/2 + x)^2)/(4 Sqrt[2])]/(2 Sqrt[2])
>
> While my rational function integrator returns
>
> In[67]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
>
> Out[67]= 1/2 (((-1 + I Sqrt[7 - 4 Sqrt[2]]) Log[
> 1/2 (1 - I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> 2 (2 + 5/2 (-1 + I Sqrt[7 - 4 Sqrt[2]]) +
> 3/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^2 +
> 1/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 -
> I Sqrt[7 - 4 Sqrt[2]]) Log[
> 1/2 (1 + I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> 2 (2 + 5/2 (-1 - I Sqrt[7 - 4 Sqrt[2]]) +
> 3/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^2 +
> 1/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 +
> I Sqrt[7 + 4 Sqrt[2]]) Log[
> 1/2 (1 - I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> 2 (2 + 5/2 (-1 + I Sqrt[7 + 4 Sqrt[2]]) +
> 3/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^2 +
> 1/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^3)) + ((-1 -
> I Sqrt[7 + 4 Sqrt[2]]) Log[
> 1/2 (1 + I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> 2 (2 + 5/2 (-1 - I Sqrt[7 + 4 Sqrt[2]]) +
> 3/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^2 +
> 1/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^3)))
>
> I find similar results from AXIOM and FriCAS. Is this a limitation of
> Rioboo's algorithm?
>

This is an interesting example. Derive 6.10 also solves the integral in
real terms:

INT(x/(2 + 4*x + 5*x^2 + 2*x^3 + x^4), x)

SQRT(238 - 136*SQRT(2))*ATAN(SQRT(119 - 68*SQRT(2))*(2*x + 1)/17)/68
- SQRT(136*SQRT(2) + 238)*ATAN(SQRT(68*SQRT(2) + 119)*(2*x + 1)/17)/68
+ SQRT(2)*LN((x^2 + x - SQRT(2) + 2)/(x^2 + x + SQRT(2) + 2))/8

as it starts by factoring the denominator:

2 + 4*x + 5*x^2 + 2*x^3 + x^4 =
(x^2 + x + SQRT(2) + 2)*(x^2 + x - SQRT(2) + 2)

and then expands the integrand into partial fractions. Indeed, the
cubic resolvent of the denominator factors as (y - 4)*(y^2 - y - 4).

By contrast, FriCAS 1.3.9 returns a whopping:
((34^(1/2)*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((-34)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(-34)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)))*log(((164*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+38*34^(1/2))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544
,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(38*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+5*34^(1/2)))*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+1292)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20
)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(1292*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+(-42)))))+(((-1)*34^(1/2)*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((-34)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(-34)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)))
*log((((-164)*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(-38)*34^(1/2))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-38)*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(-5)*34^(1/2)))*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+1292)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+
1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(1292*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+(-42)))))+(68*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)*log(((-11152)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(-2584))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+((-11152)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+340)*rootOf((136*rootOf
((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-11152)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+410*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+53)))+68*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*log(11152*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+(-2584)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-70)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+135)))))/68

which is the sum of three logarithms involving many nested rootOf()s
where the %%En denote local variables. The quartic of the inner
rootOf() factors as:

544*z^4 - 20*z^2 + 4*z + 1 =
1/17*(68*SQRT(2)*z^2 + 34*z + 3*SQRT(2) - 1)
*(68*SQRT(2)*z^2 - 34*z + 3*SQRT(2) + 1)

and its cubic resolvent is (34*y - 3)*(272*y^2 + 34*y + 1).

Let's see if FriCAS version 1.3.10 will do better.

Martin.

Subject: Re: A rational integral and Rioboo's algorithm
From: Richard Fateman
Newsgroups: sci.math.symbolic
Date: Wed, 3 Jan 2024 17:05 UTC
References: 1 2
X-Received: by 2002:a05:620a:4489:b0:781:5f1d:53e with SMTP id x9-20020a05620a448900b007815f1d053emr58286qkp.1.1704301511665;
Wed, 03 Jan 2024 09:05:11 -0800 (PST)
X-Received: by 2002:ac8:555a:0:b0:428:2ec0:773 with SMTP id
o26-20020ac8555a000000b004282ec00773mr395834qtr.10.1704301511424; Wed, 03 Jan
2024 09:05:11 -0800 (PST)
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.math.symbolic
Date: Wed, 3 Jan 2024 09:05:11 -0800 (PST)
In-Reply-To: <659472DB.FF089BF@nowhere.invalid>
Injection-Info: google-groups.googlegroups.com; posting-host=135.180.163.36; posting-account=wy-WGAoAAABUfYlyvtPTFsKujAiLOBd1
NNTP-Posting-Host: 135.180.163.36
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com> <659472DB.FF089BF@nowhere.invalid>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3e56a354-e43f-4ed5-aaee-7c6dcdba3c93n@googlegroups.com>
Subject: Re: A rational integral and Rioboo's algorithm
From: fateman@gmail.com (Richard Fateman)
Injection-Date: Wed, 03 Jan 2024 17:05:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 180
View all headers

On Tuesday, January 2, 2024 at 12:32:26 PM UTC-8, nob...@nowhere.invalid wrote:
> Sam Blake schrieb:
> >
> > For fun I have been implementing the rational integral routines from
> > Bronstein's Symbolic Integration I in Mathematica. As part of my
> > testing I stumbled across the following example integral
> >
> > \int x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4) dx
> >
> > Rubi does well on this example
> >
> > In[66]:= Int[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> >
> > Out[66]= -(ArcTan[(1 + 2 x)/Sqrt[7 - 4 Sqrt[2]]]/(
> > 2 Sqrt[2 (7 - 4 Sqrt[2])])) +
> > ArcTan[(1 + 2 x)/Sqrt[7 + 4 Sqrt[2]]]/(2 Sqrt[2 (7 + 4 Sqrt[2])]) -
> > ArcTanh[(7 + 4 (1/2 + x)^2)/(4 Sqrt[2])]/(2 Sqrt[2])
> >
> > While my rational function integrator returns
> >
> > In[67]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> >
> > Out[67]= 1/2 (((-1 + I Sqrt[7 - 4 Sqrt[2]]) Log[
> > 1/2 (1 - I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 + I Sqrt[7 - 4 Sqrt[2]]) +
> > 3/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^2 +
> > 1/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 -
> > I Sqrt[7 - 4 Sqrt[2]]) Log[
> > 1/2 (1 + I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 - I Sqrt[7 - 4 Sqrt[2]]) +
> > 3/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^2 +
> > 1/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 +
> > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > 1/2 (1 - I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 + I Sqrt[7 + 4 Sqrt[2]]) +
> > 3/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^2 +
> > 1/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^3)) + ((-1 -
> > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > 1/2 (1 + I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 - I Sqrt[7 + 4 Sqrt[2]]) +
> > 3/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^2 +
> > 1/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^3)))
> >
> > I find similar results from AXIOM and FriCAS. Is this a limitation of
> > Rioboo's algorithm?
> >
>
> This is an interesting example. Derive 6.10 also solves the integral in
> real terms:
>
> INT(x/(2 + 4*x + 5*x^2 + 2*x^3 + x^4), x)
>
> SQRT(238 - 136*SQRT(2))*ATAN(SQRT(119 - 68*SQRT(2))*(2*x + 1)/17)/68
> - SQRT(136*SQRT(2) + 238)*ATAN(SQRT(68*SQRT(2) + 119)*(2*x + 1)/17)/68
> + SQRT(2)*LN((x^2 + x - SQRT(2) + 2)/(x^2 + x + SQRT(2) + 2))/8
>
> as it starts by factoring the denominator:
>
> 2 + 4*x + 5*x^2 + 2*x^3 + x^4 =
> (x^2 + x + SQRT(2) + 2)*(x^2 + x - SQRT(2) + 2)
>
> and then expands the integrand into partial fractions. Indeed, the
> cubic resolvent of the denominator factors as (y - 4)*(y^2 - y - 4).
>
> By contrast, FriCAS 1.3.9 returns a whopping:
>
> ((34^(1/2)*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((-34)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(-34)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)))*log(((164*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+38*34^(1/2))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(38*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+5*34^(1/2)))*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+1292)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(1292*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+(-42)))))+(((-1)*34^(1/2)*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((-34)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(-34)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)))*log((((-164)*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(-38)*34^(1/2))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-38)*34^(1/2)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(-5)*34^(1/2)))*((-102)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(-68)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-102)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+5))^(1/2)+((5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+1292)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+(5576*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+(1292*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-170)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+(-42)))))+(68*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)*log(((-11152)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(-2584))*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)^2+((-11152)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+340)*rootOf((136*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+136*%%E1*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(136*%%E1^2+(-5))*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(136*%%E1^3+(-5)*%%E1+1))/136,%%E1)+((-11152)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+410*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+53)))+68*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)*log(11152*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^3+(-2584)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)^2+(-70)*rootOf((544*%%E0^4+(-20)*%%E0^2+4*%%E0+1)/544,%%E0)+(52*x+135)))))/68
>
> which is the sum of three logarithms involving many nested rootOf()s
> where the %%En denote local variables. The quartic of the inner
> rootOf() factors as:
>
> 544*z^4 - 20*z^2 + 4*z + 1 =
> 1/17*(68*SQRT(2)*z^2 + 34*z + 3*SQRT(2) - 1)
> *(68*SQRT(2)*z^2 - 34*z + 3*SQRT(2) + 1)
>
> and its cubic resolvent is (34*y - 3)*(272*y^2 + 34*y + 1).
>
> Let's see if FriCAS version 1.3.10 will do better.
>
> Martin.


Click here to read the complete article
Subject: Re: A rational integral and Rioboo's algorithm
From: clicliclic@freenet.d
Newsgroups: sci.math.symbolic
Organization: Killfiles, Unlimited
Date: Wed, 3 Jan 2024 18:07 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.killfile.org!.POSTED.port-92-196-197-255.dynamic.as20676.net!not-for-mail
From: nobody@nowhere.invalid (clicliclic@freenet.de)
Newsgroups: sci.math.symbolic
Subject: Re: A rational integral and Rioboo's algorithm
Date: Wed, 03 Jan 2024 19:07:56 +0100
Organization: Killfiles, Unlimited
Message-ID: <6595A27C.855B757A@nowhere.invalid>
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com> <659472DB.FF089BF@nowhere.invalid> <3e56a354-e43f-4ed5-aaee-7c6dcdba3c93n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: flea.killfile.org; posting-host="port-92-196-197-255.dynamic.as20676.net:92.196.197.255";
logging-data="4080120"; mail-complaints-to="news@news.killfile.org"
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de
View all headers

Richard Fateman schrieb:
>
> On Tuesday, January 2, 2024 at 12:32:26 PM UTC-8, nob...@nowhere.invalid wrote:
> >
> > Sam Blake schrieb:
> > >
> > > For fun I have been implementing the rational integral routines from
> > > Bronstein's Symbolic Integration I in Mathematica. As part of my
> > > testing I stumbled across the following example integral
> > >
> > > \int x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4) dx
> > >
> > > Rubi does well on this example
> > >
> > > In[66]:= Int[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> > >
> > > Out[66]= -(ArcTan[(1 + 2 x)/Sqrt[7 - 4 Sqrt[2]]]/(
> > > 2 Sqrt[2 (7 - 4 Sqrt[2])])) +
> > > ArcTan[(1 + 2 x)/Sqrt[7 + 4 Sqrt[2]]]/(2 Sqrt[2 (7 + 4 Sqrt[2])]) -
> > > ArcTanh[(7 + 4 (1/2 + x)^2)/(4 Sqrt[2])]/(2 Sqrt[2])
> > >
> > > While my rational function integrator returns
> > >
> > > In[67]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> > >
> > > Out[67]= 1/2 (((-1 + I Sqrt[7 - 4 Sqrt[2]]) Log[
> > > 1/2 (1 - I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > > 2 (2 + 5/2 (-1 + I Sqrt[7 - 4 Sqrt[2]]) +
> > > 3/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^2 +
> > > 1/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 -
> > > I Sqrt[7 - 4 Sqrt[2]]) Log[
> > > 1/2 (1 + I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > > 2 (2 + 5/2 (-1 - I Sqrt[7 - 4 Sqrt[2]]) +
> > > 3/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^2 +
> > > 1/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 +
> > > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > > 1/2 (1 - I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > > 2 (2 + 5/2 (-1 + I Sqrt[7 + 4 Sqrt[2]]) +
> > > 3/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^2 +
> > > 1/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^3)) + ((-1 -
> > > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > > 1/2 (1 + I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > > 2 (2 + 5/2 (-1 - I Sqrt[7 + 4 Sqrt[2]]) +
> > > 3/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^2 +
> > > 1/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^3)))
> > >
> > > I find similar results from AXIOM and FriCAS. Is this a limitation of
> > > Rioboo's algorithm?
> > >
> >
> > This is an interesting example. Derive 6.10 also solves the integral in
> > real terms:
> >
> > INT(x/(2 + 4*x + 5*x^2 + 2*x^3 + x^4), x)
> >
> > SQRT(238 - 136*SQRT(2))*ATAN(SQRT(119 - 68*SQRT(2))*(2*x + 1)/17)/68
> > - SQRT(136*SQRT(2) + 238)*ATAN(SQRT(68*SQRT(2) + 119)*(2*x + 1)/17)/68
> > + SQRT(2)*LN((x^2 + x - SQRT(2) + 2)/(x^2 + x + SQRT(2) + 2))/8
> >
> > as it starts by factoring the denominator:
> >
> > 2 + 4*x + 5*x^2 + 2*x^3 + x^4 =
> > (x^2 + x + SQRT(2) + 2)*(x^2 + x - SQRT(2) + 2)
> >
> > and then expands the integrand into partial fractions. Indeed, the
> > cubic resolvent of the denominator factors as (y - 4)*(y^2 - y - 4).
> >
> > By contrast, FriCAS 1.3.9 returns a whopping:
> >
> > [...]
> >
> > which is the sum of three logarithms involving many nested rootOf()s
> > where the %%En denote local variables. The quartic of the inner
> > rootOf() factors as:
> >
> > 544*z^4 - 20*z^2 + 4*z + 1 =
> > 1/17*(68*SQRT(2)*z^2 + 34*z + 3*SQRT(2) - 1)
> > *(68*SQRT(2)*z^2 - 34*z + 3*SQRT(2) + 1)
> >
> > and its cubic resolvent is (34*y - 3)*(272*y^2 + 34*y + 1).
> >
> > Let's see if FriCAS version 1.3.10 will do better.
> >
>
> In Maxima ... factor the denominator in an algebraic field...
>
> (%o4) x^4+2*x^3+5*x^2+4*x+2
> (%i5) factor(%, subst(a,x,%));
>
> (%o5) (x-a)*(x+a+1)*(x^2+x+a^2+a+4)
>
> from which integration produces a relatively compact form.

This expresses the factors of the denominator in terms of any one still
unknown root. Even though all of the roots are complex:

SOLUTIONS(a^4 + 2*a^3 + 5*a^2 + 4*a + 2 = 0, a)

[- 1/2 + #i*SQRT(4*SQRT(2) + 7)/2, - 1/2 - #i*SQRT(4*SQRT(2) + 7)/2,
- 1/2 + #i*SQRT(7 - 4*SQRT(2))/2, - 1/2 - #i*SQRT(7 - 4*SQRT(2))/2]

the constant a^2 + a in the quadratic factor is real for any of them,
and so will then be an antiderivative based on the decomposition:

x^4 + 2*x^3 + 5*x^2 + 4*x + 2 =
(x^2 + x - a^2 - a)*(x^2 + x + a^2 + a + 4)

in which the pair of linear factors is treated as a another quadratic.

If the code in Bronstein's book is indeed claimed to produce a real
antiderivative for

IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]

and nothing has been overlooked in the code itself, there should be a
bug in the Mathematica implementation. Breaking four complex logarithms
up into real and imaginary parts should be within the capabilities of
programming on Mathematica - the imaginary parts would finally cancel.
If the code can identify complex conjugate pairs, the imaginary parts
could be ignored right away.

Martin.

Subject: Re: A rational integral and Rioboo's algorithm
From: Sam Blake
Newsgroups: sci.math.symbolic
Date: Thu, 4 Jan 2024 01:24 UTC
References: 1 2 3 4
X-Received: by 2002:ac8:48d2:0:b0:428:32ad:a6c4 with SMTP id l18-20020ac848d2000000b0042832ada6c4mr182206qtr.0.1704331444175;
Wed, 03 Jan 2024 17:24:04 -0800 (PST)
X-Received: by 2002:ac8:474e:0:b0:428:3109:47f7 with SMTP id
k14-20020ac8474e000000b00428310947f7mr406603qtp.13.1704331443876; Wed, 03 Jan
2024 17:24:03 -0800 (PST)
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.math.symbolic
Date: Wed, 3 Jan 2024 17:24:03 -0800 (PST)
In-Reply-To: <6595A27C.855B757A@nowhere.invalid>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8003:4706:7000:284c:e9ff:63ba:43ba;
posting-account=wlWA4gkAAABfPzIzZZgzF-hX5pK428zY
NNTP-Posting-Host: 2001:8003:4706:7000:284c:e9ff:63ba:43ba
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com>
<659472DB.FF089BF@nowhere.invalid> <3e56a354-e43f-4ed5-aaee-7c6dcdba3c93n@googlegroups.com>
<6595A27C.855B757A@nowhere.invalid>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <12653784-1275-4bf0-ad08-926b57c9f20an@googlegroups.com>
Subject: Re: A rational integral and Rioboo's algorithm
From: samuel.thomas.blake@gmail.com (Sam Blake)
Injection-Date: Thu, 04 Jan 2024 01:24:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 7484
Lines: 162
View all headers

On Thursday, January 4, 2024 at 5:07:54 AM UTC+11, nob...@nowhere.invalid wrote:
> Richard Fateman schrieb:
> >
> > On Tuesday, January 2, 2024 at 12:32:26 PM UTC-8, nob...@nowhere.invalid wrote:
> > >
> > > Sam Blake schrieb:
> > > >
> > > > For fun I have been implementing the rational integral routines from
> > > > Bronstein's Symbolic Integration I in Mathematica. As part of my
> > > > testing I stumbled across the following example integral
> > > >
> > > > \int x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4) dx
> > > >
> > > > Rubi does well on this example
> > > >
> > > > In[66]:= Int[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> > > >
> > > > Out[66]= -(ArcTan[(1 + 2 x)/Sqrt[7 - 4 Sqrt[2]]]/(
> > > > 2 Sqrt[2 (7 - 4 Sqrt[2])])) +
> > > > ArcTan[(1 + 2 x)/Sqrt[7 + 4 Sqrt[2]]]/(2 Sqrt[2 (7 + 4 Sqrt[2])]) -
> > > > ArcTanh[(7 + 4 (1/2 + x)^2)/(4 Sqrt[2])]/(2 Sqrt[2])
> > > >
> > > > While my rational function integrator returns
> > > >
> > > > In[67]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> > > >
> > > > Out[67]= 1/2 (((-1 + I Sqrt[7 - 4 Sqrt[2]]) Log[
> > > > 1/2 (1 - I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > > > 2 (2 + 5/2 (-1 + I Sqrt[7 - 4 Sqrt[2]]) +
> > > > 3/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^2 +
> > > > 1/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 -
> > > > I Sqrt[7 - 4 Sqrt[2]]) Log[
> > > > 1/2 (1 + I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > > > 2 (2 + 5/2 (-1 - I Sqrt[7 - 4 Sqrt[2]]) +
> > > > 3/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^2 +
> > > > 1/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 +
> > > > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > > > 1/2 (1 - I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > > > 2 (2 + 5/2 (-1 + I Sqrt[7 + 4 Sqrt[2]]) +
> > > > 3/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^2 +
> > > > 1/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^3)) + ((-1 -
> > > > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > > > 1/2 (1 + I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > > > 2 (2 + 5/2 (-1 - I Sqrt[7 + 4 Sqrt[2]]) +
> > > > 3/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^2 +
> > > > 1/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^3)))
> > > >
> > > > I find similar results from AXIOM and FriCAS. Is this a limitation of
> > > > Rioboo's algorithm?
> > > >
> > >
> > > This is an interesting example. Derive 6.10 also solves the integral in
> > > real terms:
> > >
> > > INT(x/(2 + 4*x + 5*x^2 + 2*x^3 + x^4), x)
> > >
> > > SQRT(238 - 136*SQRT(2))*ATAN(SQRT(119 - 68*SQRT(2))*(2*x + 1)/17)/68
> > > - SQRT(136*SQRT(2) + 238)*ATAN(SQRT(68*SQRT(2) + 119)*(2*x + 1)/17)/68
> > > + SQRT(2)*LN((x^2 + x - SQRT(2) + 2)/(x^2 + x + SQRT(2) + 2))/8
> > >
> > > as it starts by factoring the denominator:
> > >
> > > 2 + 4*x + 5*x^2 + 2*x^3 + x^4 =
> > > (x^2 + x + SQRT(2) + 2)*(x^2 + x - SQRT(2) + 2)
> > >
> > > and then expands the integrand into partial fractions. Indeed, the
> > > cubic resolvent of the denominator factors as (y - 4)*(y^2 - y - 4).
> > >
> > > By contrast, FriCAS 1.3.9 returns a whopping:
> > >
> > > [...]
> > >
> > > which is the sum of three logarithms involving many nested rootOf()s
> > > where the %%En denote local variables. The quartic of the inner
> > > rootOf() factors as:
> > >
> > > 544*z^4 - 20*z^2 + 4*z + 1 =
> > > 1/17*(68*SQRT(2)*z^2 + 34*z + 3*SQRT(2) - 1)
> > > *(68*SQRT(2)*z^2 - 34*z + 3*SQRT(2) + 1)
> > >
> > > and its cubic resolvent is (34*y - 3)*(272*y^2 + 34*y + 1).
> > >
> > > Let's see if FriCAS version 1.3.10 will do better.
> > >
> >
> > In Maxima ... factor the denominator in an algebraic field...
> >
> > (%o4) x^4+2*x^3+5*x^2+4*x+2
> > (%i5) factor(%, subst(a,x,%));
> >
> > (%o5) (x-a)*(x+a+1)*(x^2+x+a^2+a+4)
> >
> > from which integration produces a relatively compact form.
> This expresses the factors of the denominator in terms of any one still
> unknown root. Even though all of the roots are complex:
>
> SOLUTIONS(a^4 + 2*a^3 + 5*a^2 + 4*a + 2 = 0, a)
>
> [- 1/2 + #i*SQRT(4*SQRT(2) + 7)/2, - 1/2 - #i*SQRT(4*SQRT(2) + 7)/2,
> - 1/2 + #i*SQRT(7 - 4*SQRT(2))/2, - 1/2 - #i*SQRT(7 - 4*SQRT(2))/2]
>
> the constant a^2 + a in the quadratic factor is real for any of them,
> and so will then be an antiderivative based on the decomposition:
>
> x^4 + 2*x^3 + 5*x^2 + 4*x + 2 =
> (x^2 + x - a^2 - a)*(x^2 + x + a^2 + a + 4)
>
> in which the pair of linear factors is treated as a another quadratic.
>
> If the code in Bronstein's book is indeed claimed to produce a real
> antiderivative for
> IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> and nothing has been overlooked in the code itself, there should be a
> bug in the Mathematica implementation. Breaking four complex logarithms
> up into real and imaginary parts should be within the capabilities of
> programming on Mathematica - the imaginary parts would finally cancel.
> If the code can identify complex conjugate pairs, the imaginary parts
> could be ignored right away.
>
> Martin.

One issue is in simplification of polynomial coefficients in LogToAtan that must happen prior to calling PolynomialGCD. Here is one of the coefficients:

In[78]:=
162 Sqrt[1/17 (7 + 4 Sqrt[2])] - (2030 Sqrt[1/17 (7 + 4 Sqrt[2])])/(
7 - 4 Sqrt[2]) - 112 Sqrt[2/17 (7 + 4 Sqrt[2])] + (
1432 Sqrt[2/17 (7 + 4 Sqrt[2])])/(7 - 4 Sqrt[2]) // FullSimplify

Out[78]= 0

With this fixed I get the following result:

In[79]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]

Out[79]=
1/2 Sqrt[1/34 (7 - 4 Sqrt[2])]
ArcTan[(Sqrt[7 - 4 Sqrt[2]] + 2 Sqrt[7 - 4 Sqrt[2]] x)/Sqrt[17]] +
Sqrt[7/136 + 1/(17 Sqrt[2])]
ArcTan[1/17 (-Sqrt[17 (7 + 4 Sqrt[2])] - 2 Sqrt[17 (7 + 4 Sqrt[2])] x)] -
ArcTanh[(2 + x + x^2)/Sqrt[2]]/(2 Sqrt[2])

Which is still not as nice as Rubi, but a lot closer...

Sam

Subject: Re: A rational integral and Rioboo's algorithm
From: Sam Blake
Newsgroups: sci.math.symbolic
Date: Thu, 4 Jan 2024 02:34 UTC
References: 1 2 3 4 5
X-Received: by 2002:a05:620a:13ef:b0:781:716d:e9a5 with SMTP id h15-20020a05620a13ef00b00781716de9a5mr120685qkl.7.1704335690966;
Wed, 03 Jan 2024 18:34:50 -0800 (PST)
X-Received: by 2002:a05:622a:8a:b0:428:32ad:a6c4 with SMTP id
o10-20020a05622a008a00b0042832ada6c4mr792qtw.0.1704335690628; Wed, 03 Jan
2024 18:34:50 -0800 (PST)
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: sci.math.symbolic
Date: Wed, 3 Jan 2024 18:34:50 -0800 (PST)
In-Reply-To: <12653784-1275-4bf0-ad08-926b57c9f20an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8003:4706:7000:284c:e9ff:63ba:43ba;
posting-account=wlWA4gkAAABfPzIzZZgzF-hX5pK428zY
NNTP-Posting-Host: 2001:8003:4706:7000:284c:e9ff:63ba:43ba
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com>
<659472DB.FF089BF@nowhere.invalid> <3e56a354-e43f-4ed5-aaee-7c6dcdba3c93n@googlegroups.com>
<6595A27C.855B757A@nowhere.invalid> <12653784-1275-4bf0-ad08-926b57c9f20an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a7775e1b-2953-476a-8239-74fc23ca7f9bn@googlegroups.com>
Subject: Re: A rational integral and Rioboo's algorithm
From: samuel.thomas.blake@gmail.com (Sam Blake)
Injection-Date: Thu, 04 Jan 2024 02:34:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 198
View all headers

On Thursday, January 4, 2024 at 12:24:05 PM UTC+11, Sam Blake wrote:
> On Thursday, January 4, 2024 at 5:07:54 AM UTC+11, nob...@nowhere..invalid wrote:
> > Richard Fateman schrieb:
> > >
> > > On Tuesday, January 2, 2024 at 12:32:26 PM UTC-8, nob...@nowhere.invalid wrote:
> > > >
> > > > Sam Blake schrieb:
> > > > >
> > > > > For fun I have been implementing the rational integral routines from
> > > > > Bronstein's Symbolic Integration I in Mathematica. As part of my
> > > > > testing I stumbled across the following example integral
> > > > >
> > > > > \int x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4) dx
> > > > >
> > > > > Rubi does well on this example
> > > > >
> > > > > In[66]:= Int[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> > > > >
> > > > > Out[66]= -(ArcTan[(1 + 2 x)/Sqrt[7 - 4 Sqrt[2]]]/(
> > > > > 2 Sqrt[2 (7 - 4 Sqrt[2])])) +
> > > > > ArcTan[(1 + 2 x)/Sqrt[7 + 4 Sqrt[2]]]/(2 Sqrt[2 (7 + 4 Sqrt[2])]) -
> > > > > ArcTanh[(7 + 4 (1/2 + x)^2)/(4 Sqrt[2])]/(2 Sqrt[2])
> > > > >
> > > > > While my rational function integrator returns
> > > > >
> > > > > In[67]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> > > > >
> > > > > Out[67]= 1/2 (((-1 + I Sqrt[7 - 4 Sqrt[2]]) Log[
> > > > > 1/2 (1 - I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > > > > 2 (2 + 5/2 (-1 + I Sqrt[7 - 4 Sqrt[2]]) +
> > > > > 3/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^2 +
> > > > > 1/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 -
> > > > > I Sqrt[7 - 4 Sqrt[2]]) Log[
> > > > > 1/2 (1 + I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > > > > 2 (2 + 5/2 (-1 - I Sqrt[7 - 4 Sqrt[2]]) +
> > > > > 3/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^2 +
> > > > > 1/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 +
> > > > > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > > > > 1/2 (1 - I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > > > > 2 (2 + 5/2 (-1 + I Sqrt[7 + 4 Sqrt[2]]) +
> > > > > 3/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^2 +
> > > > > 1/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^3)) + ((-1 -
> > > > > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > > > > 1/2 (1 + I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > > > > 2 (2 + 5/2 (-1 - I Sqrt[7 + 4 Sqrt[2]]) +
> > > > > 3/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^2 +
> > > > > 1/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^3)))
> > > > >
> > > > > I find similar results from AXIOM and FriCAS. Is this a limitation of
> > > > > Rioboo's algorithm?
> > > > >
> > > >
> > > > This is an interesting example. Derive 6.10 also solves the integral in
> > > > real terms:
> > > >
> > > > INT(x/(2 + 4*x + 5*x^2 + 2*x^3 + x^4), x)
> > > >
> > > > SQRT(238 - 136*SQRT(2))*ATAN(SQRT(119 - 68*SQRT(2))*(2*x + 1)/17)/68
> > > > - SQRT(136*SQRT(2) + 238)*ATAN(SQRT(68*SQRT(2) + 119)*(2*x + 1)/17)/68
> > > > + SQRT(2)*LN((x^2 + x - SQRT(2) + 2)/(x^2 + x + SQRT(2) + 2))/8
> > > >
> > > > as it starts by factoring the denominator:
> > > >
> > > > 2 + 4*x + 5*x^2 + 2*x^3 + x^4 =
> > > > (x^2 + x + SQRT(2) + 2)*(x^2 + x - SQRT(2) + 2)
> > > >
> > > > and then expands the integrand into partial fractions. Indeed, the
> > > > cubic resolvent of the denominator factors as (y - 4)*(y^2 - y - 4)..
> > > >
> > > > By contrast, FriCAS 1.3.9 returns a whopping:
> > > >
> > > > [...]
> > > >
> > > > which is the sum of three logarithms involving many nested rootOf()s
> > > > where the %%En denote local variables. The quartic of the inner
> > > > rootOf() factors as:
> > > >
> > > > 544*z^4 - 20*z^2 + 4*z + 1 =
> > > > 1/17*(68*SQRT(2)*z^2 + 34*z + 3*SQRT(2) - 1)
> > > > *(68*SQRT(2)*z^2 - 34*z + 3*SQRT(2) + 1)
> > > >
> > > > and its cubic resolvent is (34*y - 3)*(272*y^2 + 34*y + 1).
> > > >
> > > > Let's see if FriCAS version 1.3.10 will do better.
> > > >
> > >
> > > In Maxima ... factor the denominator in an algebraic field...
> > >
> > > (%o4) x^4+2*x^3+5*x^2+4*x+2
> > > (%i5) factor(%, subst(a,x,%));
> > >
> > > (%o5) (x-a)*(x+a+1)*(x^2+x+a^2+a+4)
> > >
> > > from which integration produces a relatively compact form.
> > This expresses the factors of the denominator in terms of any one still
> > unknown root. Even though all of the roots are complex:
> >
> > SOLUTIONS(a^4 + 2*a^3 + 5*a^2 + 4*a + 2 = 0, a)
> >
> > [- 1/2 + #i*SQRT(4*SQRT(2) + 7)/2, - 1/2 - #i*SQRT(4*SQRT(2) + 7)/2,
> > - 1/2 + #i*SQRT(7 - 4*SQRT(2))/2, - 1/2 - #i*SQRT(7 - 4*SQRT(2))/2]
> >
> > the constant a^2 + a in the quadratic factor is real for any of them,
> > and so will then be an antiderivative based on the decomposition:
> >
> > x^4 + 2*x^3 + 5*x^2 + 4*x + 2 =
> > (x^2 + x - a^2 - a)*(x^2 + x + a^2 + a + 4)
> >
> > in which the pair of linear factors is treated as a another quadratic.
> >
> > If the code in Bronstein's book is indeed claimed to produce a real
> > antiderivative for
> > IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> > and nothing has been overlooked in the code itself, there should be a
> > bug in the Mathematica implementation. Breaking four complex logarithms
> > up into real and imaginary parts should be within the capabilities of
> > programming on Mathematica - the imaginary parts would finally cancel.
> > If the code can identify complex conjugate pairs, the imaginary parts
> > could be ignored right away.
> >
> > Martin.
> One issue is in simplification of polynomial coefficients in LogToAtan that must happen prior to calling PolynomialGCD. Here is one of the coefficients:
>
> In[78]:=
> 162 Sqrt[1/17 (7 + 4 Sqrt[2])] - (2030 Sqrt[1/17 (7 + 4 Sqrt[2])])/(
> 7 - 4 Sqrt[2]) - 112 Sqrt[2/17 (7 + 4 Sqrt[2])] + (
> 1432 Sqrt[2/17 (7 + 4 Sqrt[2])])/(7 - 4 Sqrt[2]) // FullSimplify
>
> Out[78]= 0
>
> With this fixed I get the following result:
>
> In[79]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
>
> Out[79]=
> 1/2 Sqrt[1/34 (7 - 4 Sqrt[2])]
> ArcTan[(Sqrt[7 - 4 Sqrt[2]] + 2 Sqrt[7 - 4 Sqrt[2]] x)/Sqrt[17]] +
> Sqrt[7/136 + 1/(17 Sqrt[2])]
> ArcTan[1/17 (-Sqrt[17 (7 + 4 Sqrt[2])] - 2 Sqrt[17 (7 + 4 Sqrt[2])] x)] -
> ArcTanh[(2 + x + x^2)/Sqrt[2]]/(2 Sqrt[2])
>
> Which is still not as nice as Rubi, but a lot closer...
>
> Sam

In this example AXIOM and FriCAS both have polynomials in the denominator of arctan terms:

integrate((5 - 6*x^2 - 12*x^5 - 15*x^6 + 10*x^9)/(1 + 5*x^2 - 4*x^3 - 3*x^4 - 10*x^5 + 6*x^6 + 5*x^8 - 4*x^9 + x^12),x)

The FriCAS solution is especially strange as it introduces a square root of a polynomial in the denominator of an arctan.

Here's a better form:

In[315]:= IntegrateRational[(5 - 6 x^2 - 12 x^5 - 15 x^6 + 10 x^9)/(1 + 5 x^2 - 4 x^3 - 3 x^4 - 10 x^5 + 6 x^6 + 5 x^8 - 4 x^9 + x^12), x]

Out[315]=
Sqrt[1/2 (5 + Sqrt[37])] ArcTan[Sqrt[1/6 (-5 + Sqrt[37])] x^2] +
Sqrt[1/2 (5 + Sqrt[37])]
ArcTan[1/6 (3 Sqrt[2 (5 + Sqrt[37])] x - Sqrt[6 (-5 + Sqrt[37])] x^2 +
Sqrt[6 (-5 + Sqrt[37])] x^5)] -
1/2 Sqrt[1/2 (-5 + Sqrt[37])]
Log[-2 - Sqrt[2 (-5 + Sqrt[37])] x + 2 x^3] +
1/2 Sqrt[1/2 (-5 + Sqrt[37])]
Log[-2 + Sqrt[2 (-5 + Sqrt[37])] x + 2 x^3]

Cheers,

Sam

Subject: Re: A rational integral and Rioboo's algorithm
From: clicliclic@freenet.d
Newsgroups: sci.math.symbolic
Organization: Killfiles, Unlimited
Date: Thu, 4 Jan 2024 21:33 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.killfile.org!.POSTED.port-92-200-39-61.dynamic.as20676.net!not-for-mail
From: nobody@nowhere.invalid (clicliclic@freenet.de)
Newsgroups: sci.math.symbolic
Subject: Re: A rational integral and Rioboo's algorithm
Date: Thu, 04 Jan 2024 22:33:06 +0100
Organization: Killfiles, Unlimited
Message-ID: <65972412.64C4BE20@nowhere.invalid>
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com>
<659472DB.FF089BF@nowhere.invalid> <3e56a354-e43f-4ed5-aaee-7c6dcdba3c93n@googlegroups.com>
<6595A27C.855B757A@nowhere.invalid> <12653784-1275-4bf0-ad08-926b57c9f20an@googlegroups.com> <a7775e1b-2953-476a-8239-74fc23ca7f9bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: flea.killfile.org; posting-host="port-92-200-39-61.dynamic.as20676.net:92.200.39.61";
logging-data="677026"; mail-complaints-to="news@news.killfile.org"
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de
View all headers

Sam Blake schrieb:
>
> In this example AXIOM and FriCAS both have polynomials in the
> denominator of arctan terms:
>
> integrate((5 - 6*x^2 - 12*x^5 - 15*x^6 + 10*x^9)/(1 + 5*x^2 - 4*x^3 - 3*x^4 - 10*x^5 + 6*x^6 + 5*x^8 - 4*x^9 + x^12),x)
>
> The FriCAS solution is especially strange as it introduces a square
> root of a polynomial in the denominator of an arctan.
>
> Here's a better form:
>
> In[315]:= IntegrateRational[(5 - 6 x^2 - 12 x^5 - 15 x^6 + 10 x^9)/(1 + 5 x^2 - 4 x^3 - 3 x^4 - 10 x^5 + 6 x^6 + 5 x^8 - 4 x^9 + x^12), x]
>
> Out[315]=
> Sqrt[1/2 (5 + Sqrt[37])] ArcTan[Sqrt[1/6 (-5 + Sqrt[37])] x^2] +
> Sqrt[1/2 (5 + Sqrt[37])]
> ArcTan[1/6 (3 Sqrt[2 (5 + Sqrt[37])] x - Sqrt[6 (-5 + Sqrt[37])] x^2 +
> Sqrt[6 (-5 + Sqrt[37])] x^5)] -
> 1/2 Sqrt[1/2 (-5 + Sqrt[37])]
> Log[-2 - Sqrt[2 (-5 + Sqrt[37])] x + 2 x^3] +
> 1/2 Sqrt[1/2 (-5 + Sqrt[37])]
> Log[-2 + Sqrt[2 (-5 + Sqrt[37])] x + 2 x^3]
>

Derive 6.10 fails on this one as it cannot factor the denominator:

x^12 - 4*x^9 + 5*x^8 + 6*x^6 - 10*x^5 - 3*x^4 - 4*x^3 + 5*x^2 + 1

= 1/4*(2*x^6 - 4*x^3 + x^2*(5 - SQRT(37)) + 2)
*(2*x^6 - 4*x^3 + x^2*(SQRT(37) + 5) + 2)

= 1/4*(SQRT(2)*x^3 + x*SQRT(SQRT(37) - 5) - SQRT(2))
*(SQRT(2)*x^3 - x*SQRT(SQRT(37) - 5) - SQRT(2))
*(SQRT(2)*x^3 - SQRT(2) + #i*x*SQRT(SQRT(37) + 5))
*(SQRT(2)*x^3 - SQRT(2) - #i*x*SQRT(SQRT(37) + 5))

I suspect that the square root of a polynomial in the denominator of
the arc tangent returned by FriCAS is introduced by halving the
argument range in order to prevent unnecessary discontinuitities:

ATAN(w) = 2*ATAN(w/(1 + SQRT(1 + w^2)))

Unfortunately, this step would usually frustrate a subsequent Rioboo
splitting of the arc tangent, which could have served the same purpose
better if applied instead.

Martin.

Subject: Re: A rational integral and Rioboo's algorithm
From: clicliclic@freenet.d
Newsgroups: sci.math.symbolic
Organization: Killfiles, Unlimited
Date: Thu, 11 Jan 2024 12:11 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.killfile.org!.POSTED.port-212-5-14-55.dynamic.as20676.net!not-for-mail
From: nobody@nowhere.invalid (clicliclic@freenet.de)
Newsgroups: sci.math.symbolic
Subject: Re: A rational integral and Rioboo's algorithm
Date: Thu, 11 Jan 2024 13:11:19 +0100
Organization: Killfiles, Unlimited
Message-ID: <659FDAE7.9599D163@nowhere.invalid>
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com> <659472DB.FF089BF@nowhere.invalid>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: flea.killfile.org; posting-host="port-212-5-14-55.dynamic.as20676.net:212.5.14.55";
logging-data="3612509"; mail-complaints-to="news@news.killfile.org"
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de
View all headers

"clicliclic@freenet.de" schrieb:
>
> Sam Blake schrieb:
> >
> > For fun I have been implementing the rational integral routines from
> > Bronstein's Symbolic Integration I in Mathematica. As part of my
> > testing I stumbled across the following example integral
> >
> > \int x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4) dx
> >
> > Rubi does well on this example
> >
> > In[66]:= Int[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> >
> > Out[66]= -(ArcTan[(1 + 2 x)/Sqrt[7 - 4 Sqrt[2]]]/(
> > 2 Sqrt[2 (7 - 4 Sqrt[2])])) +
> > ArcTan[(1 + 2 x)/Sqrt[7 + 4 Sqrt[2]]]/(2 Sqrt[2 (7 + 4 Sqrt[2])]) -
> > ArcTanh[(7 + 4 (1/2 + x)^2)/(4 Sqrt[2])]/(2 Sqrt[2])
> >
> > While my rational function integrator returns
> >
> > In[67]:= IntegrateRational[x/(2 + 4 x + 5 x^2 + 2 x^3 + x^4), x]
> >
> > Out[67]= 1/2 (((-1 + I Sqrt[7 - 4 Sqrt[2]]) Log[
> > 1/2 (1 - I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 + I Sqrt[7 - 4 Sqrt[2]]) +
> > 3/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^2 +
> > 1/4 (-1 + I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 -
> > I Sqrt[7 - 4 Sqrt[2]]) Log[
> > 1/2 (1 + I Sqrt[7 - 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 - I Sqrt[7 - 4 Sqrt[2]]) +
> > 3/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^2 +
> > 1/4 (-1 - I Sqrt[7 - 4 Sqrt[2]])^3)) + ((-1 +
> > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > 1/2 (1 - I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 + I Sqrt[7 + 4 Sqrt[2]]) +
> > 3/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^2 +
> > 1/4 (-1 + I Sqrt[7 + 4 Sqrt[2]])^3)) + ((-1 -
> > I Sqrt[7 + 4 Sqrt[2]]) Log[
> > 1/2 (1 + I Sqrt[7 + 4 Sqrt[2]]) + x])/(
> > 2 (2 + 5/2 (-1 - I Sqrt[7 + 4 Sqrt[2]]) +
> > 3/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^2 +
> > 1/4 (-1 - I Sqrt[7 + 4 Sqrt[2]])^3)))
> >
> > I find similar results from AXIOM and FriCAS. Is this a limitation
> > of Rioboo's algorithm?
> >
>
> This is an interesting example. Derive 6.10 also solves the integral
> in real terms:
>
> INT(x/(2 + 4*x + 5*x^2 + 2*x^3 + x^4), x)
>
> SQRT(238 - 136*SQRT(2))*ATAN(SQRT(119 - 68*SQRT(2))*(2*x + 1)/17)/68
> - SQRT(136*SQRT(2) + 238)*ATAN(SQRT(68*SQRT(2) + 119)*(2*x + 1)/17)/68
> + SQRT(2)*LN((x^2 + x - SQRT(2) + 2)/(x^2 + x + SQRT(2) + 2))/8
>
> as it starts by factoring the denominator:
>
> 2 + 4*x + 5*x^2 + 2*x^3 + x^4 =
> (x^2 + x + SQRT(2) + 2)*(x^2 + x - SQRT(2) + 2)
>
> and then expands the integrand into partial fractions. Indeed, the
> cubic resolvent of the denominator factors as (y - 4)*(y^2 - y - 4).
>
> By contrast, FriCAS 1.3.9 returns a whopping:
>
> [...]
>
> which is the sum of three logarithms involving many nested rootOf()s
> where the %%En denote local variables. The quartic of the inner
> rootOf() factors as:
>
> 544*z^4 - 20*z^2 + 4*z + 1 =
> 1/17*(68*SQRT(2)*z^2 + 34*z + 3*SQRT(2) - 1)
> *(68*SQRT(2)*z^2 - 34*z + 3*SQRT(2) + 1)
>
> and its cubic resolvent is (34*y - 3)*(272*y^2 + 34*y + 1).
>
> Let's see if FriCAS version 1.3.10 will do better.
>

FriCAS Version 1.3.10 is out and returns:

integrate(x/(2 + 4*x + 5*x^2 + 2*x^3 + x^4), x)
((-4)*((4*2^(1/2)+7)/34)^(1/2)*atan((2*x+1)*2^(1/2)*((4*2^(1/2)+7)/34)^(1/2))+(4*(((-4)*2^(1/2)+7)/34)^(1/2)*atan((2*x+1)*2^(1/2)*(((-4)*2^(1/2)+7)/34)^(1/2))+((-1)*2^(1/2)*log(2^(1/2)+(x^2+x+2))+2^(1/2)*log((-1)*2^(1/2)+(x^2+x+2)))))/8

which represents a massive improvement.

Martin.

Subject: Re: A rational integral and Rioboo's algorithm
From: clicliclic@freenet.d
Newsgroups: sci.math.symbolic
Organization: Killfiles, Unlimited
Date: Thu, 11 Jan 2024 12:12 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!paganini.bofh.team!news.killfile.org!.POSTED.port-212-5-14-55.dynamic.as20676.net!not-for-mail
From: nobody@nowhere.invalid (clicliclic@freenet.de)
Newsgroups: sci.math.symbolic
Subject: Re: A rational integral and Rioboo's algorithm
Date: Thu, 11 Jan 2024 13:12:13 +0100
Organization: Killfiles, Unlimited
Message-ID: <659FDB1D.8A4730FE@nowhere.invalid>
References: <bade7003-7869-4f23-b45d-669d81ce28fbn@googlegroups.com>
<659472DB.FF089BF@nowhere.invalid> <3e56a354-e43f-4ed5-aaee-7c6dcdba3c93n@googlegroups.com>
<6595A27C.855B757A@nowhere.invalid> <12653784-1275-4bf0-ad08-926b57c9f20an@googlegroups.com> <a7775e1b-2953-476a-8239-74fc23ca7f9bn@googlegroups.com> <65972412.64C4BE20@nowhere.invalid>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: flea.killfile.org; posting-host="port-212-5-14-55.dynamic.as20676.net:212.5.14.55";
logging-data="3612509"; mail-complaints-to="news@news.killfile.org"
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de
View all headers

"clicliclic@freenet.de" schrieb:
>
> Sam Blake schrieb:
> >
> > In this example AXIOM and FriCAS both have polynomials in the
> > denominator of arctan terms:
> >
> > integrate((5 - 6*x^2 - 12*x^5 - 15*x^6 + 10*x^9)/(1 + 5*x^2 - 4*x^3 - 3*x^4 - 10*x^5 + 6*x^6 + 5*x^8 - 4*x^9 + x^12),x)
> >
> > The FriCAS solution is especially strange as it introduces a square
> > root of a polynomial in the denominator of an arctan.
> >
> > Here's a better form:
> >
> > In[315]:= IntegrateRational[(5 - 6 x^2 - 12 x^5 - 15 x^6 + 10 x^9)/(1 + 5 x^2 - 4 x^3 - 3 x^4 - 10 x^5 + 6 x^6 + 5 x^8 - 4 x^9 + x^12), x]
> >
> > Out[315]=
> > Sqrt[1/2 (5 + Sqrt[37])] ArcTan[Sqrt[1/6 (-5 + Sqrt[37])] x^2] +
> > Sqrt[1/2 (5 + Sqrt[37])]
> > ArcTan[1/6 (3 Sqrt[2 (5 + Sqrt[37])] x - Sqrt[6 (-5 + Sqrt[37])] x^2 +
> > Sqrt[6 (-5 + Sqrt[37])] x^5)] -
> > 1/2 Sqrt[1/2 (-5 + Sqrt[37])]
> > Log[-2 - Sqrt[2 (-5 + Sqrt[37])] x + 2 x^3] +
> > 1/2 Sqrt[1/2 (-5 + Sqrt[37])]
> > Log[-2 + Sqrt[2 (-5 + Sqrt[37])] x + 2 x^3]
> >
>
> Derive 6.10 fails on this one as it cannot factor the denominator:
>
> x^12 - 4*x^9 + 5*x^8 + 6*x^6 - 10*x^5 - 3*x^4 - 4*x^3 + 5*x^2 + 1
>
> = 1/4*(2*x^6 - 4*x^3 + x^2*(5 - SQRT(37)) + 2)
> *(2*x^6 - 4*x^3 + x^2*(SQRT(37) + 5) + 2)
>
> = 1/4*(SQRT(2)*x^3 + x*SQRT(SQRT(37) - 5) - SQRT(2))
> *(SQRT(2)*x^3 - x*SQRT(SQRT(37) - 5) - SQRT(2))
> *(SQRT(2)*x^3 - SQRT(2) + #i*x*SQRT(SQRT(37) + 5))
> *(SQRT(2)*x^3 - SQRT(2) - #i*x*SQRT(SQRT(37) + 5))
>
> I suspect that the square root of a polynomial in the denominator of
> the arc tangent returned by FriCAS is introduced by halving the
> argument range in order to prevent unnecessary discontinuitities:
>
> ATAN(w) = 2*ATAN(w/(1 + SQRT(1 + w^2)))
>
> Unfortunately, this step would usually frustrate a subsequent Rioboo
> splitting of the arc tangent, which could have served the same purpose
> better if applied instead.
>

Here too, FriCAS 3.1.10 gives a nice answer:

integrate((5 - 6*x^2 - 12*x^5 - 15*x^6 + 10*x^9)/
(1 + 5*x^2 - 4*x^3 - 3*x^4 - 10*x^5 + 6*x^6 + 5*x^8 - 4*x^9 + x^12),x)

(((37^(1/2)+(-5))/2)^(1/2)*log(x*((37^(1/2)+(-5))/2)^(1/2)+(x^3+(-1)))+((-1)*((37^(1/2)+(-5))/2)^(1/2)*log((-1)*x*((37^(1/2)+(-5))/2)^(1/2)+(x^3+(-1)))+(2*((37^(1/2)+5)/2)^(1/2)*atan((((x^5+(-1)*x^2)*37^(1/2)+((-5)*x^5+5*x^2+6*x))*((37^(1/2)+5)/2)^(1/2))/6)+2*((37^(1/2)+5)/2)^(1/2)*atan(((x^2*37^(1/2)+(-5)*x^2)*((37^(1/2)+5)/2)^(1/2))/6))))/2

Martin.

1

rocksolid light 0.9.8
clearnet tor