initial list of some integrals no longer evaluate in 1.3.8

9 views
Skip to first unread message

Nasser M. Abbasi

unread,
Jun 24, 2022, 12:00:40 AM6/24/22
to FriCAS - computer algebra system
Thanks for version 1.3.8.

I've only did partial test (less than 50%) but regression report generated so far shows there are some integrals no longer evaluate in 1.3.8 but did in 1.3.7. This could be due to bug fix. But thought to let you know just in case.

example 1
========
using 1.3.7
integrate((F^((-a*x+1)^(1/2)/(a*x+1)^(1/2)))^n/(-a^2*x^2+1),x);
gives
((-1)*Ei((n*log(F)*((-1)*a*x+1)^(1/2)*(a*x+1)^(1/2))/(a*x+1)))/a
But does not evaluate (returns the input) in 1.3.8

example 2
========
using 1.3.7
integrate(F^(3*(-a*x+1)^(1/2)/(a*x+1)^(1/2))/(-a^2*x^2+1),x)
gives
((-1)*Ei((3*log(F)*((-1)*a*x+1)^(1/2)*(a*x+1)^(1/2))/(a*x+1)))/a
But does not evaluate (returns the input) in 1.3.8


example 3
========
using 1.3.7
integrate(F^(2*(-a*x+1)^(1/2)/(a*x+1)^(1/2))/(-a^2*x^2+1),x)
gives
((-1)*Ei((2*log(F)*((-1)*a*x+1)^(1/2)*(a*x+1)^(1/2))/(a*x+1)))/a
But does not evaluate (returns the input) in 1.3.8

example 4
========
using 1.3.7
integrate(F^(2*(-a*x+1)^(1/2)/(a*x+1)^(1/2))/(-a^2*x^2+1),x)
gives
((-1)*Ei((2*log(F)*((-1)*a*x+1)^(1/2)*(a*x+1)^(1/2))/(a*x+1)))/a
But does not evaluate (returns the input) in 1.3.8


example 5
========
using 1.3.7
integrate(sec(d*x+c)*(a+b*sin(d*x+c))^(5/2),x)
gives this long output

