
Фукция fullratsubst will also accept-принимать its arguments in the format of
lratsubst. That is, the first argument may be a single substitution equation or a list of such
equations, while the second argument is the expression being processed.
load ("lrats") loads fullratsubst and lratsubst.
Пример: НЕ работает...
(%i1) load ("lrats")$ /* НЕ загружается... */
Тогда берём пример из СПРАВКИ:
(%i1) load ("lrats")$
/*subst can carry out multiple substitutions. lratsubst is analogous to subst. */
(%i2) subst ([a = b, c = d], a + c);
(%o2) d + b
(%i3) lratsubst ([a^2 = b, c^2 = d], (a + e)*c*(a + c));
(%o3) (d + a c) e + a d + b c
/*If only one substitution is desired, then a single equation may be given as first
argument.*/
(%i4) lratsubst (a^2 = b, a^3);
(%o4) a b
/*fullratsubst is equivalent to ratsubst except that it recurses until its result stops
changing.*/
Функция: gcd (p_1, p_2, x_1, ...)
Returns the greatest common divisor (наибольший общий делитель) of p_1 and p_2.
The flag gcd determines which algorithm is employed. Setting gcd to ez, subres, red, or
spmod selects the ezgcd, subresultant prs, reduced, or modular algorithm, respectively-
соответственно. If gcd false then gcd (p_1, p_2, x) always returns 1 for all x. Many
functions (e.g. ratsimp, factor, etc.) cause gcd's to be taken implicitly-неявно. For
homogeneous polynomials it is recommended that gcd equal to subres be used. To take the
gcd when an algebraic is present, e.g., gcd (x^2 - 2*sqrt(2)*x + 2, x - sqrt(2)),
algebraic must be true and gcd must not be ez. subres is a new algorithm, and people who
have been using the red setting should probably change it to subres.
The gcd flag, default: subres, if false will also prevent the greatest common divisor
from being taken when expressions are converted to canonical rational expression (CRE) form.
This will sometimes speed the calculation if gcds are not required.
Функция: gcdex (f, g)
Функция: gcdex (f, g, x)
Returns a list [a, b, u] where u is the greatest common divisor (gcd) of f and g, and u
is equal to a f + b g. The arguments f and g should be univariate polynomials, or else
polynomials in x a supplied main variable since we need to be in a principal ideal domain for
this to work. The gcd means the gcd regarding f and g as univariate polynomials with
coefficients being rational functions in the other variables.
gcdex implements the Euclidean algorithm, where we have a sequence of L[i]: [a[i], b[i],
r[i]] which are all perpendicular to [f, g, -1] and the next one is built as if q = quotient(r[i]/r[i+1])
then L[i+2]: L[i] - q L[i+1], and it terminates at L[i+1] when the remainder r[i+2] is zero.
Примеры:
(%i1) gcdex (x^2 + 1, x^3 + 4);
Could not find `GCDEX' using paths in file_search_maxima,system.
116