I do not recall offhand how these are computed in general. For the case of distinct roots I can illustrate one method. I'll take the example in that Wikipedia article.
We have polynomials as below.
polys = {x^2-1, (x-1)*(y-1), y^2-1};
We take as separating element t = (x-y)/2
.
seppoly = t-(x-y)/2;
First compute the polynomial referred to as h(t)
. Then take its derivative.
tpoly =
First[GroebnerBasis[Join[polys, {seppoly}], t, {x, y},
MonomialOrder -> EliminationOrder]]
dtpoly = D[tpoly, t];
(* Out[132]= -t + t^3 *)
Now call that derivative den
and find "numerator" polynomials g1
and g2
such that den*x=g1
and similar for y
. I use GroebnerBasis
with a monomial order that is efficient for eliminating {x,y,den}
and in effect solving for {g1,g2}
in terms of t
.
gb = GroebnerBasis[
Join[polys, {seppoly, dtpoly - den}, den*{x, y} - {g1, g2}], {g1,
g2, t}, {x, y, den},
MonomialOrder -> {{1, 1, 1, 0, 0, 0}, {0, 0, -1, 0, 0, 0}, {0, -1,
0, 0, 0, 0}, {0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0,
0, -1, 0}}]
(* Out[161]= {-t + t^3, 1 + g2 + 2 t - t^2, 1 + g1 - 2 t - t^2} *)
The numerators are readily recovered.
numerators = {g1, g2} /.
First[Solve[Rest[gb] == 0, {g1, g2}]]
(* Out[164]= {-1 + 2 t + t^2, -1 - 2 t + t^2} *)
The rational univariate representation:
rur = Join[{tpoly}, {x, y} - numerators/dtpoly]
(* Out[167]= {-t + t^3, -((-1 + 2 t + t^2)/(-1 + 3 t^2)) +
x, -((-1 - 2 t + t^2)/(-1 + 3 t^2)) + y} *)