MIT Integration Bee results

41 views
Skip to first unread message

Tim Daly

unread,
Mar 1, 2023, 1:45:36 AM3/1/23
to FriCAS - computer algebra system

See the Test and Answers at the bottom of the page.
It would be interesting to see how many can be integrated.

Tim

Nasser M. Abbasi

unread,
Mar 3, 2023, 1:58:37 PM3/3/23
to FriCAS - computer algebra system
fyi;

MIT Integration Bee problems are now included in the CAS integration tests.

These problems came from https://math.mit.edu/~yyao1/integrationbee.html

Updated the summer 2022 edition of the CAS integration tests pages to
include these problems showing the result for all CAS systems currently
supported. They can be found under the link called

"links to individual test reports"

Starting at file #211 in the list

<https://12000.org/my_notes/CAS_integration_tests/reports/summer_2022/index.htm/>

At the very bottom of the page.
(one file per year starting from 2010, and per each competition held) so
they match the order shown in the MIT page above.

A number (may be half) of the MIT integration problems are definite,
so those were solved as indefinite integration only as that is the only
mode supported.

316 new integrals were added. The total number of integrals now is 85,795.

This is the result of percentage solved per each CAS just
for the MIT problems section (i.e. 316 problems).

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

1. Mathematica 13.2.1       98.73 %
2. Fricas 1.3.8/sage 9.8    96.52 %
3. Maple 2022.2             94.3  %
4. Rubi 4.16.1              93.35 %
5. Maxima 5.46/sage 9.8     92.41 %
6. Giac 1.9.0-37/sage 9.8   91.77 %
7. Mupad Matlab 2021a       89.56 %
8. Sympy 1.11.1             82.28 %

Any problems, issues, please let me know so I can fix it.

--Nasser

Grégory Vanuxem

unread,
Mar 3, 2023, 2:41:09 PM3/3/23
to fricas...@googlegroups.com
Wow. Thx for your work.

Le ven. 3 mars 2023 à 19:58, 'Nasser M. Abbasi' via FriCAS - computer
algebra system <fricas...@googlegroups.com> a écrit :
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/a9d48ed4-2e33-4d63-a60a-175a044eafa4n%40googlegroups.com.

Nasser M. Abbasi

unread,
Mar 4, 2023, 3:34:25 AM3/4/23
to FriCAS - computer algebra system

Fyi;

The following are the integrals from the MIT integration
problems which are not solved broken per CAS.

The syntax used for the integrand below is that
from the Maple file which might need small modification
(if any) to make it run on each specific CAS.


The Hall of fame problem that no CAS could solve is this one:

(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)

Its anti-derivative is arctan(x^2017+x^2018) which is shown below:

integrand := (2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1);
anti      := arctan(x^2017+x^2018);

simplify(diff(anti,x)-integrand)

          0

Mathematica:
-------------
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
(-x^4+4*x^3-7*x^2+6*x+1)^11
(x+exp(1)+1)*x^exp(x)*exp(x)
ln(x/Pi)/(ln(x)^ln(exp(1)*Pi))

Fricas:
-------
ln(x+1)/(x^2+1)
sin(101*x)*sin(x)^99
x*(1-x)^2014     Exception raised: RecursionError >> maximum recursion depth exceeded
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)    Timed out
cos(3*x)+sin(2*x)*(-sin(2019*x)+cos(3*x))   Timed out
x*(1-x)^2020   Exception raised: RecursionError >> maximum recursion depth exceeded
(1-x)^3+(-x^2+x)^3+(x^2-1)^3-3*(1-x)*(-x^2+x)*(x^2-1)
(x+exp(1)+1)*x^exp(x)*exp(x)
(3*x^3+2*x^2+1)/(x^2+1)^(1/3)
(1/x*ln(1/x))^(1/2)
2^(1/2)*ln(x)^(1/2)+1/2*2^(1/2)/ln(x)^(1/2)