[((3*b^2+(-6)*a*b+3*a^2)*((-1)*b+a)^(1/2)*log(((((-8)*b^3*cos(d*x+c)^2+(64*b
  ^3+(-224)*a*b^2+192*a^2*b))*sin(d*x+c)+((56*b^3+(-80)*a*b^2)*cos(d*x+c)^2+((-
  64)*b^3+160*a*b^2+(-192)*a^2*b+128*a^3)))*((-1)*b+a)^(1/2)*(b*sin(d*x+c)+a)^(
  1/2)+((((-28)*b^4+32*a*b^3)*cos(d*x+c)^2+(56*b^4+(-256)*a*b^3+448*a^2*b^2+(-2
  56)*a^3*b))*sin(d*x+c)+((-1)*b^4*cos(d*x+c)^4+(72*b^4+(-224)*a*b^3+160*a^2*b^
  2)*cos(d*x+c)^2+((-72)*b^4+256*a*b^3+(-320)*a^2*b^2+256*a^3*b+(-128)*a^4))))/
  ((4*cos(d*x+c)^2+(-8))*sin(d*x+c)+((-1)*cos(d*x+c)^4+8*cos(d*x+c)^2+(-8))))+(
  (3*b^2+6*a*b+3*a^2)*(b+a)^(1/2)*log(((((-8)*b^3*cos(d*x+c)^2+(64*b^3+224*a*b^
  2+192*a^2*b))*sin(d*x+c)+(((-56)*b^3+(-80)*a*b^2)*cos(d*x+c)^2+(64*b^3+160*a*
  b^2+192*a^2*b+128*a^3)))*(b+a)^(1/2)*(b*sin(d*x+c)+a)^(1/2)+((((-28)*b^4+(-32
  )*a*b^3)*cos(d*x+c)^2+(56*b^4+256*a*b^3+448*a^2*b^2+256*a^3*b))*sin(d*x+c)+(b
  ^4*cos(d*x+c)^4+((-72)*b^4+(-224)*a*b^3+(-160)*a^2*b^2)*cos(d*x+c)^2+(72*b^4+
  256*a*b^3+320*a^2*b^2+256*a^3*b+128*a^4))))/((4*cos(d*x+c)^2+(-8))*sin(d*x+c)
  +(cos(d*x+c)^4+(-8)*cos(d*x+c)^2+8)))+((-16)*b^2*sin(d*x+c)+(-112)*a*b)*(b*si
  n(d*x+c)+a)^(1/2)))/(24*d),((3*b^2+(-6)*a*b+3*a^2)*((-1)*b+a)^(1/2)*log(((((-
  8)*b^3*cos(d*x+c)^2+(64*b^3+(-224)*a*b^2+192*a^2*b))*sin(d*x+c)+((56*b^3+(-80
  )*a*b^2)*cos(d*x+c)^2+((-64)*b^3+160*a*b^2+(-192)*a^2*b+128*a^3)))*((-1)*b+a)
  ^(1/2)*(b*sin(d*x+c)+a)^(1/2)+((((-28)*b^4+32*a*b^3)*cos(d*x+c)^2+(56*b^4+(-2
  56)*a*b^3+448*a^2*b^2+(-256)*a^3*b))*sin(d*x+c)+((-1)*b^4*cos(d*x+c)^4+(72*b^
  4+(-224)*a*b^3+160*a^2*b^2)*cos(d*x+c)^2+((-72)*b^4+256*a*b^3+(-320)*a^2*b^2+
  256*a^3*b+(-128)*a^4))))/((4*cos(d*x+c)^2+(-8))*sin(d*x+c)+((-1)*cos(d*x+c)^4
  +8*cos(d*x+c)^2+(-8))))+(((-6)*b^2+(-12)*a*b+(-6)*a^2)*((-1)*b+(-1)*a)^(1/2)*
  atan((((6*b^2+8*a*b)*sin(d*x+c)+((-1)*b^2*cos(d*x+c)^2+(2*b^2+8*a*b+8*a^2)))*
  ((-1)*b+(-1)*a)^(1/2)*(b*sin(d*x+c)+a)^(1/2))/((4*b^3+16*a*b^2+12*a^2*b)*sin(
  d*x+c)+(((-4)*b^3+(-4)*a*b^2)*cos(d*x+c)^2+(4*b^3+8*a*b^2+12*a^2*b+8*a^3))))+
  ((-16)*b^2*sin(d*x+c)+(-112)*a*b)*(b*sin(d*x+c)+a)^(1/2)))/(24*d),((3*b^2+6*a
  *b+3*a^2)*(b+a)^(1/2)*log(((((-8)*b^3*cos(d*x+c)^2+(64*b^3+224*a*b^2+192*a^2*
  b))*sin(d*x+c)+(((-56)*b^3+(-80)*a*b^2)*cos(d*x+c)^2+(64*b^3+160*a*b^2+192*a^
  2*b+128*a^3)))*(b+a)^(1/2)*(b*sin(d*x+c)+a)^(1/2)+((((-28)*b^4+(-32)*a*b^3)*c
  os(d*x+c)^2+(56*b^4+256*a*b^3+448*a^2*b^2+256*a^3*b))*sin(d*x+c)+(b^4*cos(d*x
  +c)^4+((-72)*b^4+(-224)*a*b^3+(-160)*a^2*b^2)*cos(d*x+c)^2+(72*b^4+256*a*b^3+
  320*a^2*b^2+256*a^3*b+128*a^4))))/((4*cos(d*x+c)^2+(-8))*sin(d*x+c)+(cos(d*x+
  c)^4+(-8)*cos(d*x+c)^2+8)))+(((-6)*b^2+12*a*b+(-6)*a^2)*(b+(-1)*a)^(1/2)*atan
  ((((6*b^2+(-8)*a*b)*sin(d*x+c)+(b^2*cos(d*x+c)^2+((-2)*b^2+8*a*b+(-8)*a^2)))*
  (b+(-1)*a)^(1/2)*(b*sin(d*x+c)+a)^(1/2))/((4*b^3+(-16)*a*b^2+12*a^2*b)*sin(d*
  x+c)+((4*b^3+(-4)*a*b^2)*cos(d*x+c)^2+((-4)*b^3+8*a*b^2+(-12)*a^2*b+8*a^3))))
  +((-16)*b^2*sin(d*x+c)+(-112)*a*b)*(b*sin(d*x+c)+a)^(1/2)))/(24*d),(((-3)*b^2
  +6*a*b+(-3)*a^2)*(b+(-1)*a)^(1/2)*atan((((6*b^2+(-8)*a*b)*sin(d*x+c)+(b^2*cos
  (d*x+c)^2+((-2)*b^2+8*a*b+(-8)*a^2)))*(b+(-1)*a)^(1/2)*(b*sin(d*x+c)+a)^(1/2)
  )/((4*b^3+(-16)*a*b^2+12*a^2*b)*sin(d*x+c)+((4*b^3+(-4)*a*b^2)*cos(d*x+c)^2+(
  (-4)*b^3+8*a*b^2+(-12)*a^2*b+8*a^3))))+(((-3)*b^2+(-6)*a*b+(-3)*a^2)*((-1)*b+
  (-1)*a)^(1/2)*atan((((6*b^2+8*a*b)*sin(d*x+c)+((-1)*b^2*cos(d*x+c)^2+(2*b^2+8
  *a*b+8*a^2)))*((-1)*b+(-1)*a)^(1/2)*(b*sin(d*x+c)+a)^(1/2))/((4*b^3+16*a*b^2+
  12*a^2*b)*sin(d*x+c)+(((-4)*b^3+(-4)*a*b^2)*cos(d*x+c)^2+(4*b^3+8*a*b^2+12*a^
  2*b+8*a^3))))+((-8)*b^2*sin(d*x+c)+(-56)*a*b)*(b*sin(d*x+c)+a)^(1/2)))/(12*d)
  ]
  But does not evaluate in 1.3.8

