Risch algorithm
The Risch algorithm decides whether an elementary function has an elementary antiderivative and computes one when it does[1][5]. An elementary function is built from and constants by arithmetic, , and algebraic operations; the question is whether its integral can be expressed in the same way. Liouville showed in the 1830s that an elementary antiderivative, if it exists, has a restricted form[6], and Risch turned this into an algorithm in 1968–1970 by working in a tower of field extensions and reducing each step to problems in the field below[1]. It proves, for example, that , and are not elementary. Its rational-function steps are Hermite reduction and the Rothstein–Trager resultant; its transcendental case is fully algorithmic and is presented in Bronstein's book[4], while the algebraic case was completed by Davenport, Trager and Bronstein[3][10][11].
Example
The first integral can be found by substitution and parts. For the second, no finite search over candidate formulas could show that none exists; the Risch algorithm proves it by showing that a certain differential equation has no rational solution.
Differential fields
The algorithm works algebraically, in differential fields[2][4]. A derivation on a field is an additive map satisfying ; write . The constants are the elements with . The field with is the base case. An extension is elementary over if is
for some , with no new constants. An elementary function is an element of a tower of such extensions starting from or . The derivative of any element is again in the tower, so differentiation is closed-form; the question is only about integration.
Liouville's theorem
If in a differential field has an elementary antiderivative, then it has one of the form[6][8]
with the algebraic over the constants of . An antiderivative can introduce new logarithms with constant coefficients and nothing else: no new exponentials, and no new algebraic functions beyond constants. Rosenlicht gave the purely algebraic proof used today[8][2]. The theorem turns the question of whether an antiderivative exists into the question of whether certain equations have solutions in .
The algorithm
The algorithm writes in a tower , with the last logarithm or exponential adjoined, and integrates it as a rational function of whose coefficients lie in . The derivation extends to polynomials in through , and the rational function algorithms carry over[4]:
Hermite reduction in removes the repeated factors of the denominator. For the remaining fraction with square-free, the coefficients of the logarithms must be the roots of the Rothstein–Trager resultant
and by Liouville's theorem they must be constants. If some root is not constant, there is no elementary antiderivative; otherwise the logarithmic part is . The polynomial part in is handled coefficient by coefficient, which leads to problems in , solved recursively.
Logarithmic extensions
For , take and , so the integrand is with , and . Then has the constant root , and the integral is . For , and , whose root is not constant, so the logarithmic integral is not elementary.
A polynomial in a logarithm integrates to a polynomial of degree at most one higher, and comparing coefficients from the top gives a sequence of integration problems in , each of which may itself introduce the logarithm with a constant coefficient[4][12].
Exponential extensions
If , then , so the term of the polynomial part, for , has an integral exactly when
has a solution . This is the Risch differential equation. The term is integrated in recursively.
The Risch differential equation
Take . With , Liouville's theorem forces any elementary antiderivative to be plus a constant, for some . Differentiating,
so must hold. If had a pole of order at some point, would have one of order there that no other term can cancel, so is a polynomial. A nonzero polynomial of degree makes a polynomial of degree , never the constant 1, and gives 0. So there is no solution, and has no elementary antiderivative. With right-hand side instead of 1 the equation has the solution , which is .
The same two arguments decide over whenever is a nonzero polynomial. The pole argument bounds the denominator of by for the denominator of , and comparing degrees at infinity bounds its numerator; the numerator's coefficients then satisfy a linear system[4]. In general and lie in a tower, and bounding the denominator and degree is the hard part of the transcendental case, including cancellation cases where the leading terms of and can cancel[4].
The Risch differential equation over ℚ(x) for a polynomial f, which decides whether ∫ g·e^q is elementary for rational g and polynomial q.
(* y' + f y = gn/ge. A pole of y of order k gives y' a pole of order k + 1that f y cannot cancel, so the denominator of y divides gcd(ge, ge'),and comparing degrees at infinity bounds its numerator. *)let solve_rde (f : t) (gn : t) (ge : t) =let h = gcd gn ge inlet gn = quo gn h and ge = quo ge h inif is_zero gn then Some ([||], one)else beginlet t = gcd ge (deriv ge) inlet n = deg gn - deg ge - deg f + deg t inif n < 0 then Noneelse begin(* multiply through by t^2 ge: (Y' t - Y t') ge + f Y t ge = gn t^2 *)let op yv = add (mul (sub (mul (deriv yv) t) (mul yv (deriv t))) ge) (mul f (mul yv (mul t ge))) inlet cols = Array.init (n + 1) (fun i -> op (pow x i)) inmatch solve_linear cols (mul gn (mul t t)) with| None -> None| Some ys ->let yn = normalize ys inlet g = gcd yn t inSome (quo yn g, quo t g)endend
Integrals of x^k e^(x²) and others.
open Qpoly
Running it.
x^k e^(x^2):integral of e^(x^2) is not elementaryintegral of x e^(x^2) = (1/2) e^(x^2)integral of x^2 e^(x^2) is not elementaryintegral of x^3 e^(x^2) = ((1/2)x^2 - 1/2) e^(x^2)integral of x^4 e^(x^2) is not elementaryintegral of x^5 e^(x^2) = ((1/2)x^4 - x^2 + 1) e^(x^2)other exponents:integral of (2x^2 + 1) e^(x^2) = x e^(x^2)integral of x^3 e^(x) = (x^3 - 3x^2 + 6x - 6) e^(x)integral of e^(x^3) is not elementaryintegral of (3x^3 + 1) e^(x^3) = x e^(x^3)
For the degree argument settles everything: needs , and the coefficients of alternate in parity, so a solution exists exactly when is odd.
Rational multiples of exponentials, including the exponential integral.
open Qpoly
Running it.
integral of (1/x) e^(x) is not elementaryintegral of ((x - 1)/x^2) e^(x) = (1/x) e^(x)integral of (x/(x^2 + 2x + 1)) e^(x) = (1/(x + 1)) e^(x)integral of (1/x^2) e^(x) is not elementaryintegral of ((2x^2 - 1)/x^2) e^(x^2) = (1/x) e^(x^2)
The first and fourth are the exponential integral and : the equation would need a pole of order 0 in , so is a polynomial and is too.
The algebraic case and constants
When the tower contains algebraic extensions, such as , the Liouville form still holds but the logarithmic part may require the arguments to be algebraic functions, and deciding whether they exist involves the arithmetic of divisors on an algebraic curve, including whether a divisor has finite order. Risch sketched this case[5]; Davenport gave an algorithm for purely algebraic integrands[10], Trager a complete treatment of them[3], and Bronstein extended it to mixed towers[11]. The algebraic case is rarely implemented in full.
Every step needs to decide whether a constant is zero: whether has constant roots, whether a leading coefficient vanishes, whether a new extension adds new constants. For constants built from , and elementary functions this is not known to be decidable, and Richardson showed that related problems for elementary functions of a real variable are undecidable[9]. The Risch algorithm is therefore a decision procedure relative to a constant field in which equality can be decided, such as or a number field.
Implementations
Computer algebra systems combine parts of the algorithm with heuristics, pattern matching and table lookup[12]. Bronstein implemented large parts of the transcendental and algebraic cases in the Axiom system, whose integrator lives on in FriCAS. SymPy's risch_integrate implements the transcendental case for towers of exponentials and logarithms and can return a proof of non-elementarity as an unevaluated NonElementaryIntegral. The rational-function steps are implemented everywhere.
History
Liouville developed the theory of integration in finite terms between 1833 and 1841, proving among other results that and are not elementary[6]. Ritt's 1948 book presented Liouville's theory in modern form[7], and Rosenlicht gave the algebraic proof of Liouville's theorem in 1968[8]. Risch published the decision procedure for the transcendental case in 1969 and announced the algebraic case in 1970[1][5]. The rational steps were improved by Rothstein and Trager's resultant in 1976 and Lazard and Rioboo's subresultant method in 1990. Davenport in 1981 and Trager in 1984 made the algebraic case algorithmic[10][3], and Bronstein's work in the 1990s, collected in his book, gave the transcendental case its present form[4][11].
see also
- Hermite reductionHermite reduction is the step of symbolic integration that splits the integral of a rational function A/D into a rational function and an integral whose denominator is square-free, using only gcds and the extended Euclidean algorithm, with no factorization of D. The rational part of the antiderivative comes entirely from the repeated factors of D, and each reduction step lowers their multiplicity by one. What remains integrates to a sum of logarithms, whose coefficients are the roots of the Rothstein–Trager resultant. Together the two steps integrate any rational function over a field of characteristic zero exactly, introducing algebraic numbers only where the answer needs them.
- Partial fractionsA partial fraction decomposition rewrites a rational function n/d as a polynomial plus a sum of simpler fractions, one family for each power of an irreducible factor of the denominator: n/d = q + Σ c_ij / f_i^j with deg c_ij < deg f_i. It exists and is unique once the factorization of d is fixed. Splitting across coprime factors needs only the extended Euclidean algorithm, and the terms for a power f^e are the digits of an f-adic expansion, so computing it costs no more than the factorization of the denominator; with a square-free factorization, no factoring is needed at all. It is the basis of the integration of rational functions and of closed forms for rational generating functions.
- Gruntz algorithmThe Gruntz algorithm computes limits of exp-log functions, those built from x and constants by arithmetic, exp and log, as x tends to infinity. It finds the set of most rapidly varying subexpressions, rewrites the function as a power series in one of them, and reads the limit off the leading term, recursing when the leading coefficient is itself a function of x. It succeeds where expansions in powers of 1/x fail, because exponentially small terms are invisible to them, and it is the limit algorithm of SymPy and Maple. Like the Risch algorithm, it is complete relative to an oracle that decides whether an expression is identically zero.
- Canonical formIn computer algebra, a canonical form is a representation in which mathematically equal expressions are written identically, so that equality becomes a syntactic comparison and zero-testing a look at the representation. A normal form is the weaker requirement that expressions equal to zero are represented by 0. Expanded polynomials with sorted terms, reduced rational functions and remainders modulo a Gröbner basis are canonical; for expressions with exponentials, logarithms and absolute values, Richardson proved in 1968 that zero-equivalence is undecidable, so no canonical form can exist. Where no canonical form is practical, randomized evaluation, justified by the Schwartz–Zippel lemma, tests identities with high confidence.
- Square-free decompositionThe square-free decomposition of a polynomial writes it as f = f_1 f_2^2 f_3^3 ..., where the f_i are square-free and pairwise coprime, so f_i collects the irreducible factors of multiplicity i. It needs only greatest common divisors with the derivative, not factorization, because gcd(f, f') contains every repeated factor with its multiplicity reduced by one. Yun's algorithm computes it at the cost of about one gcd. In characteristic p a p-th power has zero derivative, and the algorithm must take p-th roots.
- KernelIn computer algebra, a kernel is a maximal subexpression that is not built from sums, products and integer powers, such as sin(x), exp(x + 1) or √x, which the system treats as an opaque variable so that polynomial and rational-function algorithms can operate on the expression around it. Expanding (sin x + 1)² treats sin x as a variable k and returns k² + 2k + 1 with k replaced by sin x. Equal kernels must be recognized as the same variable, which requires their arguments to be in canonical form. Kernels are not algebraically independent in general, as exp(2x) = exp(x)², and full simplification requires rewriting them into an independent set, which the structure theorems of Risch and Rosenlicht describe for elementary functions.
further reading
- [1]R. H. Risch, “The problem of integration in finite terms”, Transactions of the AMS 139 (1969).
- [2]M. Rosenlicht, “Integration in finite terms”, American Mathematical Monthly 79 (1972).
- [3]B. M. Trager, Integration of Algebraic Functions, PhD thesis, MIT (1984).
- [4]M. Bronstein, Symbolic Integration I: Transcendental Functions, Springer (2nd ed., 2005).
- [5]R. H. Risch, “The solution of the problem of integration in finite terms”, Bulletin of the AMS 76 (1970).
- [6]J. Liouville, “Mémoire sur l’intégration d’une classe de fonctions transcendantes”, Journal für die reine und angewandte Mathematik 13 (1835).
- [7]J. F. Ritt, Integration in Finite Terms: Liouville’s Theory of Elementary Methods, Columbia University Press (1948).
- [8]M. Rosenlicht, “Liouville’s theorem on functions with elementary integrals”, Pacific Journal of Mathematics 24 (1968).
- [9]D. Richardson, “Some undecidable problems involving elementary functions of a real variable”, Journal of Symbolic Logic 33 (1968).
- [10]J. H. Davenport, On the Integration of Algebraic Functions, Lecture Notes in Computer Science 102, Springer (1981).
- [11]M. Bronstein, “Integration of elementary functions”, Journal of Symbolic Computation 9 (1990).
- [12]K. O. Geddes, S. R. Czapor, G. Labahn, Algorithms for Computer Algebra, ch. 12, Kluwer (1992).
last updated