Support for Rubi integration rules

Gregory Vernon on 3 Oct 2025
Latest activity Reply by Christopher Creutzig on 8 Oct 2025

Something that I periodically wonder about is whether an integration with the Rubi integration rules package would improve symbolic integration in Matlab's Symbolic Toolbox. The project is open-source with an MIT-licensed, has a Mathematica implementation, and supposedly SymPy is working on an implementation. Much of my intrigue comes from this 2022 report that compared the previous version of Rubi (4.16.1) against various CAS systems, including Matlab 2021a (Mupad):
While not really an official metric for Rubi, this does "feel" similar to my experience computing symbolic integrals in Matlab Symbolic Toolbox vs Maple/Mathematica. What do y'all think?
Mike Croucher
Mike Croucher on 6 Oct 2025
Thanks for this. I have brought it to the attention of the relevant teams internally at MathWorks.
xingxingcui
xingxingcui on 6 Oct 2025 (Edited on 6 Oct 2025)
Good idea,the report initially looks very compelling. If it could be integrated with or referenced by the MATLAB Symbolic Toolbox, it would be very valuable for the MATLAB product. I recommend that you directly submit a feature-request via technical support: https://www.mathworks.com/support/contact_us.html
-----
By the way, earlier this year I accidentally came across a Python hyperparameter optimization framework Optuna that is very difficult to use in MATLAB, and I hope this functionality will be enhanced in future versions of MATLAB.
Paul
Paul on 3 Oct 2025 (Edited on 4 Oct 2025)
I did a very quick perusal of that 2022 report. Keep in mind that no mupad result could be given an A grade.
I checked the first result in section 3.1 (page 50), which at the time it was claimed that R2021a did not return a result. But it does return the correct result here in 2025b.
matlabRelease
ans =
matlabRelease with properties: Release: "R2025b" Stage: "release" Update: 0 Date: 21-Aug-2025
syms F c a b d e m x
I = F^(c*(a+b*x))*(d+e*x)^m
I = 
int(I,x)
ans = 
And here is 3.7, which also was graded as a failure, but now returns the expected result.
I = F^(c*(a+b*x))/(d+e*x)
I = 
int(I,x)
ans = 
It would be interesting to see a comprehensive comparison, perhaps showing the evolution from 2021a to 2025b.
Paul
Paul on 8 Oct 2025
Problem 3.98 from the cited report may also be of interest
syms a b x
I = exp(a + b*x)^(1/2)/x^4
I = 
Applying int returns an unevaluated resut, consistent with the report
H = int(I,x) %(1)
H = 
But we can get a result by
int(I,x,'IgnoreAnalyticConstraints',true)
ans = 
which, I believe, is the same as shown in the report to within a constant.
I never know precisely which "analytical constraint(s)" is being ignored, and it would be nice if there was a way for Matlab to indicate which constraints are an issue in (1).
Nevertheless, it makes one wonder if the other packages that return a result are using assumptions that might not be true for all values of the parameters in the problem.
Christopher Creutzig
Christopher Creutzig on 8 Oct 2025
For indefinite integration, we can use diff to start checking when the result is correct:
syms a b x
I = exp(a + b*x)^(1/2)/x^4;
H = int(I,x,'IgnoreAnalyticConstraints',true)
H = 
delta = simplify(diff(H,x)-I)
delta = 
So that tells us that the ignored constraint is that in general. And indeed, it's not hard to find values for a and b where delta ~= 0, i.e., the claimed result is incorrect:
vpa(subs(delta,[a,b,x],[1i,1+234i,1]))
ans = 
Christopher Creutzig
Christopher Creutzig on 8 Oct 2025
Oh, and I should add that MATLAB happily finds a closed form integral if you tell it that a and b are real-valued (the integration variable x is implicitly asumed to be real for integration anyway):
syms a b x real
I = exp(a + b*x)^(1/2)/x^4;
int(I,x)
ans = 
Paul
Paul on 8 Oct 2025
Hi Christopher,
I too saw that assuming a and b real yields a solution, but wasn't sure if that assumption is consistent with how the study in the cited report was conducted. I didn't see anything in the report that said anything about assumptions on the parameters, so decided to not go down that path.
My conclusion that the results between Matlab and Rubi are the same to within a constant was based on an incorrect analysis on my part. Thanks for your clarification.
So the Rubi result should be considered incorrect absent an assumption on a,b being real?
I was curious about the difference in these two terms
syms a b x
T1 = exp(a/2 + b*x/2);
T2 = exp(a + b*x)^(1/2)/x^4
T2 = 
T = subs([T1;T2],[a,b,x],[1i,1+234i,1])
T = 
vpa(T)
ans = 
Christopher Creutzig
Christopher Creutzig on 8 Oct 2025
I had not looked at the result in the report, only tried to answer which condition your second int call ignored. I don't think we can claim that the result in the report is incorrect:
syms a b x
I = sqrt(exp(a+b*x))/x^4;
H2 = sqrt(exp(a+b*x))*(-1/(3*x^3)-b/(12*x^2)-b^2/(24*x)+b^3/48*exp(-b*x/2)*ei(b*x/2))
H2 = 
delta = simplify(diff(H2,x)-I)
delta = 
0