Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Replace all occurrences of an algebraic subexpression with a new symbol
rewrites expr, replacing each occurrence of an element of reps with the corresponding element of repvars.
rewrites expr, burrowing inside any subexpression that is not a polynomial in vars.
Algebraically replace xy by a new variable z in a bivariate polynomial:
AlgebraicReplace works with non-polynomial expressions:
Use several replacements at once:
ReplaceAll only replaces literal matches:
AlgebraicReplace rewrites all monomials containing powers of xy to have powers of z:
AlgebraicReplace with a set of reducing polynomials polys and replacement variables vars has behavior similar to PolynomialReduce with polys-vars:
This is not canonical insofar as the reduction is not done with a Gröbner basis, so results can depend on ordering of inputs:
If we compute a Gröbner basis then the result is canonical for the given variable ordering:
Reversing the reduction polynomials does not change the result of PolynomialReduce when a Gröbner basis is used:
If the underlying variables are omitted, AlgebraicReplace might not recognize what are the correct ones:
Specify x and y as variables to get the desired replacement:
As seen in the "Properties and Relations" examples, AlgebraicReplace does not compute and use a Gröbner basis. Changing the order of the reducer inputs can affect the result.
This work is licensed under a Creative Commons Attribution 4.0 International License