Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
Activity
Albert D. Rich
@AlbertRich
Patrick Scheibe
@halirutan
@AlbertRich No, I'm really concerned about this as well. Users often simply "use" without thinking and it should be clear, that Mathematica does a lot of work to handle this in Integrate.
@AlbertRich I changed it. Since the Wiki content partially duplicates what we have on the web-page, we should remove the pages there that cover stuff from the website. What I would like to see in the Wiki is a page that explains, how we can possibly verify the results of Rubi, Mathematica, ...
Albert D. Rich
@AlbertRich
@halirutan That was fast! Thanks for making the change.
How about putting the final "not" in italics or bold.
Albert D. Rich
@AlbertRich
@halirutan @Nasser Yes, cleaning redundant stuff off the Wiki page makes sense. The Wiki page could explain the grading system Nasser uses to grade the antiderivatives produced by the various systems.
Albert D. Rich
@AlbertRich

@Nasser @halirutan Patrick wrote:

What I would like to see in the Wiki is a page that explains, how we can possibly verify the results of Rubi, Mathematica, ...

I use two different methods to test the validity of a candidate antiderivative produced by the various systems, including Rubi:

• Test if the candidate's derivative minus the integrand simplifies to zero.
• Test if the candidate minus the optimal antiderivative is free of the integration variable or that difference differentiates to zero. (Since it's ok for the candidate and optimal to differ by a piecewise constant which is not free of the integration variable.)

Depending on the size of the candidate, one of these methods may take an inordinate amount of time to decide while the other would quickly succeed. Also, sometimes the first method will succeed only if you Simplify or FullSimplify the candidate before differentiation; sometimes it will succeed only if you do not Simplify or FullSimplify the candidate before differentiation.

Also sometimes the first method will succeed only if you Simplify or FullSimplify the result of the differentiation before subtracting the integrand; sometimes it will succeed only if you do not to Simplify or FullSimplify until after subtracting the integrand.

Similarly, the second method succeeding sometimes depends on when the candidate and intermediate results are simplified. So the test program should use time slicing, or better parallel processing, to try the numerous permutations of these two verification methods. As you can see good antiderivative verification is a difficult research project...

Of course, if you don't trust me, the validity of the optimal antiderivatives in the test suite should be verified correct by the first method above. That verification should be easy, since the optimal antiderivatives are relatively small. However, I had to manually help out Mathematica on verifying some optimal antiderivatives that involved nested radicals and/or fifth roots.

Finally note that these methods assume the CAS conducting the verification tests correctly differentiates, subtracts and simplifies expressions.

Patrick Scheibe
@halirutan
@AlbertRich That's basically what I would have done as well except for the last part in method 2. It makes comparing different CAS very difficult, because you should give their results the benefit of the doubt. This means, they might produce a variant of the optimal antiderivative, but the CAS lacks of a powerful function like Simplify that is able to transform the expression into the right form. Am i mistaken here when I say that the correct way for e.g. Maple would be to integrate the expression, but import the result back to Mathematica to make the advanced comparision?
Albert D. Rich
@AlbertRich
@halirutan @Nasser Yes, even a 10 page result should be given "the benefit of the doubt" by simply reporting that it could not be verified.

@halirutan @Nasser Your remarks above suggest the WIki page on testing needs to clearly distinguish between

• testing the validity of candidate antiderivatives, as discussed above (which Nasser does not yet do), and
• grading the quality of candidates by comparing them with the optimal antiderivatives included in the test suite (which Nasser does do).

To receive a grade of A, a candidate does not have to equal, or be of the same form, as the optimal antiderivative. Rather it just has to be no more than twice the leafcount size of the optimal, and not involve higher level functions than the optimal. The function levels are ordered as elementary < special < hypergeometric.

For details on grading see Nasser's website. With his permission, perhaps some of the documentation there could be incorporated into the Wiki page on testing, along with my discussion above on verification methods.

Albert D. Rich
@AlbertRich

Am I mistaken here when I say that the correct way for e.g. Maple would be to integrate the expression, but import the result back to Mathematica to make the advanced comparison?

refers to validity testing rather than quality grading. Assuming so, it could be argued that validity testing should include the ability of a CAS to differentiate its own antiderivatives back to the integrand.
Also there is a Tower of Babel problem since Maple and Mathematica define some functions (e.g. the elliptic integral functions) differently. So differentiating a Maple antiderivative in Mathematica would not equal the integrand; however differentiating the Maple antiderivative in Maple would equal the integrand.

Nasser M. Abbasi
@nasser1
@AlbertRich hi Albert. I am not following something you said above
"Test if the candidate minus the optimal antiderivative is free of the integration variable or that difference differentiates to zero. (Since it's ok for the candidate and optimal to differ by a piecewise constant which is not free of the integration variable.)" It is about the second part above.
How could candidate and optimal difference not be free of integration variable, yet difference differentiates to zero? For example,. lets say candidate anti-derivative is say 3x, and optimal is say 2x. So the difference is x. So this is not free of the integration constant x. But this difference do not differentiate to zero? I was studying what you wrote above to see if I can implement it but confused about this one. Could you please give an example of the above case? Thanks
Albert D. Rich
@AlbertRich

@nasser1 You wrote

How could candidate and optimal difference not be free of integration variable, yet difference differentiates to zero? ... Could you please give an example of the above case? Thanks

Here's an example: For the optimal antiderivative of 1/(1+x^2) the test suite gives ArcTan[x]. However, some CAS might give - ArcCot[x] which is also a perfectly valid antiderivative, as differentiation shows. The difference of these two antiderivatives is ArcTan[x]+ArcCot[x] which is not free of x; however, it differentiates to 0. As plotting ArcTan[x]+ArcCot[x] shows, it is not a constant; however, it is a piecewise constant; so its derivative equals 0 and therefore -ArcCot[x] is a valid antiderivative of 1/(1+x^2).

Nasser M. Abbasi
@nasser1
@AlbertRich I see. Thanks. Now I understand.
Albert D. Rich
@AlbertRich

@halirutan You wrote on June 24th:

The "Home" page needs a bit more content, but I would like to announce everything this week, as I'm on vacation a week later.

Simultaneously with your announcement, I would like to announce the availability of Rubi on GitHub on sci.math.symbolic, email several power users of Rubi about it, and provide a link to the GitHub site on Rubi's current homepage. Therefore, please let me know before you announce, and what user groups you plan to send it to. Also, I would appreciate your sending me a copy of the text so we can coordinate our descriptions of GitHub Rubi, including its proper name.

Patrick Scheibe
@halirutan
@AlbertRich Hey Albert. I plan 2 things for the announcement. First, I will probably ask a self-answered question on StackExchange along the line "Is there a way to automatically install Rubi" and then I'm explaining in the answer what we have set up in the past weeks. Secondly, I write a small post on my blog explaining the work we did and how to use the GitHub Rubi. This post will automatically appear in the chatroom on stackexchange, I can share it through LinkedIn (I have many connections to people with Mathematica background there) or Twitter.
@nasser1 To which URL on your page should I link from the rulebasedorganisation.org?
Patrick Scheibe
@halirutan
@AlbertRich I have updated the home page with the plot for Nassers current results and included the A/B/C/F rating system. Could you look over it and edit index.md? Maybe you want to add furhter information or sections? I wouldn't know what else to write on this home page.
Nasser M. Abbasi
@nasser1
@halirutan hi Patrick, the link for the main CAS integration tests page is this https://www.12000.org/my_notes/CAS_integration_tests/index.htm . This link will not change. btw, I getting close to adding another about 10,000 integrals which are almost completed. May be by end of this weekend. Sympy is so slooow and that it why it takes so much time. Many integrals in sympy time out, at 3 minutes, so a file with 3,000 integrals takes about 3-4 days to do just for sympy.
Patrick Scheibe
@halirutan
@nasser1 No hurry. I'll update the link soon. I'm currently linking directly to the rubi section. See rulebasedintegration.org
Albert D. Rich
@AlbertRich
@halirutan Looks good with the A/B/C/F rating system explained and the additional systems tested. However, I'm not crazy about the upside-down bar charts, but I guess that's just a matter of personal taste...
Patrick Scheibe
@halirutan
@AlbertRich I had no opinion abou the upside down, so I simply used what Nasser already had.
Albert D. Rich
@AlbertRich
@halirutan I am in the process of making a few edits to the Home page now. I am sure we will think of more information and sections for the Home page as things progress.
@halirutan However, the lack of the ability to download the test suite is serious deficiency. For now, couldn't we just drop in the html from Rubi's current website for downloading the test suite in Mathematica, Maple, Maxima and Axiom syntax?
Patrick Scheibe
@halirutan
@AlbertRich Yes, this is a good idea. I already looked over the tests, but I need some serious thinking how we best present it as a repository. Linking to your page is at the moment a good alternative.
Albert D. Rich
@AlbertRich
@halirutan Great. Let's do it.
Albert D. Rich
@AlbertRich
@halirutan I just tried going to https://RuleBasedIntegration.org/ and got the GitHub error message to use the correct case. Can you make it so https://RuleBasedIntegration.org/ automatically goes to https://rulebasedintegration.org/? The former is a little easier to read, and MS Windows users are not use to case sensitivity.
Patrick Scheibe
@halirutan
@AlbertRich On my machine, it works. I can navigate from the browser and I can ping RuleBasedIntegration.org from commandline. I don't know how I should solve this.
Albert D. Rich
@AlbertRich
@halirutan Now my browser (Google Chrome) is redirecting to the lower case version like yours. Apparently, Chrome sees the lower case version of the GitHub Rubi website in its History, and automatically uses that. I tried to delete my history to test my hypothesis, but to no avail...
But the first time I tried it today, I did get bounced.
Patrick Scheibe
@halirutan
Hmm, that's odd. This is why I tried it from commandline, because there, all the magic that Chrome does is not available.
Albert D. Rich
@AlbertRich
Strange...
Patrick Scheibe
@halirutan
@AlbertRich What really matters is if the DNS can resolve RuleBasedIntegration.org to the correct IP address. You can try https://mxtoolbox.com/DNSLookup.aspx and you'll find that it works.
Albert D. Rich
@AlbertRich
Ok. I guess if I can't reproduce it, it is not a problem...
Albert D. Rich
@AlbertRich
@halirutan Did you get the bcc copy of my email to Jed Stephens relevant to our earlier discussion about parsing Rubi source files to extract Reference, Derivation and Basis documentation to show when displaying integration steps?
What I am thinking is that the Dewey Decimal number of rules can be ascertained from the nested grouping of cells in the source files.
Albert D. Rich
@AlbertRich
@halirutan Over the years developing Rubi, I have dreamed up numerous Rubi-based projects like the above that I don't have the time or talent to implement. Would it be appropriate to list those projects in the Rubi Wiki to encourage others?
Patrick Scheibe
@halirutan
@AlbertRich I did read it now. I have already thought about that and I believe I have a good solution but it would take some time and testing to see if it can be used.
The current status is as follows: I'm programmatically opening all you rule-notebooks and extract the code cells an put them into the zipped .m files for the package.
This all is done in a loop until all your notebooks are processed. Now, let's assume I use a global counter i that is increased with each code cell that I write to the .m files. At the moment of processing, I know which notebook I'm processing and which code-cell I'm processing and I have the global counter i. It is very easy to have a mapping function
reference[i_] := {notebook, codecell}
Patrick Scheibe
@halirutan
The only slightly non-trivial part is, how I can store i in the definition of the current rule without breaking anything. But let's assume we have this solved, then I can extract i from each rule and with the help of reference I know instantly where it is defined. I know the exact cell inside the notebook.
So in the best case, I can create for each used rule in Steps[Int[expr, var]] a button, that automatically opens the right notebook and cell where this rule is defined.
Albert D. Rich
@AlbertRich
@halirutan Instead of storing the source file reference in the definition of the rule, store it in a comment before the rule. Then in the show step rule modification pass, include the reference in the rule.
Patrick Scheibe
@halirutan
@AlbertRich When you use modifyRule, you only have the DownValues. Comments were already stripped and you cannot access them. Already thought about a simple solution like this.
When loading a .m rule file with Get all comments are ignored and you can never access them again.
Albert D. Rich
@AlbertRich
Instead of going to the DownValues, you parse the .m file reading the comments and the rules, inserting the step info and define the rule right then. If the person is NOT modifying rules to show steps, the rule should be clean.
This would eliminate the ModifyRule pass.
Patrick Scheibe
@halirutan
@AlbertRich Mathematica might reorder some of the Int rules, so the order in which they are loaded might not be the order in which they finally appear in DownValues.
Albert D. Rich
@AlbertRich

@halirutan Forget assuming anything about DownValues. I propose:

1. Building .m files for the Rubi package like you currently do but with comments giving Reference, Derivation, Basis, and the rule's source file location. E.g. the comment "Derivation: Integration by parts"
2. If loading without step information, load the .m files as Mathematica normally does. Thus each rule would be free of any step info.
3. If loading with step information, parse the .m files yourself extracting the comments and rule definition. Then define the rule with all this step info. Thus each rule would only have to be defined once, and there would be no second ModifyRule pass. Yea!

Obviously this is a long term project, I am not suggesting you do now.