Maple:
----------
3*x^2*(x^3+1)^2*exp(-x^6-2*x^3)
cos(x)^(cos(x)+1)*tan(x)*(1+ln(cos(x)))
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
1/(x^(41/25)+x^(9/25))
x^(1/ln(x))
(x+exp(1)+1)*x^exp(x)*exp(x)
(2*x^2022+1)/(x^2023+x)
ln(x/Pi)/(ln(x)^ln(exp(1)*Pi))
(1-(-1/2*Pi+arcsin(sin(x)))^2)^(1/2)
(1/x*ln(1/x))^(1/2)
arcsin(x)*arccos(x)
2^(1/2)*ln(x)^(1/2)+1/2*2^(1/2)/ln(x)^(1/2)
x^(-ln(x))
((x+1)^(1/2)-x^(1/2))^Pi
sin(4*arctan(x))
tan(x)^(1/3)/(cos(x)+sin(x))^2
(1+x^2+(x^4+x^2+1)^(1/2))^(1/2)

Rubi:
-----
1/(sin(x)+sec(x))
(cos(x)*ln(x)-sin(x)/x)/ln(x)^2
exp(exp(x)+exp(-x)+x)-exp(exp(x)+exp(-x)-x)
(1+2*x*exp(x^2))*cos(x)-(x+exp(x^2))*sin(x)
cos(x)*cosh(x)+sin(x)*sinh(x)
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
x^(x^2+1)*(1+2*ln(x))
sin(x+sin(x))-sin(x-sin(x))
(1+ln(x))*ln(ln(x))
(x+exp(1)+1)*x^exp(x)*exp(x)
sin(x)/(2*exp(x)+cos(x)+sin(x))
(1-(-1/2*Pi+arcsin(sin(x)))^2)^(1/2)
(cos(x)-sin(x))/(2+sin(2*x))
arcsin(x)*arccos(x)
ln(3^(1/2)+tan(x))
exp(-2*x)*sin(3*x)/x
exp(x+1/x)*(x^6+x^4-x^2-1)/x^4
x^(-ln(x))
exp(cos(x))*cos(2*x+sin(x))
sin(4*arctan(x))
(1+x^2+(x^4+x^2+1)^(1/2))^(1/2)


Maxima:
-------
1/(sin(x)+sec(x))
(x/(-x^3+1))^(1/2)
sin(101*x)*sin(x)^99
1/(1+x^(1/2))/(-x^2+x)^(1/2)
x^(1/2)/((2012-x)^(1/2)+x^(1/2))
(-1+x)/(x+1)/(x^3+x^2+x)^(1/2)
(x+(x^2+1)^(1/2))^(1/2)
(1+sin(x))^(1/2)
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
1/(x^(41/25)+x^(9/25))
1/(x^(3/2)-x^2)^(1/2)
x/((-1+x)^(1/2)+(x+1)^(1/2))
exp(exp(x))-exp(-x+exp(x))
(x+exp(1)+1)*x^exp(x)*exp(x)
ln(x/Pi)/(ln(x)^ln(exp(1)*Pi))
(3*x^3+2*x^2+1)/(x^2+1)^(1/3)
(cos(x)-sin(x))/(2+sin(2*x))
(1/x*ln(1/x))^(1/2)
1/((x+1)^3*(-1+x))^(1/2)
sin(23*x)/sin(x)
x^(-ln(x))
exp(cos(x))*cos(2*x+sin(x))
((x+1)^(1/2)-x^(1/2))^Pi
(1+x^2+(x^4+x^2+1)^(1/2))^(1/2)

