TITLE: How does Mathematica do symbolic integration?
QUESTION [30 upvotes]: I suppose there was at least once in our lifetime the point where we resorted  to mathematica for help with an integral.-Unless you chose not to have the pleasure of using the continuum in your mathematical field of research.
I am wondering however whether behind a computer algebra system like mathematica that does symbolic computations there is some high-level idea how it would approach an awkward integral and try to find an anti-derivative?-I focus here on the integration part, since I think I would understand how to implement symbolic differentiation, at least conceptually, but integration seems to be rather mysterious to me.

REPLY [17 votes]: People usually mention the Risch algorithm first, as other answers have.
Another approach, which is surprisingly successful, is to do what you or I would when solving integrals: look for patterns for which we have known-to-be-useful transformations.  RUBI (which is usable from Mathematica as well as from other systems) does precisely this. According to its benchmarks, it works better than Mathematica's built-in Integrate.
This is why I was not surprised to see that machine-learning methods can also work very well. While I did not read the paper, I imagine that the inherent unpredictability/unreliability of such methods is not an issue: the result can always be verified by differentiation.
(Note: All I wrote above applies to indefinite integration. Definite integration is a different animal, and much harder problem, mostly because it is necessary to verify that the function behaves nicely in the middle of the integration interval.)