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

Even if you remove the

`z`

from the expression, Rubi and Mathematica cannot find a closed form of the antiderivative.
@betatron_gitlab Rubi is a package for calculating the symbolic antiderivatives of expressions. So if you have an expression that cannot be integrated with Mathematica, often but not always Rubi can do it. However, like in your case, where it is not possible, you will most likely need to use numeric integration.

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...