/usr/share/axiom-20170501/src/algebra/INTRAT.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | )abbrev package INTRAT RationalIntegration
++ Author: Manuel Bronstein
++ Date Created: 1987
++ Date Last Updated: 24 October 1995
++ Description:
++ Rational function integration
++ This package provides functions for the base case of the Risch algorithm.
-- Used internally bt the integration packages
RationalIntegration(F, UP) : SIG == CODE where
F : Join(Field, CharacteristicZero, RetractableTo Integer)
UP : UnivariatePolynomialCategory F
RF ==> Fraction UP
IR ==> IntegrationResult RF
LLG ==> List Record(coeff:RF, logand:RF)
URF ==> Union(Record(ratpart:RF, coeff:RF), "failed")
U ==> Union(Record(mainpart:RF, limitedlogs:LLG), "failed")
SIG ==> with
integrate : RF -> IR
++ integrate(f) returns g such that \spad{g' = f}.
infieldint : RF -> Union(RF, "failed")
++ infieldint(f) returns g such that \spad{g' = f} or "failed"
++ if the integral of f is not a rational function.
extendedint : (RF, RF) -> URF
++ extendedint(f, g) returns fractions \spad{[h, c]} such that
++ \spad{c' = 0} and \spad{h' = f - cg},
++ if \spad{(h, c)} exist, "failed" otherwise.
limitedint : (RF, List RF) -> U
++ \spad{limitedint(f, [g1,...,gn])} returns
++ fractions \spad{[h,[[ci, gi]]]}
++ such that the gi's are among \spad{[g1,...,gn]}, \spad{ci' = 0}, and
++ \spad{(h+sum(ci log(gi)))' = f}, if possible, "failed" otherwise.
CODE ==> add
import TranscendentalIntegration(F, UP)
infieldint f ==
rec := baseRDE(0, f)$TranscendentalRischDE(F, UP)
rec.nosol => "failed"
rec.ans
integrate f ==
rec := monomialIntegrate(f, differentiate)
integrate(rec.polypart)::RF::IR + rec.ir
limitedint(f, lu) ==
quorem := divide(numer f, denom f)
(u := primlimintfrac(quorem.remainder / (denom f), differentiate,
lu)) case "failed" => "failed"
[u.mainpart + integrate(quorem.quotient)::RF, u.limitedlogs]
extendedint(f, g) ==
fqr := divide(numer f, denom f)
gqr := divide(numer g, denom g)
(i1 := primextintfrac(fqr.remainder / (denom f), differentiate,
gqr.remainder / (denom g))) case "failed" => "failed"
i2:=integrate(fqr.quotient-retract(i1.coeff)@UP *gqr.quotient)::RF
[i2 + i1.ratpart, i1.coeff]
|