Algorithm Search⌘K

Proofs: Risch algorithm

These are the human proofs of Risch algorithm, at full length.

The Risch algorithm for one exponential monomial is correct and complete full

This proof shows: correctness.

Setting. Let Qˉ\bar{\mathbb{Q}} be an algebraic closure of Q\mathbb{Q}, k=Qˉ(x)k = \bar{\mathbb{Q}}(x) with x′=1x' = 1, b∈Q[x]b \in \mathbb{Q}[x] of degree m+1≥1m + 1 \ge 1, and tt with t′=b′tt' = b' t. The integrand is f=∑kfktkf = \sum_k f_k t^k with fk∈Q(x)f_k \in \mathbb{Q}(x) and finitely many k∈Zk \in \mathbb{Z}. An elementary integral of ff is an element FF of an elementary extension of k(t)k(t), with the same constants Qˉ\bar{\mathbb{Q}}, such that F′=fF' = f.

Theorem. (a) If the algorithm returns (y,R,A∗/D∗)(y, R, A^*/D^*), then f=(∑k≠0yktk+R)′+A∗/D∗f = \bigl(\sum_{k \ne 0} y_k t^k + R\bigr)' + A^*/D^* with D∗D^* squarefree, and so ff has the elementary integral ∑kyktk+R+∑cclog⁡vc\sum_k y_k t^k + R + \sum_{c} c \log v_c, where the last sum is the Rothstein-Trager logarithmic part of ∫A∗/D∗\int A^*/D^*. (b) If the algorithm returns FAIL, then ff has no elementary integral.

Lemma 1 (tt is a monomial)

tt is transcendental over kk, and k(t)k(t) has the constants Qˉ\bar{\mathbb{Q}}. Every monic irreducible p∈k[t]p \in k[t] other than tt satisfies p∤p′p \nmid p'.

Proof. First, no nonzero z∈kz \in k satisfies z′/z=nb′z'/z = n b' with n∈Zn \in \mathbb{Z}, n≠0n \ne 0. Indeed, for z=c∏α(x−α)eαz = c \prod_\alpha (x - \alpha)^{e_\alpha} we have z′/z=∑αeα/(x−α)z'/z = \sum_\alpha e_\alpha / (x - \alpha), a proper rational function, while nb′n b' is a nonzero polynomial.

Transcendence. Suppose t≠0t \ne 0 is algebraic over kk, with monic minimal polynomial P=∑i=0dpiTiP = \sum_{i=0}^{d} p_i T^i. Differentiating P(t)=0P(t) = 0 and subtracting db′P(t)=0d b' P(t) = 0 gives ∑i<d(pi′−(d−i)b′pi)ti=0\sum_{i<d} (p_i' - (d - i) b' p_i) t^i = 0, a polynomial relation of degree less than dd, so all its coefficients vanish. A nonzero pip_i with i<di < d would satisfy pi′/pi=(d−i)b′p_i'/p_i = (d - i) b', which is impossible. So P=TdP = T^d and t=0t = 0, a contradiction.

Normal factors. Let p≠tp \ne t be monic irreducible of degree d≥1d \ge 1. Then p′=∑i(pi′+ib′pi)tip' = \sum_i (p_i' + i b' p_i) t^i has degree at most dd, with coefficient db′d b' at tdt^d. If p∣p′p \mid p', then p′=db′pp' = d b' p, and the constant coefficients give p0′=db′p0p_0' = d b' p_0. Here p0≠0p_0 \ne 0, since otherwise t∣pt \mid p and p=tp = t. This is impossible.

Constants. Let F∈k(t)F \in k(t) with F′=0F' = 0 and F≠0F \ne 0. If FF had a pole of order e≥1e \ge 1 at some p≠tp \ne t, then F′F' would have a pole of order e+1e + 1 there (the computation in Lemma 2 below), so it has none, and the same holds for 1/F1/F. So F=ctlF = c t^l with c∈k∗c \in k^*, and 0=F′=(c′+lb′c)tl0 = F' = (c' + l b' c) t^l. If l≠0l \ne 0, then c′/c=−lb′c'/c = -l b', which is impossible. So F=cF = c with c′=0c' = 0, that is, c∈Qˉc \in \bar{\mathbb{Q}}. □\square

Lemma 2 (the shape of an elementary integral)

If f=∑kfktkf = \sum_k f_k t^k has an elementary integral, then for every k≠0k \ne 0 the equation y′+kb′y=fky' + k b' y = f_k has a solution y∈Qˉ(x)y \in \bar{\mathbb{Q}}(x).