The following all timeout now when they did not on 1.3.7. I need to re-run these again to make sure the timeout is due to version number change and not anything else

integrate((j*x^4+i*x^3+h*x^2+g*x+f)/(c*x^2+b*x+a)^(5/2),x,)
integrate((j*x^4+i*x^3+h*x^2+g*x+f)/(-c*x^2+b*x+a)^(5/2),x)
integrate(x*(e*x^3+d)/(c*x^6+b*x^3+a),x)
integrate((e*x^3+d)/(c*x^6+b*x^3+a),x)
integrate(x^2*(e*x^4+d)/(c*x^8+b*x^4+a),x)
integrate((e*x^4+d)/(c*x^8+b*x^4+a),x)
integrate((e*x)^m*(a+b*log(c*log(d*x)^p)),x)

I will have a full regression report done when all CAS integration tests completed.

--Nasser

Nasser M. Abbasi

unread,
Jun 24, 2022, 12:06:14 AM6/24/22
to FriCAS - computer algebra system
And on the subject of using Fricas integrate in sagemath, I've just reported a new bug to sagemath due
to interface issues. This causes few integrals to fail running Fricas integrate in sagemath, when they should not have failed because Fricas can do them. But this is out of my control.

Hopefully when these are fixed, will re-run CAS integration tests again for Fricas 1..3.8. It is due to translation of elliptic special function names.


--Nasser

Waldek Hebisch

unread,
Jun 24, 2022, 4:18:31 AM6/24/22
to 'Nasser M. Abbasi' via FriCAS - computer algebra system
Thanks for the report. In 1.3.7 integrals above were done
by pattern matching integrator. In 1.3.8 pattern matching
integrator is removed, algorithmic integrater is supposed
to handle them, but fails.

> example 5
> ========
> using 1.3.7
> integrate(sec(d*x+c)*(a+b*sin(d*x+c))^(5/2),x)
> gives this long output
<snip>
> But does not evaluate in 1.3.8

This looks like an issue with new code to generate elliptic
functions, I will investigate.

> The following all timeout now when they did not on 1.3.7. I need to re-run
> these again to make sure the timeout is due to version number change and
> not anything else
>
> integrate((j*x^4+i*x^3+h*x^2+g*x+f)/(c*x^2+b*x+a)^(5/2),x,)
> integrate((j*x^4+i*x^3+h*x^2+g*x+f)/(-c*x^2+b*x+a)^(5/2),x)
> integrate(x*(e*x^3+d)/(c*x^6+b*x^3+a),x)
> integrate((e*x^3+d)/(c*x^6+b*x^3+a),x)
> integrate(x^2*(e*x^4+d)/(c*x^8+b*x^4+a),x)
> integrate((e*x^4+d)/(c*x^8+b*x^4+a),x)
> integrate((e*x)^m*(a+b*log(c*log(d*x)^p)),x)

The first six are long running, 137.66 sec, 135.69, 213.04 sec, 110.06 sec,
254.77 and 81.66 sec respectively on my machine. The last
one needs 0.22 sec on my machine.

It is possible that 1.3.8 is a bit slower on them than 1.3.7
and there is substantial variation from run to run, so for the
first six it is possible that 1.3.8 did not do them within limit.
Or some timing oddity, expecially for the last one.

--
Waldek Hebisch

Waldek Hebisch