Giac
-----
ln(x+1)/(x^2+1)
(csc(x)-sin(x))^(1/2)
1/x^2/(x^4+1)^(3/4)
x^(1/2)/((2012-x)^(1/2)+x^(1/2))
(-1+x)/(x+1)/(x^3+x^2+x)^(1/2)
(csc(x)-sin(x))^(1/2)
(x+(x^2+1)^(1/2))^(1/2)
(csc(x)-sin(x))^(1/2)
sin(x+1/4*Pi)^2/exp(x^2)
cos(x)^(cos(x)+1)*tan(x)*(1+ln(cos(x)))
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
exp(-2019/4/x^2)/x^2
x^(x^2+1)*(1+2*ln(x))
exp(exp(x))-exp(-x+exp(x))
(x+exp(1)+1)*x^exp(x)*exp(x)
ln(x/Pi)/(ln(x)^ln(exp(1)*Pi))
(1-(-1/2*Pi+arcsin(sin(x)))^2)^(1/2)
(3*x^3+2*x^2+1)/(x^2+1)^(1/3)
(1/x*ln(1/x))^(1/2)
sin(1/x^11)
x*(exp(-x)+1)/(exp(x)-1)
ln(3^(1/2)+tan(x))
x^(1/3)*(1-x)^(2/3)
x*cot(x)
((x+1)^(1/2)-x^(1/2))^Pi
(1+x^2+(x^4+x^2+1)^(1/2))^(1/2)

Mupad
------
ln(x+1)/(x^2+1)
(x/(-x^3+1))^(1/2)
1/(1+x^(1/2))/(-x^2+x)^(1/2)
x*arcsin(x)/(-x^2+1)^(1/2)
sin(x)*(1+tan(x)^2)^(1/2)
sin(x)*ln(sin(x))
1/(1-ln(1-x))
(x+(x^2+1)^(1/2))^(1/2)
sin(x+1/4*Pi)^2/exp(x^2)
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
1/(x^(3/2)-x^2)^(1/2)
exp(-x^40)
arcsin(x)/x^3
(arctan(x)+arccot(x))/x
(x+exp(1)+1)*x^exp(x)*exp(x)
(2*x^2022+1)/(x^2023+x)
ln(x/Pi)/(ln(x)^ln(exp(1)*Pi))
(1-(-1/2*Pi+arcsin(sin(x)))^2)^(1/2)
(3*x^3+2*x^2+1)/(x^2+1)^(1/3)
(sec(1+ln(x))^2-tan(1+ln(x)))/x^2
(1/x*ln(1/x))^(1/2)
(4-(x+1)^2)^(1/2)-3^(1/2)-(-x^2+4)^(1/2)
arcsin(x)*arccos(x)
sin(1/x^11)
x*(exp(-x)+1)/(exp(x)-1)
ln(3^(1/2)+tan(x))
x^(1/3)*(1-x)^(2/3)
x*cot(x)
x^(-ln(x))
cos(1/2*Pi*x^2*2^(1/2))^2
((x+1)^(1/2)-x^(1/2))^Pi
tan(x)^(1/3)/(cos(x)+sin(x))^2
(1+x^2+(x^4+x^2+1)^(1/2))^(1/2)

