interpret integration result

8 views
Skip to first unread message

Ralf Hemmecke

unread,
Oct 14, 2022, 5:40:11 AM10/14/22
to fricas-devel
I wonder how we can support a user to interpret the result of this
integration. I bet that many people will fail to figure out that %%E0
and %%E1 are rootOf expressions.

Maybe I'm too blind, but I couldn't find something in the FriCAS Book.

Ralf

(1) -> res := integrate(1/(1+x^5),x)

(1)
+----------------------------------------------------------+
| 2 2
\|- 75 %%E1 + (- 50 %%E0 - 10)%%E1 - 75 %%E0 - 10 %%E0 - 3
+
- 5 %%E1 - 5 %%E0 - 1
*
log
+----------------------------------------------------------+
| 2 2
\|- 75 %%E1 + (- 50 %%E0 - 10)%%E1 - 75 %%E0 - 10 %%E0 - 3
+
- 5 %%E1 - 5 %%E0 + 2 x - 1
+
+----------------------------------------------------------+
| 2 2
- \|- 75 %%E1 + (- 50 %%E0 - 10)%%E1 - 75 %%E0 - 10 %%E0 - 3
+
- 5 %%E1 - 5 %%E0 - 1
*
log

+----------------------------------------------------------+
| 2 2
- \|- 75 %%E1 + (- 50 %%E0 - 10)%%E1 - 75 %%E0 - 10
%%E0 - 3
+
- 5 %%E1 - 5 %%E0 + 2 x - 1
+
10 %%E1 log(5 %%E1 + x) + 10 %%E0 log(5 %%E0 + x) + 2 log(x + 1)
/
10
Type:
Union(Expression(Integer),...)
(2) -> tower res

(2)
[x, log(x + 1), %%E0, log(5 %%E0 + x), %%E1, log(5 %%E1 + x),
+----------------------------------------------------------+
| 2 2
\|- 75 %%E1 + (- 50 %%E0 - 10)%%E1 - 75 %%E0 - 10 %%E0 - 3 ,

log
+----------------------------------------------------------+
| 2 2
- \|- 75 %%E1 + (- 50 %%E0 - 10)%%E1 - 75 %%E0 - 10 %%E0 - 3
+
- 5 %%E1 - 5 %%E0 + 2 x - 1
,

log
+----------------------------------------------------------+
| 2 2
\|- 75 %%E1 + (- 50 %%E0 - 10)%%E1 - 75 %%E0 - 10 %%E0 - 3
- 5 %%E1
+
- 5 %%E0 + 2 x - 1
]
Type:
List(Kernel(Expression(Integer)))
(3) -> definingPolynomial(%%E0)

4 3 2
625 %%E0 + 125 %%E0 + 25 %%E0 + 5 %%E0 + 1
(3) ---------------------------------------------
625
Type:
Expression(Integer)
(4) ->

Nasser M. Abbasi

unread,
Oct 14, 2022, 6:15:57 AM10/14/22
to FriCAS - computer algebra system
Hello  Ralf ;

I got your email OK. This is my answer

Since CAS integration tests does not use Fricas directly, but interface to it via sagemath, these %%E0 and %%E1 and rootof do not actually show up at all. 

Sagemath takes care of the conversion to sagemath speak automatically, since the result must be valid in sagemath world to be used.

================
>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.7, Release Date: 2022-09-19                     │
│ Using Python 3.10.6. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage: var('x')
sage: fricas.setSimplifyDenomsFlag(fricas.true)
sage: integrate(1/(1+x^5),x,algorithm="fricas")
1/20*(sqrt(5) + 2*sqrt(-3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) + 1)^2 + 1/8*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) - 3)*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1) - 3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1)^2 + sqrt(1/2)*sqrt(sqrt(5) - 5) + 1/2*sqrt(5) - 5/2) - 1)*log(2*x + 1/2*sqrt(5) + sqrt(-3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) + 1)^2 + 1/8*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) - 3)*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1) - 3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1)^2 + sqrt(1/2)*sqrt(sqrt(5) - 5) + 1/2*sqrt(5) - 5/2) - 1/2) + 1/20*(sqrt(5) - 2*sqrt(-3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) + 1)^2 + 1/8*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) - 3)*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1) - 3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1)^2 + sqrt(1/2)*sqrt(sqrt(5) - 5) + 1/2*sqrt(5) - 5/2) - 1)*log(2*x + 1/2*sqrt(5) - sqrt(-3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) + 1)^2 + 1/8*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) - 3)*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1) - 3/16*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1)^2 + sqrt(1/2)*sqrt(sqrt(5) - 5) + 1/2*sqrt(5) - 5/2) - 1/2) + 1/20*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) - sqrt(5) - 1)*log(x + 1/2*sqrt(1/2)*sqrt(sqrt(5) - 5) - 1/4*sqrt(5) - 1/4) - 1/20*(2*sqrt(1/2)*sqrt(sqrt(5) - 5) + sqrt(5) + 1)*log(x - 1/2*sqrt(1/2)*sqrt(sqrt(5) - 5) - 1/4*sqrt(5) - 1/4) + 1/5*log(x + 1)
=========================== 

You see in the above, there is no rootOf and no %%E0.

Compare to using Fricas directly

========================
4) -> rr:=integrate(1/(1+x^5),x);

                                         Type: Union(Expression(Integer),...)
(5) -> unparse(rr::InputForm)  
 "((((-75)*rootOf((125*rootOf((625*%%E0^4+125*%%E0^3+25*%%E0^2+5*%%E0+1)/625,%
etc..

========================

To find if Fricas has any such output in the CAS integration tests output, you could issue an SQL command to the database:

sqlite> select fricas_anti from main where fricas_anti LIKE '%E1%';
sqlite> select fricas_anti from main where fricas_anti LIKE '%E0%';

These return nothing, because these are not there.

And no, I would not have known what %%E0 and %%E1 mean myself either, I would had to also google this to find what these mean in Fricas if I needed to.

--Nasser
 

Reply all
Reply to author
Forward
0 new messages