wiki

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].

§ 01

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.

§ 02

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.

§ 03

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 .

§ 04

The algorithm

the towerℚ(x, log x, e^(x²))ℚ(x, log x)ℚ(x)ℚ↑ adjoin t₂ = e^(x²)↑ adjoin t₁ = log x↑ adjoin xintegrand f ∈ K(t)rational function of the top variable tHermite reductionremoves repeated factors in tRothstein–Tragerlog coefficients must be constantspolynomial part in tintegrate over K, or solve a Risch DEtop t₂recurseno solution in K: not elementary
The integrand is written as a rational function of the top variable of a tower. Hermite reduction and the Rothstein–Trager resultant handle its fractional part; the polynomial part leads to integration problems, or a Risch differential equation, one level down.

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.

§ 05

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 + 1
that 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 in
let gn = quo gn h and ge = quo ge h in
if is_zero gn then Some ([||], one)
else begin
let t = gcd ge (deriv ge) in
let n = deg gn - deg ge - deg f + deg t in
if n < 0 then None
else 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))) in
let cols = Array.init (n + 1) (fun i -> op (pow x i)) in
match solve_linear cols (mul gn (mul t t)) with
| None -> None
| Some ys ->
let yn = normalize ys in
let g = gcd yn t in
Some (quo yn g, quo t g)
end
end

Integrals of x^k e^(x²) and others.

open Qpoly

Running it.

x^k e^(x^2):
integral of e^(x^2) is not elementary
integral of x e^(x^2) = (1/2) e^(x^2)
integral of x^2 e^(x^2) is not elementary
integral of x^3 e^(x^2) = ((1/2)x^2 - 1/2) e^(x^2)
integral of x^4 e^(x^2) is not elementary
integral 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 elementary
integral 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 elementary
integral 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 elementary
integral 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.

§ 06

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.

§ 07

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.

§ 08

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

further reading

  1. [1]R. H. Risch, “The problem of integration in finite terms”, Transactions of the AMS 139 (1969).
  2. [2]M. Rosenlicht, “Integration in finite terms”, American Mathematical Monthly 79 (1972).
  3. [3]B. M. Trager, Integration of Algebraic Functions, PhD thesis, MIT (1984).
  4. [4]M. Bronstein, Symbolic Integration I: Transcendental Functions, Springer (2nd ed., 2005).
  5. [5]R. H. Risch, “The solution of the problem of integration in finite terms”, Bulletin of the AMS 76 (1970).
  6. [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. [7]J. F. Ritt, Integration in Finite Terms: Liouville’s Theory of Elementary Methods, Columbia University Press (1948).
  8. [8]M. Rosenlicht, “Liouville’s theorem on functions with elementary integrals”, Pacific Journal of Mathematics 24 (1968).
  9. [9]D. Richardson, “Some undecidable problems involving elementary functions of a real variable”, Journal of Symbolic Logic 33 (1968).
  10. [10]J. H. Davenport, On the Integration of Algebraic Functions, Lecture Notes in Computer Science 102, Springer (1981).
  11. [11]M. Bronstein, “Integration of elementary functions”, Journal of Symbolic Computation 9 (1990).
  12. [12]K. O. Geddes, S. R. Czapor, G. Labahn, Algorithms for Computer Algebra, ch. 12, Kluwer (1992).

last updated