Sympy
------
sqrt(tan(x))
ln(x+1)/(x^2+1)
x^(1/2)/(x^(1/2)-x^(1/3))
1/(sin(x)+sec(x))
1/(1+exp(x)+exp(2*x))^(1/2)
(csc(x)-sin(x))^(1/2)
1/(9*cos(x)^2+4*sin(x)^2)
(x/(-x^3+1))^(1/2)
sin(101*x)*sin(x)^99
((1-x)/(x+1))^(1/2)
1/(1+x^(1/2))/(-x^2+x)^(1/2)
x^(1/2)/((2012-x)^(1/2)+x^(1/2))
(-1+x)/(x+1)/(x^3+x^2+x)^(1/2)
(csc(x)-sin(x))^(1/2)
sin(x)*(1+tan(x)^2)^(1/2)
x*sec(4*x)^2
1/(1-ln(1-x))
exp(sin(x))/tan(x)/csc(x)
(csc(x)-sin(x))^(1/2)
1/(sin(x)^4+cos(x)^4)
(1+2*x*exp(x^2))*cos(x)-(x+exp(x^2))*sin(x)
arccosh(x)
tanh(x)/exp(x)
(1+sin(x))^(1/2)
sin(x+1/4*Pi)^2/exp(x^2)
cos(x)/(1-cos(2*x))
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
1/(x^(41/25)+x^(9/25))
1/(x^(3/2)-x^2)^(1/2)
exp(x+exp(x))+exp(x-exp(x))
(sin(20*x)+sin(19*x))/(cos(20*x)+cos(19*x))
(arctan(x)+arccot(x))/x
x/((-1+x)^(1/2)+(x+1)^(1/2))
sin(x+sin(x))-sin(x-sin(x))
1/(1+sin(x))+1/(1+cos(x))+1/(tan(x)+1)+1/(1+cot(x))+1/(1+sec(x))+1/(1+csc(x))
(x+exp(1)+1)*x^exp(x)*exp(x)
x^2/(-x^2+2)+2^(1/2)*(x/(x+1))^(1/2)
(2*x^2022+1)/(x^2023+x)
(1-(-1/2*pi+arcsin(sin(x)))^2)^(1/2)
(cos(x)-sin(x))/(2+sin(2*x))
(sec(1+ln(x))^2-tan(1+ln(x)))/x^2
(1/x*ln(1/x))^(1/2)
x*(exp(-x)+1)/(exp(x)-1)
ln(3^(1/2)+tan(x))
((sin(20*x)+3*sin(21*x)+sin(22*x))^2+(cos(20*x)+3*cos(21*x)+cos(22*x))^2)^(1/2)
exp(-2*x)*sin(3*x)/x
x*cot(x)
1/((x+1)^3*(-1+x))^(1/2)
x^(-ln(x))
exp(cos(x))*cos(2*x+sin(x))
sin(4*arctan(x))
tan(x)^(1/3)/(cos(x)+sin(x))^2
sin(2*x)^2*sin(3*x)^2*sin(5*x)^2*sin(30*x)^2/sin(x)^2/sin(6*x)^2/sin(10*x)^2/sin(15*x)^2
(1+x^2+(x^4+x^2+1)^(1/2))^(1/2)

Waldek Hebisch

unread,
Mar 6, 2023, 1:08:19 PM3/6/23
to 'Nasser M. Abbasi' via FriCAS - computer algebra system
On Sat, Mar 04, 2023 at 12:34:25AM -0800, 'Nasser M. Abbasi' via FriCAS - computer algebra system wrote:
>
> Fyi;
>
> The following are the integrals from the MIT integration
> problems which are not solved broken per CAS.
>
<snip>
> Fricas:
> -------
> ln(x+1)/(x^2+1)
> sin(101*x)*sin(x)^99
> x*(1-x)^2014 Exception raised: RecursionError >> maximum recursion
> depth exceeded
> (2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1) Timed out
> cos(3*x)+sin(2*x)*(-sin(2019*x)+cos(3*x)) Timed out
> x*(1-x)^2020 Exception raised: RecursionError >> maximum recursion depth
> exceeded
> (1-x)^3+(-x^2+x)^3+(x^2-1)^3-3*(1-x)*(-x^2+x)*(x^2-1)
> (x+exp(1)+1)*x^exp(x)*exp(x)
> (3*x^3+2*x^2+1)/(x^2+1)^(1/3)
> (1/x*ln(1/x))^(1/2)
> 2^(1/2)*ln(x)^(1/2)+1/2*2^(1/2)/ln(x)^(1/2)

Hmm, AFACS FriCAS can do:

x*(1-x)^2014
x*(1-x)^2020
(1-x)^3+(-x^2+x)^3+(x^2-1)^3-3*(1-x)*(-x^2+x)*(x^2-1)

all 3 are polynomials so should be easy for computer. The first
two give somewhat large result, but FriCAS is supposed to handle
much larger polynomials. The third is 0.

In principle FriCAS should do:

sin(101*x)*sin(x)^99
(2018*x^2017+2017*x^2016)/(x^4036+2*x^4035+x^4034+1)
cos(3*x)+sin(2*x)*(-sin(2019*x)+cos(3*x))

but first and third currently trigger costly transformations, that
could be avoided. Second looks inherently heavy when done by
general methods.

--
Waldek Hebisch

Nasser M. Abbasi

unread,
Mar 6, 2023, 3:15:40 PM3/6/23
to FriCAS - computer algebra system
Here is the first. Please note CAS integration tests uses sagemath for all the tests
If you think this is sagemath bug, I can report it