unread,
Jun 24, 2022, 5:12:46 AM6/24/22
to 'Nasser M. Abbasi' via FriCAS - computer algebra system
On Thu, Jun 23, 2022 at 09:06:13PM -0700, 'Nasser M. Abbasi' via FriCAS - computer algebra system wrote:
> And on the subject of using Fricas integrate in sagemath, I've just
> reported a new bug to sagemath due
> to interface issues. This causes few integrals to fail running Fricas
^^^
> integrate in sagemath, when they should not have failed because Fricas can
> do them. But this is out of my control.

AFAICS in Rubi testsuite there is more than 7000 integrals that
are expressible in terms of ellipic integrals and can not be
done otherwise. That is about 10% of Rubi testsuite and about
40% of what 1.3.7 could not do. I do not know how many of
them 1.3.8 can do, but I would expect more than half.

> Hopefully when these are fixed, will re-run CAS integration tests again for
> Fricas 1..3.8. It is due to translation of elliptic special function names.
>
> https://trac.sagemath.org/ticket/34058

I wonder if Weierstrass function translate to Sage:

(10) -> integrate(x/sqrt(4*x^3 + x), x)

(10) - weierstrassZeta(- 1,0,weierstrassPInverse(- 1,0,x))
Type: Union(Expression(Integer),...)

Note that translating elliptic functions and integrals is
tricky, as there are many notations and each system uses its own.
You can see FriCAS definitions below:

(11) -> D(ellipticE(x, m), x)

+----------+ +--------+
| 2 | 2
\|- m x + 1 \|- x + 1
(11) - ------------------------
2
x - 1
Type: Expression(Integer)
(12) -> D(ellipticF(x, m), x)

+----------+ +--------+
| 2 | 2
\|- m x + 1 \|- x + 1
(12) ------------------------
4 2
m x + (- m - 1)x + 1
Type: Expression(Integer)

Actually, definition of E and F has both roots in denominator, but
with setSimplifyDenomsFlag(true) FriCAS puts roots in numerator.

--
Waldek Hebisch

Nasser M. Abbasi

unread,
Jun 24, 2022, 5:44:17 AM6/24/22
to FriCAS - computer algebra system
" I wonder if Weierstrass function translate to Sage:"

Currently it does not  translate this output as it does not know about these

sage: r=integrate(x/sqrt(4*x^3 + x), x,algorithm="fricas")
-weierstrassZeta(-1, 0, weierstrassPInverse(-1, 0, x))
sage: ?weierstrassZeta
Object `weierstrassZeta` not found.
sage: ?weierstrassPInverse
Object `weierstrassPInverse` not found.

This sagemath page mentions support for  The Weierstrass ℘ function and examples. 

But I do not use the output of Fricas in sage in any way. I just translate it to Latex
and save the result. So as long as it does not crash or throws an exception, I am ok. 

This is its latex output for the above

sage: latex(r)
-{\rm weierstrassZeta}\left(-1, 0, {\rm weierstrassPInverse}\left(-1, 0, x\right)\right)

The problem happens if one tries to use the output inside sagemath to do something with since
it does not know these functions.

The problem with ellipticE and ellipticF in the bug track I linked to above, is much more serious. 
Because these functions take 2 arguments, and sage for some reason translate them to 
elliptic_ec which takes one argument not two, and it then throws exception. 

So CAS integration test calls these integrals as failed for Fricas and there are few of them, which
reduces Fricas score. I do not know by how much.

--Nasser

Waldek Hebisch

unread,
Jul 7, 2022, 8:29:26 PM7/7/22
to 'Nasser M. Abbasi' via FriCAS - computer algebra system
On Thu, Jun 23, 2022 at 09:00:40PM -0700, 'Nasser M. Abbasi' via FriCAS - computer algebra system wrote:
> Thanks for version 1.3.8.
>
> I've only did partial test (less than 50%) but regression report generated
> so far shows there are some integrals no longer evaluate in 1.3.8 but did
> in 1.3.7. This could be due to bug fix. But thought to let you know just in
> case.
<snip>
Actually, this is really not a regression. This integral works or
fails randomly both in 1.3.7 and 1.3.8. I will look more deeply
to see what is happening.

--
Waldek Hebisch

Waldek Hebisch

unread,
Jul 9, 2022, 6:38:33 PM7/9/22
to fricas...@googlegroups.com
This problem is now fixed in the trunk. This integral probably
in unlucky cases may give division by zero, but it should never
return unevaluated.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages