Chapter 1
Introduction

This report gives the result of running the computer algebra independent integration problems. The listing of the problems are maintained by and can be downloaded from https://rulebasedintegration.org

The number of integrals in this report is [ 774 ]. This is test number [ 55 ].

 1.1 Listing of CAS systems tested
 1.2 Results
 1.3 Performance
 1.4 list of integrals that has no closed form antiderivative
 1.5 list of integrals solved by CAS but has no known antiderivative
 1.6 list of integrals solved by CAS but failed verification
 1.7 Timing
 1.8 Verification
 1.9 Important notes about some of the results
  1.9.1 Important note about Maxima results
  1.9.2 Important note about FriCAS and Giac/XCAS results
  1.9.3 Important note about finding leaf size of antiderivative
 1.10 Design of the test system

1.1 Listing of CAS systems tested

The following systems were tested at this time.

  1. Mathematica 12.1 (64 bit) on windows 10.
  2. Rubi 4.16.1 in Mathematica 12 on windows 10.
  3. Maple 2020 (64 bit) on windows 10.
  4. Maxima 5.43 on Linux. (via sagemath 8.9)
  5. Fricas 1.3.6 on Linux (via sagemath 9.0)
  6. Sympy 1.5 under Python 3.7.3 using Anaconda distribution.
  7. Giac/Xcas 1.5 on Linux. (via sagemath 8.9)

Maxima, Fricas and Giac/Xcas were called from inside SageMath. This was done using SageMath integrate command by changing the name of the algorithm to use the different CAS systems.

Sympy was called directly using Python.

1.2 Results

Important note: A number of problems in this test suite have no antiderivative in closed form. This means the antiderivative of these integrals can not be expressed in terms of elementary, special functions or Hypergeometric2F1 functions. RootSum and RootOf are not allowed.

If a CAS returns the above integral unevaluated within the time limit, then the result is counted as passed and assigned an A grade.

However, if CAS times out, then it is assigned an F grade even if the integral is not integrable, as this implies CAS could not determine that the integral is not integrable in the time limit.

If a CAS returns an antiderivative to such an integral, it is assigned an A grade automatically and this special result is listed in the introduction section of each individual test report to make it easy to identify as this can be important result to investigate.

The results given in in the table below reflects the above.




System solved Failed






Rubi % 98.97 ( 766 ) % 1.03 ( 8 )



Mathematica % 97.03 ( 751 ) % 2.97 ( 23 )



Maple % 80.23 ( 621 ) % 19.77 ( 153 )



Maxima % 59.69 ( 462 ) % 40.31 ( 312 )



Fricas % 86.05 ( 666 ) % 13.95 ( 108 )



Sympy % 39.79 ( 308 ) % 60.21 ( 466 )



Giac % 44.7 ( 346 ) % 55.3 ( 428 )



The table below gives additional break down of the grading of quality of the antiderivatives generated by each CAS. The grading is given using the letters A,B,C and F with A being the best quality. The grading is accomplished by comparing the antiderivative generated with the optimal antiderivatives included in the test suite. The following table describes the meaning of these grades.



grade

description





A

Integral was solved and antiderivative is optimal in quality and leaf size.



B

Integral was solved and antiderivative is optimal in quality but leaf size is larger than twice the optimal antiderivatives leaf size.



C

Integral was solved and antiderivative is non-optimal in quality. This can be due to one or more of the following reasons

  1. antiderivative contains a hypergeometric function and the optimal antiderivative does not.
  2. antiderivative contains a special function and the optimal antiderivative does not.
  3. antiderivative contains the imaginary unit and the optimal antiderivative does not.



F

Integral was not solved. Either the integral was returned unevaluated within the time limit, or it timed out, or CAS hanged or crashed or an exception was raised.



Grading is implemented for all CAS systems. Based on the above, the following table summarizes the grading for this test suite.






System % A grade % B grade % C grade % F grade










Rubi 96.12 0. 2.84 1.03





Mathematica 91.99 0.65 4.39 2.97





Maple 63.82 15.89 0.52 19.77





Maxima 50.26 6.07 3.36 40.31





Fricas 73.51 9.69 2.84 13.95





Sympy 35.4 4.26 0.13 60.21





Giac 40.96 3.75 0. 55.3





The following is a Bar chart illustration of the data in the above table.

pict

The figure below compares the CAS systems for each grade level.

pict

1.3 Performance

The table below summarizes the performance of each CAS system in terms of CPU time and leaf size of results.







System Mean time (sec) Mean size Normalized mean Median size Normalized median












Rubi 0.14 68.28 0.89 41.5 1.






Mathematica 0.14 60.94 0.82 36. 0.93






Maple 0.05 137.74 1.83 49. 1.






Maxima 1.01 186.15 2.71 31. 1.12






Fricas 1.31 256. 3.27 131. 2.52






Sympy 2.68 71.21 1.33 24. 0.9






Giac 1.01 115.75 2.22 28. 1.13






1.4 list of integrals that has no closed form antiderivative

{199, 200, 201, 205, 206, 207, 213, 214, 229, 230, 231, 237, 238, 239, 240, 241, 243, 244, 245, 246, 251, 252, 253, 388, 389, 390, 395, 396, 413, 414, 415, 420, 421, 430, 431, 436, 437, 442, 443, 447, 448, 449, 543, 548, 549, 550, 555, 556, 576, 577, 594, 599, 600, 601, 609, 614, 615, 616, 747, 748, 749, 751, 754, 758, 759, 760, 761, 762, 763, 764, 765}

