Hermite reduction
Hermite reduction computes the rational part of the integral of a rational function[1][4]. For over a field of characteristic zero, the antiderivative of is a rational function plus a sum of constant multiples of logarithms, and the rational function comes entirely from the repeated factors of . Hermite's method extracts it using the square-free decomposition of and the extended Euclidean algorithm, never factoring into irreducibles, and leaves an integral with a square-free denominator. The logarithmic part of that remainder is then given by the Rothstein–Trager resultant[5][6]. The same reduction, applied in the top variable of a tower of extensions, is the first step of the Risch algorithm. Ostrogradsky found an equivalent method in 1845[2] and Hermite published his in 1872[1].
Example
The denominator has a repeated factor . Hermite reduction produces the rational term and leaves an integrand whose denominator is square-free. The remainder integrates to logarithms over : .
The reduction step
Divide first, so that ; the polynomial quotient integrates term by term. Write with square-free, and . Since is square-free, , so and the extended Euclidean algorithm gives and with[1][4]
and then
To check it, differentiate the first term:
Adding the integrand on the right, the terms cancel and what is left is . Each step lowers the power of by one. Taking from the square-free decomposition and repeating ends with a square-free denominator.
For : , , , . Solving gives and , and the step produces plus the integral of , as above.
The split it computes
The result of the reduction is determined in advance. With and , there are unique polynomials and with and such that[2][3]
In terms of the square-free decomposition, and . Uniqueness holds because the integral of a fraction with square-free denominator has no rational part: a rational function whose derivative had only simple poles would have to be a polynomial.
Ostrogradsky and Horowitz compute and directly[2][3]. Differentiating the identity and clearing denominators gives
which is linear in the unknown coefficients of and , a system of equations in unknowns. Solving it by Gaussian elimination costs for , which is more than Hermite's sequence of Euclidean steps[4][8].
Algorithm
Hermite's original method needs the square-free decomposition and a partial fraction split across its factors. A variant attributed by Bronstein to Mack reduces all the factors of the highest remaining multiplicity at once, using only and and a gcd per step, and each Diophantine equation it solves has size proportional to the part being reduced[4]. Writing and , each round takes and , the product of the factors of highest remaining multiplicity, solves
adds to the rational part, replaces by and by , and stops when is constant. The remaining integrand is with square-free.
Hermite reduction in this form, over the rationals.
(* Hermite reduction, in Mack's linear form (Bronstein, Algorithm 2.2.2):returns the polynomial part q, the rational part g and a fraction a/dswith integral(A/D) = integral(q) + g + integral(a/ds), where ds issquare-free and deg a < deg ds. g is returned as numerator anddenominator. *)let hermite (a : t) (d : t) =let q, a = divmod a d inlet dm = gcd d (deriv d) inlet ds = quo d dm inlet rec go a dm (gn, gd) =if deg dm <= 0 then ((gn, gd), a)else beginlet dm2 = gcd dm (deriv dm) inlet dms = quo dm dm2 in(* solve b (-ds dm' / dm) + c dms = a *)let b, c = diophantine (neg (quo (mul ds (deriv dm)) dm)) dms a inlet a' = sub c (quo (mul (deriv b) ds) dms) in(* g <- g + b / dm *)let gn' = add (mul gn dm) (mul b gd) and gd' = mul gd dm inlet h = gcd gn' gd' ingo a' dm2 (quo gn' h, quo gd' h)end inlet g, a = go a dm ([||], one) in(q, g, (a, ds))let rec qpow c n = if n = 0 then Q.one else Q.mul c (qpow c (n - 1))
Two reductions, each checked by differentiating the rational part.
open Qpoly
Running it.
1 / (x^2 + 1)^2rational part ((1/2)x)/(x^2 + 1)remaining integral of (1/2)/(x^2 + 1)derivative checks: true(x^4 + 1) / ((x + 1)^3 (x^2 + 1)^2)rational part (-(1/4)x^3 - (1/2)x^2 + (1/4)x)/(x^4 + 2x^3 + 2x^2 + 2x + 1)remaining integral of (-(1/4)x + 3/4)/(x^3 + x^2 + x + 1)derivative checks: true
Both agree with SymPy's ratint_ratpart. The second example has two repeated factors, of multiplicities 3 and 2; the remaining denominator is their product.
No factorization needed
The reduction uses only arithmetic, gcds and the extended Euclidean algorithm in , so its output has coefficients in even when the factors of are irreducible over or have no roots in it[4]. For a denominator like , whose roots are the roots of an irreducible cubic, the rational part is computed without ever naming them.
The rational part of 1/(x³ + x + 1)³, then the Rothstein–Trager resultant of the remainder.
open Qpoly
Running it.
D = x^9 + 3x^7 + 3x^6 + 3x^5 + 6x^4 + 4x^3 + 3x^2 + 3x + 1rational part (-(243/961)x^5 + (357/1922)x^4 - (405/961)x^3 - (315/1922)x^2 + (156/961)x - 224/961)/(x^6 + 2x^4 + 2x^3 + x^2 + 2x + 1)remaining integral of (-(243/961)x + 357/961)/(x^3 + x + 1)Rothstein-Trager R(z) = z^3 - (1104057/28629151)z - 84213/28629151R has no rational roots: the logarithms need algebraic numbers
The rational part agrees with SymPy. The logarithmic part here needs the three roots of a cubic in , which are algebraic numbers of degree 3; the answer can be written as a sum over those roots without computing them.
The logarithmic part
After reduction the integrand has square-free and . Over the algebraic closure it equals with residues at the roots of , so its integral is . Grouping the roots by residue gives the Rothstein–Trager theorem[5][6]: with
the distinct roots of are exactly the distinct residues, and
The logarithms are taken of the smallest possible arguments: the algebraic extension of needed is the one generated by the roots of , which is often much smaller than the splitting field of . Lazard and Rioboo, and independently Trager, showed that the gcds can be read off the subresultant sequence of and , avoiding computation with algebraic numbers entirely[7].
A full rational integrator: polynomial part, Hermite reduction and Rothstein–Trager, for cases where the residues are rational.
open Qpoly
Running it.
integral of (x^6 + 2x^4 - x^3 + 1)/(x^5 - 2x^4 + x^3)= (1/2)x^2 + 2x + (-5x^2 + (3/2)x + 1/2)/(x^3 - x^2) + 2 log(x - 1) + 3 log(x)integral of (x^2 + 3)/(x^4 + 4x^3 + 3x^2 - 4x - 4)= (-7/3)/(x + 2) - 2 log(x + 1) + 2/9 log(x - 1) + 16/9 log(x + 2)
Both answers agree with SymPy's ratint.
Complexity
For a denominator of degree , Hermite reduction in the form above uses operations in with classical arithmetic[4][8]. Over the coefficients of intermediate results grow, and Gerhard gave modular algorithms for square-free factorization and Hermite integration with nearly optimal running time in both the degree and the coefficient size[9].
History
Ostrogradsky described the split into and a square-free remainder in 1845, computing and from a linear system[2]. Hermite gave the reduction by Euclidean steps in 1872[1]. Both methods returned in computer algebra: Horowitz analyzed the cost of both approaches for rational function integration in 1971[3], and Rothstein and Trager independently found the resultant that gives the logarithmic part without factoring in 1976[5][6]. Lazard and Rioboo gave the subresultant method for the logarithmic arguments in 1990[7]. Bronstein's book presents the modern forms of all these algorithms and their generalization to transcendental extensions, where they form the rational-function steps of the Risch algorithm[4].
see also
- 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.
- 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.
- Risch algorithmThe Risch algorithm is a decision procedure for integration in finite terms: given an elementary function, it either finds an elementary antiderivative or proves that none exists. It rests on Liouville's theorem, which says that an elementary antiderivative, if one exists, is a function of the same field plus constant multiples of logarithms. The algorithm writes the integrand in a tower of logarithmic, exponential and algebraic extensions of the rational functions and works down it, using Hermite reduction, the Rothstein–Trager resultant and the Risch differential equation y′ + fy = g. Its transcendental case is completely algorithmic; its algebraic case is much harder; and both are decision procedures only relative to deciding whether a constant is zero.
- Subresultant PRSThe subresultant polynomial remainder sequence is a way of running Euclid's algorithm on polynomials over the integers, or any integral domain, without fractions and without the exponential coefficient growth of plain pseudo-division. After each pseudo-division, the remainder is divided by a factor computed from the previous leading coefficients and degree differences; the division is always exact, and the remainders obtained are the subresultants of the input, determinants of submatrices of the Sylvester matrix, whose size grows only linearly with the degree. The sequence yields the gcd, up to a constant, and the resultant. It was introduced by Collins in 1967 and developed by Brown and Traub.
- 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.
further reading
- [1]C. Hermite, “Sur l’intégration des fractions rationnelles”, Nouvelles Annales de Mathématiques, 2e série, 11 (1872).
- [2]M. V. Ostrogradsky, “De l’intégration des fractions rationnelles”, Bulletin de la classe physico-mathématique de l’Académie Impériale des Sciences de Saint-Pétersbourg 4 (1845).
- [3]E. Horowitz, “Algorithms for partial fraction decomposition and rational function integration”, SYMSAM (1971).
- [4]M. Bronstein, Symbolic Integration I: Transcendental Functions, ch. 2, Springer (2nd ed., 2005).
- [5]B. M. Trager, “Algebraic factoring and rational function integration”, SYMSAC (1976).
- [6]M. Rothstein, Aspects of Symbolic Integration and Simplification of Exponential and Primitive Functions, PhD thesis, University of Wisconsin–Madison (1976).
- [7]D. Lazard, R. Rioboo, “Integration of rational functions: rational computation of the logarithmic part”, Journal of Symbolic Computation 9 (1990).
- [8]J. von zur Gathen, J. Gerhard, Modern Computer Algebra, §22, Cambridge University Press (3rd ed., 2013).
- [9]J. Gerhard, “Fast modular algorithms for squarefree factorization and Hermite integration”, Applicable Algebra in Engineering, Communication and Computing 11 (2001).
last updated