Proof. By Liouville's theorem (see the page on it), there are v∈k(t)v \in k(t), constants c1,…,cr∈Qˉc_1, \ldots, c_r \in \bar{\mathbb{Q}} and u1,…,ur∈k(t)∗u_1, \ldots, u_r \in k(t)^* with

f=v′+∑i=1rciui′ui.(1)f = v' + \sum_{i=1}^{r} c_i \frac{u_i'}{u_i}. \tag{1}

Let p≠tp \ne t be a monic irreducible in k[t]k[t]. By Lemma 1, p∤p′p \nmid p'. If vv has a pole of order e≥1e \ge 1 at pp, then v′v' has a pole of order e+1≥2e + 1 \ge 2 there: with v=A/(peB)v = A / (p^e B) and p∤ABp \nmid AB, the numerator of v′v' over pe+1B2p^{e+1} B^2 is ≡−eAp′B≢0(modp)\equiv -e A p' B \not\equiv 0 \pmod p. The sum ∑iciui′/ui\sum_i c_i u_i'/u_i has at most a simple pole at pp, and ff has none. So vv has no pole at pp. Then the part of (1) with a pole at pp is (∑iciνp(ui))p′/p\bigl(\sum_i c_i \nu_p(u_i)\bigr) p'/p, which must vanish, so ∑iciνp(ui)=0\sum_i c_i \nu_p(u_i) = 0. Write ui=hitki∏p≠tpνp(ui)u_i = h_i t^{k_i} \prod_{p \ne t} p^{\nu_p(u_i)} with hi∈k∗h_i \in k^*. Then

∑iciui′ui=∑icihi′hi+(∑iciki)b′+∑p≠t(∑iciνp(ui))p′p∈k,\sum_i c_i \frac{u_i'}{u_i} = \sum_i c_i \frac{h_i'}{h_i} + \Bigl(\sum_i c_i k_i\Bigr) b' + \sum_{p \ne t} \Bigl(\sum_i c_i \nu_p(u_i)\Bigr) \frac{p'}{p} \in k,

and v∈k[t,t−1]v \in k[t, t^{-1}], say v=∑kvktkv = \sum_k v_k t^k. Since (vktk)′=(vk′+kb′vk)tk(v_k t^k)' = (v_k' + k b' v_k) t^k, comparing the coefficients of tkt^k for k≠0k \ne 0 in (1) gives fk=vk′+kb′vkf_k = v_k' + k b' v_k. □\square

Lemma 3 (the Risch differential equation, steps L4 and L5)

Let k≠0k \ne 0, ϕ=kb′∈Q[x]\phi = k b' \in \mathbb{Q}[x] of degree m≥0m \ge 0, and g=a/d∈Q(x)g = a/d \in \mathbb{Q}(x) reduced and nonzero. The equation y′+ϕy=gy' + \phi y = g has at most one solution in Qˉ(x)\bar{\mathbb{Q}}(x). It has one if and only if the code returns one, and then the code returns it.

Proof. Uniqueness: the difference zz of two solutions satisfies z′=−ϕzz' = -\phi z. If z≠0z \ne 0, then z′/z=−ϕz'/z = -\phi is a nonzero polynomial, but z′/zz'/z for a rational function zz is a sum of terms e/(x−α)e/(x - \alpha) and tends to 00 at infinity. So z=0z = 0.

Denominator: let yy be a solution and α∈Qˉ\alpha \in \bar{\mathbb{Q}}. If yy has a pole of order e≥1e \ge 1 at α\alpha, then y′y' has a pole of order e+1e + 1 and ϕy\phi y of order at most ee, so gg has a pole of order exactly e+1≥2e + 1 \ge 2 at α\alpha. If yy has no pole at α\alpha, neither does gg. So gg has no simple poles, and yy has a pole of order ν−1\nu - 1 wherever gg has a pole of order ν\nu. With the squarefree factorization d=∏idiid = \prod_i d_i^i, this says d1d_1 is constant, which is the condition d∣ah2d \mid a h^2 for h=gcd⁡(d,d′)=∏idii−1h = \gcd(d, d') = \prod_i d_i^{i-1} (as gcd⁡(a,d)=1\gcd(a, d) = 1), and that y=q/hy = q / h for a polynomial qq. If the condition fails, there is no solution and the code returns None.

Polynomial equation: substituting y=q/hy = q/h and multiplying by h2h^2 gives

