## MARS - sample Maple session

The sylvester resultant formulation is described in sylvester

To construct a sylvester resultant:

> syl := Sylvester(x*x+6*x+3*y-4,y*y+2*x-7*y+5,y,x);

At this point, syl is a Maple resultant data structure. Maple resultant data structures are implemented as arrays. Usually, the user simply wants to look at the resultant matrix polynomial, which corresponds to the fifth element in the array:

> eval(syl[5]);

Will print out the matrix polynomial Other resultant formulations include: Macaulay, U-resultant, Bezout and Sparse and they can be exercised as shown below

The macaulay resultant formulation is described in macaulay

• >macFnArray := eval(array(1..2,[(y+6)*x1+(y+2)*x2, (y-13)*x1*x1+(y+5)*x1*x2+y*x2*x2]));

> macVarArray := array(1..2,[x1,x2]);

> Macaulay(eval(macFnArray),eval(macVarArray),y);

• > macFnArray2 := eval(array(1..3,[x1*x1+2*x2*x2-x0*x0, x1*x1-2*x1*x2+1*x2*x2-x0*x0, x0*u-x2 ]));

> macVarArray2 := array(1..3,[x0,x1,x2]);

> Macaulay(eval(macFnArray2),eval(macVarArray2),u);

The bezout resultant formulation is described in bezout
• > f1:= expand((x )^2 + (y - 2)^2 + z^2 -16);

> f2:= expand((x - 2)^2 + (y)^2 + (z )^2 - 9);

> f3:= expand((x + 2)^2 + (y-0.1)^2 + (z+0.1 )^2 - 16);

> bezFnArray := array(1..3,[f1,f2,f3]);

> bezVarArray := array(1..2,[y,z]);

> Bezout(eval(bezFnArray),eval(bezVarArray),x,1);

The sparse resultant formulation is described in sparse

• > sparseFnArray := array(1..2,[x*x+6*x+3*y-4,y*y+2*x-7*y+5]);

> sparseVarArray := array(1..1,[y]);

> Sparse(eval(sparseFnArray),eval(sparseVarArray),x,10);