Opened 6 years ago

Last modified 6 years ago

#21667 new task

Redundant integrate() & integral() in and

Reported by: mafra Owned by:
Priority: major Milestone: sage-7.4
Component: symbolics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


The motivation for this ticket is that the documentation for


didn't mention very explicitly the different algorithms (it omits 'fricas', for example). The documentation that appears above is from the file misc/

However, grep'ing around I found out that there is a much better documentation in the integral() definition in sage/symbolic/integration/ but it simply never appears upon eitheir integral? or integrate?

Looking more closely, having the integrate() functions in both files seems redundant. One does integrate = integral and the other does integral = integrate at the end of their definitions.

My first reaction was to kill the definition from misc/ but I get a compilation error related to the docbuild(!) which I could not understand where it is coming from (yet).

So before going on with killing integral() from misc/ (and obtaining the much better documentation from as a result) I would like to ask more experienced Sage developers what they think about this. Is this unification recommended or is it a stupid thing to try?

But again, the underlying motivation was about the poorer documentation from

Attachments (1) (5.7 KB) - added by mafra 6 years ago.
Remove redundant definition of integral from

Download all attachments as: .zip

Change History (2)

comment:1 Changed 6 years ago by mafra

I have prepared a preliminary patch (not to be applied) just to give an idea about what I meant above.

With the patch applied I get the (more helpful) documentation from upon integral?. Of course I could have just moved the text from to, but I thought that a bit of cleanup could be interesting.

So this patch also implies that integrate is no longer valid, and one should use integral only. That of course will break many tests (which could be fixed by sed 's/integrate/integral/'), but the point I want to raise is whether it is desirable to have two names for the same thing (for what it's worth, Mathematica admits only Integrate). IMHO, I think that Sage should allow only one name (my preferred choice would be integrate).

Of course, this patch is very preliminary. For example, I used the lazy_import() in because I didn't know how to do it properly. This should be fixed I guess.

In any case, I realize that deprecating integral is a major decision. But the current situation with duplicated functions is not optimal (again imho). After my patch here I tested many integrals from examples in the sage source and they all worked the same way (provided integrate -> integral). So I guess that proves that there is some redundancy in the current code, and the documentation suffers from it.

Changed 6 years ago by mafra

Remove redundant definition of integral from

Note: See TracTickets for help on using tickets.