hq′+(ϕh−h′)q=c,c=ah2/d∈Q[x].(2)h q' + (\phi h - h') q = c, \qquad c = a h^2 / d \in \mathbb{Q}[x]. \tag{2}

Let ℓ=ϕh−h′\ell = \phi h - h'. Since deg⁡(ϕh)=m+deg⁡h>deg⁡h′\deg(\phi h) = m + \deg h > \deg h', ℓ\ell has degree s=m+deg⁡hs = m + \deg h and leading coefficient lc(ϕ) lc(h)\mathrm{lc}(\phi)\,\mathrm{lc}(h), and deg⁡(h(xj)′)≤deg⁡h+j−1<j+s\deg(h (x^j)') \le \deg h + j - 1 < j + s. So the operator L(q)=hq′+ℓq\mathcal{L}(q) = h q' + \ell q maps xjx^j to a polynomial of degree exactly j+sj + s with leading coefficient lc(ℓ)\mathrm{lc}(\ell). The loop of L5 is division by this triangular operator: if c≠0c \ne 0 and deg⁡c<s\deg c < s, no qq has L(q)=c\mathcal{L}(q) = c, since deg⁡L(q)=deg⁡q+s≥s\deg \mathcal{L}(q) = \deg q + s \ge s for q≠0q \ne 0. Otherwise the top term of qq is forced to be lc(c)/lc(ℓ) xdeg⁡c−s\mathrm{lc}(c) / \mathrm{lc}(\ell)\, x^{\deg c - s}, and the loop subtracts its image and continues with a polynomial of lower degree. It stops after at most deg⁡c−s+1\deg c - s + 1 rounds, with c=0c = 0 and $\mathcal{L}(q) = $ the original cc, or with None when no solution exists. A solution over Qˉ\bar{\mathbb{Q}} is also forced term by term in the same way, so it exists exactly when the loop succeeds, and it has rational coefficients. □\square

Lemma 4 (Hermite reduction, steps L6 and L7)

For A,D∈Q[x]A, D \in \mathbb{Q}[x], D≠0D \ne 0, hermite_reduce returns RR and A∗/D∗A^*/D^* with A/D=R′+A∗/D∗A/D = R' + A^*/D^* and D∗D^* squarefree.

Proof. The polynomial part PP of A/DA/D is integrated term by term. For the proper part, the loop is the linear version of Hermite reduction (Mack; Bronstein, Symbolic Integration I, Section 2.2): with D−=gcd⁡(D,D′)D^- = \gcd(D, D') and D∗=D/D−D^* = D / D^-, the invariant is A/D=R′+A/(D−D∗)A/D = R' + A / (D^- D^*). In a round with D−∗=D−/gcd⁡(D−,D−′)D^{-*} = D^- / \gcd(D^-, D^{-\prime}), the polynomials D∗D−′/D−D^* D^{-\prime}/D^- and D−∗D^{-*} are coprime, so the extended Euclidean step finds B,CB, C with −BD∗D−′/D−+CD−∗=A-B D^* D^{-\prime} / D^- + C D^{-*} = A, and then

AD−D∗=(BD−)′+C−B′D∗/D−∗D∗gcd⁡(D−,D−′),\frac{A}{D^- D^*} = \Bigl(\frac{B}{D^-}\Bigr)' + \frac{C - B' D^* / D^{-*}}{D^* \gcd(D^-, D^{-\prime})},

as a direct differentiation shows. Each round removes one from every multiplicity in D−D^-, so the loop ends with D−=1D^- = 1 and the remainder A/D∗A / D^*, where D∗D^* is the squarefree part of DD. □\square

Proof of the theorem

(a) For each k≠0k \ne 0, Lemma 3 gives yk′+kb′yk=fky_k' + k b' y_k = f_k, so (yktk)′=fktk(y_k t^k)' = f_k t^k. Lemma 4 gives f0=R′+A∗/D∗f_0 = R' + A^*/D^* with D∗D^* squarefree. Summing gives the identity. The integral of A∗/D∗A^*/D^* with squarefree D∗D^* is a sum ∑cclog⁡vc\sum_c c \log v_c over the roots cc of the Rothstein-Trager resultant, which is elementary.

(b) The algorithm fails only in L3, when for some k≠0k \ne 0 the equation y′+kb′y=fky' + k b' y = f_k has no solution in Q(x)\mathbb{Q}(x). By Lemma 3 it then has no solution in Qˉ(x)\bar{\mathbb{Q}}(x) either, and by Lemma 2 ff has no elementary integral. ■\blacksquare

Back to Risch algorithm