Rule-based integration : An extensive system of symbolic integration rules

Finding the antiderivative of expressions is often challenging and requires advanced mathematical skills even for simple looking problems. Computer algebra systems (CAS) like Mathematica (Wolfram Research, Inc., Champaign, IL), Maple (Maplesoft, a division of Waterloo Maple Inc., Waterloo, Ontario), and Maxima (maxima.sourceforge.net) provide integrators to compute antiderivatives symbolically. However, these systems give no insight as to how an antiderivative is found or why it could not be computed. Also, they use advanced methods incomprehensible to humans that often result in huge antiderivatives unnecessarily involving special functions.

In this work we present Rubi (The Rubi Organization, 2018a), a rule-based integrator and its implementation in Mathematica (The Rubi Organization, 2018b).Rubi systematically applies an extensive system of symbolic integration rules able to find the optimal antiderivative of a wide variety of mathematical expressions.It currently has over 6600 rules implemented in Mathematica's pattern-matching language.Some of these rules are based on integration formulas from (Abramowitz, 2012;Burington, 1973;Gradshteyn, 2014;Zwillinger, 2011) transformed into rules that include precise instructions as to when a formula should be applied.Numerous other rules were derived during Rubi's development in order to integrate expressions not addressed by formulas in published tables.
The key to the success of Rubi is the rigorous definition of conditions for the integration steps that determine under which circumstances the application of a specific rule is correct and useful.Therefore, Rubi produces optimal antiderivatives that are often dramatically simpler than antiderivatives provided by commercial CAS integrators.
Rubi is implemented as a Mathematica package that gives the user the option to inspect integration steps and application conditions in detail.An extensive test-suite of over 70,000 integrals with known, optimal antiderivatives is employed to thoroughly test the system before each new release (The Rubi Organization, 2018c).Since it is also useful for testing other symbolic integrators, the entire test-suite is available on Rubi's website (The Rubi Organization, 2018a) expressed in Axiom, Maple, Mathematica, and Maxima syntax.Also on the website are PDF files showing how Rubi and Mathematica's built-in integrator perform on the test-suite.All information about Rubi, i.e. integration rules, source-code, and test-files, is publicly available on its GitHub organization page (The Rubi Organization, 2018d).
However, the value of Rubi goes far beyond its Mathematica implementation.All integration rules are available in human readable form as PDF files or Mathematica notebooks that contain additional details and references to the relevant literature.Since Rubi's rules in general only require a system for manipulating symbolic expressions by applying pattern-based rules, it is feasible to implement the integration rules in other systems.
That this is indeed possible has been shown in the case of Symja (Kramer, 2013), an opensource Java system for symbolic math, where we assisted in the translation and testing of Rubi's integration rules.Now Rubi is used as the main integration engine in Symja for all but the most trivial problems.Furthermore, there are efforts to include Rubi into SymPy (Meurer et al., 2017), a Python library for symbolic mathematics, which would allow Rubi's use in Sage(The Sage Developers, 2018), a free and open-source CAS.
Ultimately, the rationale behind Rubi is to make rule-based integration publicly available to enable researchers and enthusiast to find optimal antiderivatives and to verify the correctness of each integration step in the context of their problems.

Short Example
Figure 1 shows the computation of using Rubi when all integration steps are displayed.The specific rules that are applied are shown in red, and it is possible to open the rule display to inspect the exact conditions that need to hold to make the transformation valid.In blue, the intermediate expressions are visible.At the end the final antiderivative is returned.It should be noted that the size of the found antiderivative is 25, counting the leaves in the expression tree of the result.In comparison, Mathematica's current version 11.3 returns an antiderivative that has a leaf count of 290 and contains complex terms.

Figure 1 :
Figure 1: Example of computing the antiderivative of an expression, showing intermediate results and applied rules.