## How is Integrate Implemented?

0

At the end of this 90 minute lecture by Stephen Wolfram on the history of the development of Mathematica, Wolfram takes questions from the audience. One of those questions asked how the Integrate[] function chooses the method to compute the integral, whether substitution, integration-by-parts, and so on.

Stephen Wolfram answered "None of those". He then went on to briefly mention a higher level method and I did not quite understand the name of the method nor the way this does Integration. But, it was an all too brief answer.

Does anyone know what the details are on the methods employed by Mathematica to do this integration operation. Wolfram also mentioned that the methods displayed in the "step-by-step" details is a "complete fake" (his words), invented purely for pedagogical reasons. Wolfram also mentioned that the problem of converting the answer to the Integrate function into something meaningful and useful to the user was the bigger part of the problem.

Question was closed 2016-07-04T18:09:45.267

A related question. – J. M.'s ennui – 2016-07-04T17:17:48.383

– Szabolcs – 2016-07-04T17:27:54.047

Thanks for the links -- I did search for a preexisting answer but did not find one. Searched on "Integrate methods" and a few other things. I did not use the term "implementation" though. – K7PEH – 2016-07-04T18:30:23.823

1

The short answer is that most functions you know are special cases of the Meijer $G$ and generalized hypergeometric $_pF_q$ functions, which generally integrate to some other variant of themselves. Typically if you start with a simple integrand the corresponding $G$ / $_pF_q$ function will have a lot of structure, and the integration will respect most of that structure, which means there's a high chance that you're still on a pretty special case of the $G$ / $_pF_q$ function that you can represent using simpler functions. The challenge is finding that representation.

– Emilio Pisanty – 2016-07-05T00:52:39.553

You also probably mean "complete fake" instead of "total crock" if you want to attribute an exact quote to Wolfram. – Emilio Pisanty – 2016-07-05T00:56:16.413

@EmilioPisanty OK. I had watched the video where Wolfram is giving the history of Mathematica and I had thought he said "total crock". – K7PEH – 2016-07-05T01:59:15.033

2

I am definitely not an expert in this field, but I believe that some part of Integrate uses Risch's algorithm. And that, to my understanding, is also the reason why it's not easy to show the "steps" Integrate takes to solve an integral. The intermediate "steps" are not meaningful to most humans. Some more references are in the page "Some Notes On Internal Implementation" in the "Differentiation and Integration" section.

@J.M. thanks for the edit. I should have done that myself. – user21 – 2016-07-04T17:21:47.010

I'd have added a link to the part in the docs where Risch is mentioned, but I hate browsing the docs on a smartphone… :) – J. M.'s ennui – 2016-07-04T17:24:04.960

@J.M. done that. – user21 – 2016-07-04T17:30:41.867

Thanks for the link to the Risch Algorithm. I spent some time just now looking at that. I think I will end my query though after I read where it takes about 100 pages to describe the algorithm. I am curious but not that curious to wade through 100 pages. I see though that it was rather recent, 1969, my senior year as an undergrad. – K7PEH – 2016-07-04T18:33:41.777

@K7, a probably gentler introduction would be the book by Geddes/Czapor/Labahn, if you're up for it. Or the one by Bronstein. – J. M.'s ennui – 2016-07-04T18:46:00.983