Dec 19, 2021, 3:01:26 PM12/19/21
There's more than just "size" to determine if the result of an integration is optimal. Indeed, size might be misleading.
Consider the two results for integration of x^n wrt x.
Clearly r2 has more characters, and by some measure is more complex.
r1-r2 is 1/(n+1), a constant wrt x. so we should realize both answers are correct "within a constant".
Arguably r2 is better because the limit of r2 as n approaches -1 is ln(x).
The limit as r1 approaches -1 is indeterminate.
Looking at a very small sample of the Rubi tests, it seems that other measures of optimality might be missed. For example, an answer that has a structure of a series in sin(x), sin(2*x), sin(3*x) .... vs powers of sin(x), cos(x)...
Another aspect is whether the integration program has as its responsiblity the reduction of the answer -- or is the user likely to apply a simplification program (say, to canonicalize rational functions, expand polynomials or factor them, apply trigonometric simplifications, etc.)
I can imagine a situation in which one program returns an answer that includes an integral of sin(x)/x [thereby failing the Rubi test] where another returns Si(x), the sine integral, defined as the integral of sin(x)/x. Which looks mostly like a nomenclature issue. There is also the possibility that (I see this in Maxima), the result is expressed in another form entirely, e.g. via Incomplete Gamma functions. I suppose that it depends on what your favorite numerical library contains, Si, Gamma, Hypergeometric functions etc.
If it is not already considered, perhaps the simplification issue can be separated out somewhat. For instance, the Rubi testing might consider a result R from Maxima to be too complicated. What about trigsimp(R), or ratsimp(R) or for that matter, ratsimp(trigsimp(R))? There are a number of additional plausible routines.
I don't see an easy way of handling the possibilities though.
In fact, given g = diff ( integrate(f,x),x), if the programs are correct, we know that f and g are equivalent. Yet computing simplify(f-g) to get 0, for some simplification program, may be quite difficult.
This testing of Rubi is valuable --- I look forward to Rubi 5 for Maxima, the system I most often use.