- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

well

@betatron_gitlab "Please, what is the utility of Rubi for a physicist?" There is a Physics paper using Rubi https://arxiv.org/pdf/1811.04892.pdf titled "An Application of Rubi: Series Expansion of the Quark Mass

Renormalization Group Equation"

Renormalization Group Equation"

Thanks Nasser.

I'm having trouble looking up a reference for a RUBI rule

The rule (rules actually) are 2485 and 2490. Where can I look this up?

Do you thing you can do something about this?

Note that for both forms of the above integrals, Mathematica 11.3 returns a multipage "wall paper" result. Maple 2018 returns the integral unevaluated.

Rubi experts. Is there an easy way to extract the rubi Rule from the output of `DownValues[Int][[ruleNumber]]`

in a way that I can easily use it in the report I am making? For example

```
<<Rubi`
DownValues[Int][[30]];
InputForm[%]
```

gives

```
HoldPattern[Int[(Rubi`Private`x_)^(Rubi`Private`m_.),
Rubi`Private`x_Symbol]] :>
Rubi`Private`ShowStep[30, "If \!\(\*RowBox[{\"NeQ\", \"[\", RowBox[{\"m\", \",\",
RowBox[{\"-\", \"1\"}]}], \"]\"}]\)", "Integrate[(x)^(m), x]",
"x^(m + 1)/(m + 1)", Hold[Rubi`Private`Simp[Rubi`Private`x^(Rubi`Private`m
+ 1)/(Rubi`Private`m + 1), Rubi`Private`x]]] /;
FreeQ[Rubi`Private`m, Rubi`Private`x] &&
Rubi`Private`NeQ[Rubi`Private`m, -1] /; Rubi`Private`SimplifyFlag
```

All what I want really is just the parts

` "Integrate[(x)^(m), x]" and "x^(m + 1)/(m + 1)" `

since that is what would be the useful part for the readers. Then in Latex, I would put the above as something like

` Integrate[(x)^(m), x] ----- 30 -----> x^(m + 1)/(m + 1)`

The idea is that I want to show the rules below the result, but in a easy way to read them.

thanks

I needed to add small note on last message I wrote. The software I am using in current build is

```
Mathematica 12 (64 bit).
Rubi 4.16.1 in Mathematica 12.
Maple 2019.1 (64 bit)
Maxima 5.43
Fricas 1.3.5.
Sympy 1.4 under Python 3.7.3 using Anaconda distribution.
Giac/Xcas 1.5.
SageMath version 8.8
```

I am not using Rubi_in_sympy in this build, since that would require waiting for sympy 1.5 and I am not sure when that will be released. That is why it is not listed above. Rubi_in_sympy does not work in Sympy 1.4 due to a small bug. Hopefully this will be fixed in sympy 1.5 and if so, will add it then.

To answer myself on my question above. I think I have to run Rubi again to get the steps. This is what I actually did in version 4.5.

So in V 4.16.1, I would do this

```
{stats, result} = Stats[Int[( ......] (*to get result and stats*)
steps=Steps[Int[....] (*to get the steps, with rules numbers*)
```

It would be nice, if there was a way to just obtain back a specific rule given its rule number. Since stats already return the rule numbers used

` stats["Rules"]`

Gives list of rule numbers used, but without having to actually integrate again the same integrand. But this is no problem, I'll run Rubi twice, the second time just to obtain the actual rules/steps used.

Rubi runs fast, so it is OK for now to do this.

@nasser1 To get the raw rules using `DownValues`

without the ShowStep wrapper, build Rubi with the control variable `$LoadShowSteps`

set to False during the load as follows:

```
$LoadShowSteps = False;
Get["Rubi`"]
BeginPackage["Rubi`"];
Begin["`Private`"];
DownValues[Int][[30]]//InputForm
```

which should then display

`HoldPattern[Int[(x_)^(m_.), x_Symbol]] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]`

`$LoadShowSteps`

is described at the end of the "Using Rubi" instructions on Rubi's GitHub website.
Hi; FYI. The data input files for Maple in version 4.16.1 is missing one file compared to Mathematica. Under the folder "7 Inverse hyperbolic functions\7.2 Inverse hyperbolic cosine" Maple has only 3 files, while Mathematica has 4 files. The extra file is "d+e_x-^p-d+e_x-^q-a+b_arccosh-c_x-^n.m" which do not exist in Maple input zip file. If this file is available for Maple I can add it. If not, I will remove the extra file from Mathematica, since the same number of files is needed for both.

Thanks,

Thanks,

@szhorvat Yikes!!! Many people are in danger of losing their jobs due to computer automation, but I never figured implementers of computer algebra systems had anything to worry about...

Seriously, if "deep learning" neural networks are to compete with human programmers, they will need to derive the recurrence relations necessary to reduce integrands to forms for which there are terminal rules. It should be relatively easy for neural networks to learn terminal integration rules from Rubi’s test suite since it explicitly includes examples of them in their most general form.

However, deriving the necessary recurrence relations from the test suite will be much harder since they can only be inferred implicitly by reverse engineering problems that have used them. Also, which recurrence to use when multiple recurrences could be applied to a given integrand is an even more difficult problem.

Instead of trying to derive the recurrences from Rubi’s test suite, seems like it would be a lot easier for neural networks to just lift them directly from Rubi’s freely available source code where they are explicitly provided in both human- and machine-readable form...

Albert

I only skimmed it briefly, but it seems like real progress. No doubt there are many integrals it can solve that either

`Integrate`

or RUBI cannot. Someone mentioned one here: https://mathematica.stackexchange.com/q/211701/12
But I wonder how well it would do on an independent test suite like @nasser1's (which is likely to contain many examples different from anything it was trained on)

Hello! I think Rubi is a great undertaking and want to suggest an idea. In my applications it is important to select the integration constant for anti-derivatives in a natural way rather than based on simplicity of expression. We call it "natural integral". Natural integral can be defined as Newton series interpolation over consecutive derivatives evaluated at -1. In other words, it is unique anti-derivative which continues the sequence of consecutive derivatives. Often it is difficult to find the desired natural integration constant. For simple functions such as exp x and cos x the natural integrals are exp x and sin x respectively, but for other functions this can be not so evident. Please look at this post which includes 3 proposed definitions of natural integral: https://mathoverflow.net/questions/346741/prove-the-following-property-about-natural-integral

To clarify, I suggest there could be an option to produce the natural anti-derivative instead of what can be seen as simpler expression.

Rubi is an open source, freely available system. I invite you to modify its terminal rules to generate "natural" antiderivatives and to make public the resulting *Natural Rubi*. Also a rule-based discrete integrator that produced antidifferences would be a great project for someone knowledgable in the field...

If you think the problem is integrable *and* in the class of expressions Rubi is designed to integrate, you can post it here or open an issue at https://github.com/RuleBasedIntegration/Rubi/issues.

This is an excerpt of a recent post on the sci.math.symbolic usernet group

And of course, having no better method one could use Rubi way:

add lookup table and retrieve precomputed answer from the table.

I responded with the following post:

Rubi does NOT use a lookup table of specific precomputed integrals. Rather it uses generic reduction and terminal rules to iteratively integrate large classes of expressions. For example, when Martin presents a specific example Rubi cannot integrate, it usually leads to a generic rule able to produce optimal antiderivatives for the whole class of integrands for which the example is a special case.

Instead of using rule-based integration when there is “no better method”, I contend it should be used BEFORE resorting to advanced methods like Risch. There are numerous advantages of a properly implemented rule-based integrator:

- If a rule does apply, the optimal antiderivative will quickly and reliably be found.
- Rule-based systems can show the rules applied and the resulting intermediate steps.
- The rules are self-contained and easily verified by differentiation.
- The individual rules are elementary in nature and thus comprehensible to mere humans, like first year calculus students.
- This makes rule-based systems great pedagogical tools in the classroom.
- Rules can be developed, debugged and tested in a modular fashion rather than as a monolith.
- Holes in the rule-based decision tree point to where new mathematical knowledge (in this case, integration formulas) is crying out to be discovered.
- It’s quickly determined when no rule applies, so the delay in resorting to advanced methods is negligible, especially compared to the amount time such methods often require.

[1/(1+sin(x)^6),x,7,1/3*x/sqrt(2)+1/3*atan(cos(x)*sin(x)/(1+sin(x)^2+sqrt(2)))/sqrt(2)+1/3*atan(sqrt(1-(-1)^(1/3))*tan(x))/sqrt(1-(-1)^(1/3))+1/3*atan(sqrt(1+(-1)^(2/3))*tan(x))/sqrt(1+(-1)^(2/3))],

Maybe the version of maxima I'm using.I've found it necessary to replace the likes of atan(b,c) with atan(c/b) in the rubi rules for maxima. That has made the lst[] loadable; whereas the previous 1/(1+sin(x)^6) example produces a divide by zero error when I attempt to load it.There is an integral for that available in maxima, however the likes of 1/(1+sin(x)^8) don't have an integral in maxima.Symja now produces a result, that's almost correct; the (-1)^(1/3) +1 has now been changed so as not to produce the divide by zero error.

Hello; Why sometimes Rubi shows "removeContent" from Steps command on some integrals? For example, from clean kernel

```
<< Rubi`
Steps[Int[Sin[2*x]/(a^2 - b^2*Sin[x]^2), x]]
```

Gives the above screen shot. This does not show all the time, I just noticed it on this one. May be it is normal for this to show up sometimes. I just wanted to check.

btw, how does one find the version number of Rubi they are using? Is there something like Rubi`VersionNumber[]`

command?

I am using V 12.1 of Mathematica on windows 10. Rubi 4.16.1

@nasser1 Hi Nasser. Rubi wraps

`RemoveContent`

around the arguments of logs occurring at the top-level of antiderivatives to remove unnecessary factors independent of the integration variable. For example, for the integrand `1/(r*t+s*t*x)`

Rubi returns `Log[r+s*x]/(s*t)`

; whereas Mathematica returns `Log[r*t+s*t*x]/(s*t)`

.
`$RubiVersion`

returns the string `"Rubi 4.16.1.0"`

.