Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You're almost as happy as you think you are.


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

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.

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.

SubjectRepliesAuthor
o A rational integral and Rioboo's algorithm

By: Sam Blake on Tue, 2 Jan 2024

8Sam Blake

rocksolid light 0.9.8
clearnet tor