>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.8, Release Date: 2023-02-11                     │
│ Using Python 3.11.1. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage: var('x')
x
sage: integrate(x*(1-x)^2014,x,algorithm="fricas")

Gives

File ~/TMP/sage-9.8/src/sage/interfaces/fricas.py:1313, in FriCASElement._parse_and_eval(s, start)
   1310     a += 1
   1312 if s[a] == FriCASElement._LEFTBRACKET:
-> 1313     return FriCASElement._parse_list(s, start=a)
   1314 elif s[a] == FriCASElement._STRINGMARKER:
   1315     return FriCASElement._parse_string(s, start=a)


RecursionError: maximum recursion depth exceeded
---------------------------------------------

Here is the second one

sage: integrate(x*(1-x)^2020,x,algorithm="fricas")

gives

 1310     a += 1
   1312 if s[a] == FriCASElement._LEFTBRACKET:
-> 1313     return FriCASElement._parse_list(s, start=a)
   1314 elif s[a] == FriCASElement._STRINGMARKER:
   1315     return FriCASElement._parse_string(s, start=a)


RecursionError: maximum recursion depth exceeded

The third gives zero, due to a check in place which checks for this due to earlier 
problems with Fricas giving zero on integrals which it should not (may be you remember this)
the test flagged this as failed. I can fix this.

The next one

sage: integrate(sin(101*x)*sin(x)^99,x,algorithm="fricas")
Failed due to timeout. I did not check the rest, but timeout must be the same reason.
The tests have 3 minute timeout.

--Nasser

Waldek Hebisch

unread,
Mar 6, 2023, 4:34:13 PM3/6/23
to 'Nasser M. Abbasi' via FriCAS - computer algebra system
On Mon, Mar 06, 2023 at 12:15:40PM -0800, 'Nasser M. Abbasi' via FriCAS - computer algebra system wrote:
> Here is the first. Please note CAS integration tests uses sagemath for all
> the tests
> If you think this is sagemath bug, I can report it
>
> >sage
> ┌────────────────────────────────────────────────────────────────────┐
> │ SageMath version 9.8, Release Date: 2023-02-11 │
> │ Using Python 3.11.1. Type "help()" for help. │
> └────────────────────────────────────────────────────────────────────┘
> sage: var('x')
> x
> sage: integrate(x*(1-x)^2014,x,algorithm="fricas")
>
> Gives
>
> File ~/TMP/sage-9.8/src/sage/interfaces/fricas.py:1313, in
> FriCASElement._parse_and_eval(s, start)
> 1310 a += 1
> 1312 if s[a] == FriCASElement._LEFTBRACKET:
> -> 1313 return FriCASElement._parse_list(s, start=a)
> 1314 elif s[a] == FriCASElement._STRINGMARKER:
> 1315 return FriCASElement._parse_string(s, start=a)
>
> RecursionError: maximum recursion depth exceeded
> ---------------------------------------------

This looks like sage interface error.

> Here is the second one
>
> sage: integrate(x*(1-x)^2020,x,algorithm="fricas")

Te same.

> The third gives zero, due to a check in place which checks for this due to
> earlier
> problems with Fricas giving zero on integrals which it should not (may be
> you remember this)

Yes.

> the test flagged this as failed. I can fix this.
>
> The next one
>
> sage: integrate(sin(101*x)*sin(x)^99,x,algorithm="fricas")
> Failed due to timeout. I did not check the rest, but timeout must be the
> same reason.

Yes, this one (and other timeouts) is FriCAS weakness. I mentioned it
as one that should be improved. But now marking it as failure
is right thing to do.

--
Waldek Hebisch

Nasser M. Abbasi

unread,
Mar 6, 2023, 4:52:14 PM3/6/23
to FriCAS - computer algebra system

Ok, entered bug at github for sagemath/Fricas interface on these ones that generated exceptions.


I am using latest sagemath 9.8. The next sagemath will be version 10.0.  

--Nasser
Reply all
Reply to author
Forward
0 new messages