Algorithm Search⌘K

Proofs: Risch-Norman heuristic integration

These are the human proofs of Risch-Norman heuristic integration, at full length.

Every answer of the Risch-Norman heuristic is an antiderivative full

This proof shows: correctness.

Setting. KK is a field of characteristic 00 (in the code, K=QK = \mathbb{Q}). The differential field is E=K(x,θ1,…,θm)E = K(x, \theta_1, \ldots, \theta_m) with derivation ′', where x′=1x' = 1, the constants of EE are KK, and θi′=Ni/d\theta_i' = N_i / d with Ni∈K[x,θ]N_i \in K[x, \theta] and 0≠d∈K[x]0 \ne d \in K[x]. The scaled derivation is D=d⋅′D = d \cdot {}', so on polynomials Dp=d ∂p/∂x+∑iNi ∂p/∂θiD p = d\, \partial p / \partial x + \sum_i N_i\, \partial p / \partial \theta_i, and DD maps K[x,θ]K[x, \theta] into itself. The input is f=P/Qf = P / Q with P,Q∈K[x,θ]P, Q \in K[x, \theta], Q=∏kqkekQ = \prod_k q_k^{e_k} given by its factors, and a finite list of extra candidates. The output is FAIL or (U,B,(cj,vj)j)(U, B, (c_j, v_j)_j) with U,B,vj∈K[x,θ]U, B, v_j \in K[x, \theta] and cj∈Kc_j \in K.

Theorem. (a) If the algorithm returns (U,B,(cj,vj))(U, B, (c_j, v_j)), then B≠0B \ne 0, every vj≠0v_j \ne 0, and in any differential extension of EE that contains log⁡vj\log v_j for each jj (elements ℓj\ell_j with ℓj′=vj′/vj\ell_j' = v_j' / v_j),

(UB+∑jcjlog⁡vj)′=f.\Bigl(\frac{U}{B} + \sum_j c_j \log v_j\Bigr)' = f.

(b) The algorithm returns FAIL exactly when no UU in the span of the monomials of total degree at most δ\delta and no constants cj∈Kc_j \in K satisfy (a) with the BB and the vjv_j chosen in L1 and L2.

FAIL does not say that ff has no elementary integral. Part (b) only says that the search in the chosen finite family was complete.

Lemma 1 (the derivative of the guess)

Let W=∏jvjW = \prod_j v_j over the candidates of L2, and for unknowns uμu_\mu and cjc_j in KK, let U=∑∣μ∣≤δuμ xμ0θμ′U = \sum_{|\mu| \le \delta} u_\mu\, x^{\mu_0} \theta^{\mu'}. Then

d⋅B2WQ⋅[(UB+∑jcjlog⁡vj)′−PQ]=QW(DU⋅B−U⋅DB)+∑jcj Dvj B2Q∏k≠jvk−dPB2W.d \cdot B^2 W Q \cdot \Bigl[\Bigl(\frac{U}{B} + \sum_j c_j \log v_j\Bigr)' - \frac{P}{Q}\Bigr] = Q W (DU \cdot B - U \cdot DB) + \sum_j c_j\, Dv_j\, B^2 Q \prod_{k \ne j} v_k - d P B^2 W.

Proof. The quotient rule holds for any derivation: (U/B)′=(U′B−UB′)/B2(U/B)' = (U' B - U B') / B^2. Multiplying by dd turns ′' into DD on polynomials, so d(U/B)′=(DU⋅B−U⋅DB)/B2d (U/B)' = (DU \cdot B - U \cdot DB) / B^2. For the logarithms, d(log⁡vj)′=d vj′/vj=Dvj/vjd (\log v_j)' = d\, v_j' / v_j = D v_j / v_j. Multiply the bracket by dB2WQd B^2 W Q and use W/vj=∏k≠jvkW / v_j = \prod_{k \ne j} v_k. □\square

Lemma 2 (the linear system)

The right side of Lemma 1 is linear in the unknowns (uμ,cj)(u_\mu, c_j): DD is KK-linear because the constants of EE are KK, and the products are with fixed polynomials. Write it as ∑μuμ colμ+∑jcj colj−rhs\sum_\mu u_\mu\, \mathrm{col}_\mu + \sum_j c_j\, \mathrm{col}_j - \mathrm{rhs}, where colμ=QW(D(xμ0θμ′)B−xμ0θμ′DB)\mathrm{col}_\mu = Q W (D(x^{\mu_0}\theta^{\mu'}) B - x^{\mu_0}\theta^{\mu'} DB), colj=Dvj B2Q∏k≠jvk\mathrm{col}_j = Dv_j\, B^2 Q \prod_{k \ne j} v_k and rhs=dPB2W\mathrm{rhs} = d P B^2 W. These are the columns built in L5 and the right side built in L6. A polynomial is zero exactly when every coefficient is zero, so the right side of Lemma 1 vanishes exactly when the vector of unknowns solves the linear system with one equation for each monomial that occurs in some column or in rhs\mathrm{rhs}. □\square

Lemma 3 (step L7)

Gauss-Jordan elimination over KK returns a solution of a linear system when one exists, and reports that none exists otherwise.

Proof. Each step swaps two rows, scales a row by a nonzero element of KK, or adds a multiple of one row to another. These are invertible, so the solution set stays the same. At the end the matrix is in reduced row echelon form with pivot columns p1<⋯<prp_1 < \cdots < p_r. A row below the first rr has zero coefficients. If such a row has a nonzero right side, it reads 0=c≠00 = c \ne 0 and the system has no solution. Otherwise set every free unknown to 00 and the pivot unknown of row ii to the right side of row ii. Each of the first rr rows has a 11 in its pivot column, zeros in the other pivot columns, and only free unknowns elsewhere, so every equation holds. All arithmetic is exact in KK. □\square

Proof of the theorem

BB is a product of powers of the factors qkq_k of QQ. These are nonzero, since QQ is the denominator of ff, so B≠0B \ne 0. The candidates vjv_j are nonzero factors of QQ or nonzero extra polynomials, so W≠0W \ne 0. Also d≠0d \ne 0. So dB2WQ≠0d B^2 W Q \ne 0, and the bracket in Lemma 1 is zero exactly when the right side of Lemma 1 is the zero polynomial.

(a) If L7 returns a vector, Lemma 3 says it solves the system, and Lemma 2 says that the right side of Lemma 1 is zero for it. Divide by dB2WQ≠0d B^2 W Q \ne 0 in the field of fractions: the bracket is zero, which is the claim. Candidates with cj=0c_j = 0 are dropped from the output, and this does not change the sum.

(b) If some UU of total degree at most δ\delta and some constants cjc_j satisfy (a), then the bracket is zero, so by Lemma 1 and Lemma 2 their coefficients solve the system, and Lemma 3 returns a solution. Conversely, by (a), a returned vector gives such UU and cjc_j. So FAIL is returned exactly when no such choice exists.

The zero integrand gives U=0U = 0, B=1B = 1 and no logarithms, whose derivative is 0=f0 = f. ■\blacksquare

Remark (what is not proved). The theorem is about soundness. The choice of BB in L1 follows the structure of the integral in the purely transcendental case: a normal factor qq of multiplicity ee in QQ occurs with multiplicity at most e−1e - 1 in the denominator of the rational part, as in Hermite reduction. The guess may still be too small in three ways. The degree bound δ\delta can be too low. A special factor can need another exponent. The logarithmic part can need arguments that are not among the candidates, or constants cjc_j outside KK. In each case the algorithm returns FAIL although an elementary integral exists.

Back to Risch-Norman heuristic integration