AI Symbolic Integration
AI Symbolic Integration
The Freshman Calculus Problem. Find the Freshman Calc Æ AI: James Slagle’s
flaws. approach
1. Humans are intelligent • AND-OR trees for evaluation of difficulty of
2. MIT freshman are especially intelligent humans. a path (do we abandon this route or plow on?)
3. Freshman study integral calculus (this is in 1960’s
before Advanced Placement).
4. Therefore solving freshman calculus problems or or
requires intelligence.
5. If a computer can solve freshman calculus problems, and
then it is intelligent (An example of Artificial
Intelligence).
6. To solve these problems, imitate freshman students.
7. Future work: do the rest of math, and the rest of • Game playing: could be any complex task.
AI.
Richard Fateman CS 282 Lecture 14 3 Richard Fateman CS 282 Lecture 14 4
1
Partial fractions “trivialized” an example of the general cubic...
• If the denominator R= s3*x3+s2*x2+s1*x+s0, • For the cubic, each ci looks something like this
then the each of the roots ai look like this:
2
Rothstein (etal), find the ci easier Squarefree isn’t a problem
• Let B(x) be square free and of degree >= A(x), • Let the problem be ∫A(x)/B(x)n with deg(A)<=deg(B).
• Since B itself is square free, its GCD with B’=dB/dx is
• then ∫ (A/B)dx = ci log(vi) 1. Thus we can compute c,e such that c*B+e*B’=1.
• where ci, are the distinct roots of the • Now multiply through by A to get cAB+eB’A=A, and
polynomial R(c)=Resultant(x,A(x)-cB’(x),B(x)) substitute in the original ∫A(x)/B(x)n to get
∫(cAB+eB’A)/B(x)n . Now dividing through we get
and vi=gcd(A(x)-ciB’(x),B(x)) for i = 1,...n.
∫ cA/Bn-1 + ∫ eA* (B’/Bn) where the second term can be
integrated by parts to lower the power of Bn in the
• We need Square-free computation and denominator.
(reminder: ∫ u dv = uv-∫ v du. Let u =eA, dv=B’/Bn,
Resultant wrt x
v=1/((1-n)Bn-1), du=(eA)’, so ∫ v du comes out as
<something>/Bn-1+ ∫ <something>/Bn-1 . Iterate until Bn =
B1 .)
Richard Fateman CS 282 Lecture 14 13 Richard Fateman CS 282 Lecture 14 14
• Well, actually it is something we’d prefer not • Liouville [1809-1882] During the period (1833-1841)
presented a theory of integration; proved elliptic
to do since it takes a while, but we have integrals cannot have elementary expressions.
algorithms for it. • Various other writers advanced the subject in late
1800’s
• J. Ritt (1948) Integration in Finite Terms Columbia
• Conclusion: we can do rational function Univ. Press
integration pretty well. But it took us into the • M. Rosenlicht (AMM. 1972) Integration in Finite
mid-1980s to do it right. Terms
3
Formally, start with a field F and a
Also
derivation map
Extensions of the Risch algorithm The Risch Algorithm: two steps back.
• Allow certain functions beyond log, exp such • There is a fallacy in claiming the Risch "algorithm" is
an algorithm at all: it depends, for solution of
that the form of the integral still holds. For subproblems, on heuristics to tell if certain
example, erf(x) = (2/π)∫0x exp(-t2)dt has the expressions are equivalent to zero.
appropriate structure. • We have gone over Richardson’s arguments to show
that the zero-equivalence problem over a class of
expressions much smaller than that of interest for
integration is recursively unsolvable.
• But that is not the problem with most
implementations of the Risch algorithm. They mostly
have not been programmed completely, because, even
assuming you can solve the zero-equivalence problem,
the procedure is hard to program.
Richard Fateman CS 282 Lecture 14 23 Richard Fateman CS 282 Lecture 14 24
4
The Risch Algorithm: answers are not The Risch Algorithm: answering wrong
ncessarily what you expect problem
• It is not nearly as useful as you might think, because • Also, most people are interested in definite,
it returns algebraic antiderivatives whose validity not indefinite integrals, at least once they've
may be on a set of measure zero. Work by D. finished with Freshman calculus.
Jeffrey A. Rich (among others) on removing
• And in cases where approximate solutions are
gratuitous discontinuities, is helpful.
easily obtained for the corresponding
• The Risch algorithm may also, in the vast majority of definite integral, the Risch algorithm may
problems, simply say, after an impressive pause, grind on for a long while and then say there
nope. can't do it. There is no reasonable complexity
is no closed form. Or if there is a closed
analysis for the process, which is probably why
form, if it is to be ultimately evaluated
certain authors ignore it.
numerically, the closed form may be less
useful than the quadrature formula!
Richard Fateman CS 282 Lecture 14 25 Richard Fateman CS 282 Lecture 14 26
5
Losing numerically Losing symbolically
• Try integrating x*sin(x) between 0 and 5000. • Sometimes the answer is possible but ugly. Consider
∫1/(z64+1) dz integrated to
• Numerically, it’s tough.
• Symbolically it is –5000 cos (5000)+sin(5000)