1.5 list of integrals solved by CAS but has no known antiderivative

Rubi
{}
Mathematica
{}
Maple
{}
Maxima
{}
Fricas
{}
Sympy
{}
Giac
{}

1.6 list of integrals solved by CAS but failed verification

The following are integrals solved by CAS but the verification phase failed to verify the anti-derivative produced is correct. This does not mean necessarily that the anti-derivative is wrong, as additional methods of verification might be needed, or more time is needed (3 minutes time limit was used). These integrals are listed here to make it easier to do further investigation to determine why it was not possible to verify the result produced.

Rubi
{}
Mathematica
{66}
Maple
Verification phase not implemented yet.
Maxima
Verification phase not implemented yet.
Fricas
Verification phase not implemented yet.
Sympy
Verification phase not implemented yet.
Giac
Verification phase not implemented yet.

1.7 Timing

The command AboluteTiming[] was used in Mathematica to obtain the elapsed time for each integrate call. In Maple, the command Usage was used as in the following example

cpu_time := Usage(assign ('result_of _int',int(expr,x)),output='realtime'

For all other CAS systems, the elapsed time to complete each integral was found by taking the difference between the time after the call has completed from the time before the call was made. This was done using Python’s time.time() call.

All elapsed times shown are in seconds. A time limit of 3 minutes was used for each integral. If the integrate command did not complete within this time limit, the integral was aborted and considered to have failed and assigned an F grade. The time used by failed integrals due to time out is not counted in the final statistics.

1.8 Verification

A verification phase was applied on the result of integration for Rubi and Mathematica. Future version of this report will implement verification for the other CAS systems. For the integrals whose result was not run through a verification phase, it is assumed that the antiderivative produced was correct.

Verification phase has 3 minutes time out. An integral whose result was not verified could still be correct. Further investigation is needed on those integrals which failed verifications. Such integrals are marked in the summary table below and also in each integral separate section so they are easy to identify and locate.

1.9 Important notes about some of the results

1.9.1 Important note about Maxima results

Since these integrals are run in a batch mode, using an automated script, and by using sagemath (SageMath uses Maxima), then any integral where Maxima needs an interactive response from the user to answer a question during evaluation of the integral in order to complete the integration, will fail and is counted as failed.

The exception raised is ValueError. Therefore Maxima result below is lower than what could result if Maxima was run directly and each question Maxima asks was answered correctly.

The percentage of such failures were not counted for each test file, but for an example, for the Timofeev test file, there were about 30 such integrals out of total 705, or about 4 percent. This pecrentage can be higher or lower depending on the specific input test file.

Such integrals can be indentified by looking at the output of the integration in each section for Maxima. If the output was an exception ValueError then this is most likely due to this reason.

Maxima integrate was run using SageMath with the following settings set by default

'besselexpand : true'
'display2d : false'
'domain : complex'
'keepfloat : true'
'load(to_poly_solve)'
'load(simplify_sum)'
'load(abs_integrate)' 'load(diag)'

SageMath loading of Maxima abs_integrate was found to cause some problem. So the following code was added to disable this effect.

 from sage.interfaces.maxima_lib import maxima_lib
 maxima_lib.set('extra_definite_integration_methods', '[]')
 maxima_lib.set('extra_integration_methods', '[]')

See https://ask.sagemath.org/question/43088/integrate-results-that-are-different-from-using-maxima/ for reference.

1.9.2 Important note about FriCAS and Giac/XCAS results

There are Few integrals which failed due to SageMath not able to translate the result back to SageMath syntax and not because these CAS system were not able to do the integrations.

These will fail With error Exception raised: NotImplementedError

The number of such cases seems to be very small. About 1 or 2 percent of all integrals.

Hopefully the next version of SageMath will have complete translation of FriCAS and XCAS syntax and I will re-run all the tests again when this happens.

1.9.3 Important note about finding leaf size of antiderivative

For Mathematica, Rubi and Maple, the buildin system function LeafSize is used to find the leaf size of each antiderivative.

The other CAS systems (SageMath and Sympy) do not have special buildin function for this purpose at this time. Therefore the leaf size is determined as follows.

For Fricas, Giac and Maxima (all called via sagemath) the following code is used


#see https://stackoverflow.com/questions/25202346/how-to-obtain-leaf-count-expression-size-in-sage

def tree(expr):
    if expr.operator() is None:
       return expr
    else:
       return [expr.operator()]+map(tree, expr.operands())

try:
    # 1.35 is a fudge factor since this estimate of leaf count is bit lower than
    #what it should be compared to Mathematica's
    leafCount = round(1.35*len(flatten(tree(anti))))
except Exception as ee:
    leafCount =1

For Sympy, called directly from Python, the following code is used

try:
  # 1.7 is a fudge factor since it is low side from actual leaf count
  leafCount = round(1.7*count_ops(anti))

  except Exception as ee:
         leafCount =1

When these cas systems have a buildin function to find the leaf size of expressions, it will be used instead, and these tests run again.

1.10 Design of the test system

The following diagram gives a high level view of the current test build system.