## Contents

The library includes four canned top-level MATLAB functions for solving multipolynomial systems of two or three functions. In this section, we describe how to use the introductory functions.

Debugging transcript

These functions compute and return all of the complex roots of the given functions (which are passed as arguments) in the given variables (which are also passed as arguments).
The sylvester resultant formulation is described in sylvester
All of these functions utilize specialized Maple functions and Maple variable names to store the resultant data structure. For example, the sylveter2() calls the helper function Sylvester_shorthand_2() which sets the Maple variable Sylvester_shorthand_2_ to the resultant. We can examine the Maple resultant structure by using the maple() Matlab command.

>> maple('eval(Sylvester_shorthand_2_);')

## 1.0 Sylvester

For example, we can find the common roots of the system of two equations: {f1(x,y) = x*x+6*x+3*y-4} and {f2(x,y) = y*y+2*x-7*y+5} by calling sylvester2 with the appropriate arguments.

>> format long g % to print out all of the results

>> sylvester2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')

ans = 7.11551073091436 + 0.80726460031964i 7.11551073091436 - 0.80726460031964i -12.8955223880597 -13.4892758454899 -1.11942329892624
 0.214777517761955 0.888401837097428 -2.58512085521498 - 2.91867382513375i -2.58512085521498 + 2.91867382513375i 8174680.64485979 -8174678.81600003 -7.04453580733058

Each function returns a NxM matrix where each row corresponds to a different root and each element in each row corresponds to one of the variables. In the previous example, the leftmost column corresponds to the 'x' variable and the rightmost column corresponds to the 'y' variable. The third row corresponds to the solution {x=0.2148,y=0.8884}, which we can verify is a common root of the two given equations
Since we aren't really interested in complex roots, we can tell the library to prune complex roots by calling the matlab function removecomplex() on the result matrix.

>> removecomplex(sylvester2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y'))

ans = -7.04453580732936
 0.214778 0.888401837097446 -1.11942

Another way to turn on only complex roots is to use the global variable only_real.

>> global only_real;

>> only_real = 1;

only_real = 1

>> sylvester2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')

ans = 33551816.6582203 -33551814.6751613 -7.04453580733046
 0.214778 0.888401837097428 5.89617 5.74217 -1.11942

Note that we have turned on the only_real flag for subsequent function calls
We can also use the general linearized transform capability to solve {f1(x,y) = x*x+6*x+3*y-4} and {f2(x,y) = y*y+2*x-7*y+5} by calling sylvesterglt2 with the appropriate arguments.

>> sylvesterglt2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')

ans = -7.04453580733884 35574.2161607169 36468582006577.3
 0.214778 0.888401837097422 -1.11942 -71363.5 -3.87342e+13

## 2.0 U Resultant

The u-resultant formulation is described in u-resultant

>> uresultant2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y','u')

ans = -3.06958541502185 0.214777517761956
 -7.04454 -1.11942329892606 9.13839e-16 0.888402

>> uresultantglt2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y','u')

ans = 0.214777517761955 -7.04453580733046
 0.302539 0.277593300740616 0.888402 -1.11942

>> uresultant3('x*x+6*x+3*y+6*z-4','y*y+2*x-7*y+5+2*z','x*x+y*y+z*z-1','x','y','z','u')

ans = 0.41740791388553 -0.0278427896158022 -0.0277110820702231 0.177547774447134 0.184314194522218
 -0.197731 0.888779 0.413491704058118 0.881548 -0.220553 0.860271 4.01226e-08 0.856205 -4.01226e-08 0.801939 -1.29048e-08 0.827056 1.29048e-08

>> uresultantglt3('x*x+6*x+3*y+6*z-4','y*y+2*x-7*y+5+2*z','x*x+y*y+z*z-1','x','y','z','u')

ans = 0.417407913885499
 -0.197731 0.888779 0.413491704058126 0.881548 -0.220553

The bezout formulation is described in bezout
We also provide a MATLAB routine bezout2, bezoutglt2, bezout3, bezoutglt3 which solves systems of two or three equations in two or three unknowns:

>> bezout2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')

ans = -7.04453580733045
 0.214778 0.888401837097428 -1.11942

>> bezoutglt2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')

ans = 3609554.98781189 -3609513.69518684 1.20255185997157
 0.772343 -0.488746323384348 -1.18824e+07 1.18824e+07 7.03082

>> bezout3('x*x+6*x+3*y+6*z-4','y*y+2*x-7*y+5+2*z','x*x+y*y+z*z-1','x','y','z')

ans = -0.197730522175284
 0.417408 0.881548 -0.220553455268941 0.888779 0.413492

>> bezoutglt3('x*x+6*x+3*y+6*z-4','y*y+2*x-7*y+5+2*z','x*x+y*y+z*z-1','x','y','z')

ans = 0.417407913885535 -460.672180098364 444.930200650982
 -0.197731 0.888779 0.41349170405812 0.881548 -0.220553 -1505.22 246.664 1510.39 -235.811

The sparse formulation is described in sparse

>> sparse2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')

ans = -7.04453580733112
 0.214778 0.888401837097468 -1.11942

>> sparseglt2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')

ans = -7.04453580733538 9625.23788653637 -21447859665299.8
 0.214778 0.888401837097454 -1.11942 -72708.8 1.49175e+13

>> sparse3('x*x+6*x+3*y+6*z-4','y*y+2*x-7*y+5+2*z','x*x+y*y+z*z-1','x','y','z')

ans = -0.19773052217529 -311573.388570388 8670166.98885402 -8669537.84956352 27442825.5075708 -27442803.0373335 114894638128899
 0.417408 0.881548 -0.220553455268948 0.888779 0.413492 -0.23477 -2.18433e+09 -0.221028 9.62039e+07 -0.215091 -9.62339e+07 -0.187616 5.94042e+07 -0.178068 -5.91779e+07 7.88546 -1.83279e+15

>> sparseglt3('x*x+6*x+3*y+6*z-4','y*y+2*x-7*y+5+2*z','x*x+y*y+z*z-1','x','y','z')

ans = -0.197730522175291 2.1406301891098 -2.31064800033365 222441.227243238 110516.838354917 3474825390496.66 -18001028440440.1 -52122380857374.6 83147607558196.5
 0.417408 0.881548 -0.22055345526895 0.888779 0.413492 1.49485 0.57826 -0.842814 -3.61239 106238 80879.2 52816.6 40187.7 1.65943e+12 1.2634e+12 -8.59655e+12 -6.54495e+12 -2.48915e+13 -1.8951e+13 3.97079e+13 3.02314e+13

The library also includes methods for constructing the Macaulay resultant. The Macaulay resultant suffers from the requirement that the all of the polynomials have to be homogeneous.
The Macaulay resultant formulation is described in Macaulay
A homogeneous function is a function whose monomials all have the same degree, such as 'x*x+x*y+y*y' (degree(x*x)=degree(x*y)=degree(y*y)=2); in contrast, a non-homogeneous function have monomials with differing degrees: 'x*x+y'.

>> macaulay2('(y+6)*x1+(y+2)*x2','(y-13)*x1*x1+(y+5)*x1*x2+y*x2*x2','y','x1','x2')

ans =
 14.8262 0.672853 0.832807

>> macaulay3('(y+6)*x1+(y+2)*x2+(y-4)*x3','(y-13)*x1*x1+(y+5)*x1*x2+y*x2*x2+(y-5)*x2*x3+(y-7)*x3*x3','(y+1)*x1*x1+(y-1)*x1*x2+(y-2)*x2*x3','y','x1','x2','x3')

ans = 14.7407124599508 -5.99999999999999 7.16050047117295
 -6 1 0 0 0.712686 -0.858695 -0.0378414 0.465185 -0.91354 0.365416 0.187918 0.0726431 -0.993053

## Debugging Transcript

The global variable debug_resultant can be set to display all of the computations involved in numerically solving a resultant system. The debug_resultant variable is a bit field.

bit (0x4) bit (0x8) bit (0x32)
 bit (0x1) TRACING prints out functions arguments and returned results FULL prints out all intermediate computations MATRIX prints out intermediate matrix results LATEX enables LaTeX output
Consequently, setting debug_resultant to 63 prints all of the intermediate matrices out in Latex format.
>> global debug_resultant
>> debug_resultant=63;
>> sylvester2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')
mapleresultant called with
VECTOR([VECTOR([x^2+6*x+3*y-4, y^2+2*x-7*y+5]), VECTOR([y]), x, [[2, 1, 1, 1]], MATRIX([[x^2+6*x-4, 3, 0], [0, x^2+6*x-4, 3], [2*x+5, -7, 1]]), VECTOR([1, y, y^2]), 0, 0, 0, 0])
mapledecomposematpoly called with
maplematrixpolynomial
{\it MATRIX}([[{x}^{2}+6\,x-4,3,0],[0,{x}^{2}+6\,x-4,3],[2\,x+5,-7,1]])
variable
x
maxdeg
2
maplemapcoeff(maplematrixpolynomial,variable,0)
MATRIX([[-4, 3, 0], [0, -4, 3], [5, -7, 1]])
zeromat
0 5
 -4 3 0 -4 3 -7 1
mapledecomposematpoly returned \left [\begin {array}{ccc} -4&3&0\\\noalign{\medskip}0&-4&3\\\noalign{\medskip}5&-7&1\\\noalign{\medskip}6&0&0\\\noalign{\medskip}0&6&0\\\noalign{\medskip}2&0&0\\\noalign{\medskip}1&0&0\\\noalign{\medskip}0&1&0\\\noalign{\medskip}0&0&0\end {array}\right ]
mapleresultant returned
function array
\left [\begin {array}{cc} {x}^{2}+6\,x+3\,y-4&{y}^{2}+2\,x-7\,y+5\end {array}\right ]
variable array
y
hidden variable
x
hidden variable max deg
2
resultant extraction scheme
\left [\begin {array}{cccc} 2&1&1&1\end {array}\right ] resultant numerator \left [\begin {array}{ccc} {x}^{2}+6\,x-4&3&0\\\noalign{\medskip}0&{x}^{2}+6\,x-4&3\\\noalign{\medskip}2\,x+5&-7&1\end {array}\right ] Empty string: 1-by-0
resultant numerator companion matrix
\left [\begin {array}{ccc} -4&3&0\\\noalign{\medskip}0&-4&3\\\noalign{\medskip}5&-7&1\\\noalign{\medskip}6&0&0\\\noalign{\medskip}0&6&0\\\noalign{\medskip}2&0&0\\\noalign{\medskip}1&0&0\\\noalign{\medskip}0&1&0\\\noalign{\medskip}0&0&0\end {array}\right ]
solveresultant called with fnarray: vararray: hiddenvar: hiddenvarmaxdeg: extract: numer: numerdecomposematpoly: numerrow: denom: denomrow: resultantUDim:
 numvars: 1 [1x2 sym ] [1x1 sym ] [1x1 sym ] 2 [2 1 1 1] 'not cached' [9x3 double] 'not cached' 'not cached' 'not cached' 0
companionmatrix called with
\left [\begin {array}{ccc} -4&3&0\\\noalign{\medskip}0&-4&3\\\noalign{\medskip}5&-7&1\\\noalign{\medskip}6&0&0\\\noalign{\medskip}0&6&0\\\noalign{\medskip}2&0&0\\\noalign{\medskip}1&0&0\\\noalign{\medskip}0&1&0\\\noalign{\medskip}0&0&0\end {array}\right ]
matsize
3
maxdeg
2
\left [\begin {array}{ccc} 1&0&0\\\noalign{\medskip}0&1&0\\\noalign{\medskip}0&0&0\end {array}\right ]
bigsize = matsize * maxdeg
6

Inf

identity transformation didnt succeed
trailing matrix
\left [\begin {array}{ccc} -4&3&0\\\noalign{\medskip}0&-4&3\\\noalign{\medskip}5&-7&1\end {array}\right ]
cond(trailingmatrix)
17.9877134220118
cond(trailingmatrix) < 1e6
-> inverse process
inversetrailing matrix
\left [\begin {array}{ccc} -{\frac {17}{23}}&{\frac {3}{23}}&-{\frac {9}{23}}\\\noalign{\medskip}-{\frac {15}{23}}&{\frac {4}{23}}&-{\frac {12}{23}}\\\noalign{\medskip}-{\frac {20}{23}}&{\frac {13}{23}}&-{\frac {16}{23}}\end {array}\right ]
i
0
following matrix
\left [\begin {array}{ccc} 1&0&0\\\noalign{\medskip}0&1&0\\\noalign{\medskip}0&0&0\end {array}\right ]
matrix mult
\left [\begin {array}{ccc} {\frac {17}{23}}&-{\frac {3}{23}}&0\\\noalign{\medskip}{\frac {15}{23}}&-{\frac {4}{23}}&0\\\noalign{\medskip}{\frac {20}{23}}&-{\frac {13}{23}}&0\end {array}\right ]
i
1
following matrix
\left [\begin {array}{ccc} 6&0&0\\\noalign{\medskip}0&6&0\\\noalign{\medskip}2&0&0\end {array}\right ]
matrix mult
\left [\begin {array}{ccc} {\frac {120}{23}}&-{\frac {18}{23}}&0\\\noalign{\medskip}{\frac {114}{23}}&-{\frac {24}{23}}&0\\\noalign{\medskip}{\frac {152}{23}}&-{\frac {78}{23}}&0\end {array}\right ]
inverse transformation didnt succeed
companion matrix condition number too high
4.9977034620114e+017
inverse transformation didnt succeed
-> try random (as+b)/(cs+d) transformations
alpha
0.83849604493808
beta
0.568072461007776
gamma
0.370413556632116
delta
\left [\begin {array}{ccc} {\frac {1135916260876681}{562949953421312}}&{\frac {3707530826516023}{9007199254740992}}&0\\\noalign{\medskip}0&{\frac {1135916260876681}{562949953421312}}&{\frac {3707530826516023}{9007199254740992}}\\\noalign{\medskip}{\frac {735894720106225}{562949953421312}}&-{\frac {67585197358365}{70368744177664}}&{\frac {4943374435354697}{36028797018963968}}\end {array}\right ]
8.54622424482992
alpha
0.546571151829106
beta
0.444880204672912
gamma
0.694567240425548
delta
0.621310130795413
\left [\begin {array}{ccc} {\frac {2913053969825901}{4503599627370496}}&{\frac {1629482232754227}{1125899906842624}}&0\\\noalign{\medskip}0&{\frac {2913053969825901}{4503599627370496}}&{\frac {1629482232754227}{1125899906842624}}\\\noalign{\medskip}{\frac {7141310845352135}{2251799813685248}}&-{\frac {3802125209759863}{1125899906842624}}&{\frac {543160744251409}{1125899906842624}}\end {array}\right ]
3.82795386162057

alpha 0.794821080200926
beta
0.956843448444877
gamma
0.522590349080708
delta
0.880142207411327
\left [\begin {array}{ccc} {\frac {2287302604089313}{1125899906842624}}&{\frac {1801664192787}{2199023255552}}&0\\\noalign{\medskip}0&{\frac {2287302604089313}{1125899906842624}}&{\frac {1801664192787}{2199023255552}}\\\noalign{\medskip}{\frac {2472740800233367}{1125899906842624}}&-{\frac {4203883116503}{2199023255552}}&{\frac {600554730929}{2199023255552}}\end {array}\right ] cond(leadingmatrix)
4.93595805574755
alpha
0.172956141275237
beta
0.979746896788841
gamma
0.2714472586418
delta
0.25232934687399
\left [\begin {array}{ccc} {\frac {4862501899701431}{288230376151711744}}&{\frac {1991048985379111}{9007199254740992}}&0\\\noalign{\medskip}0&{\frac {4862501899701431}{288230376151711744}}&{\frac {1991048985379111}{9007199254740992}}\\\noalign{\medskip}{\frac {8328326862175923}{18014398509481984}}&-{\frac {4645780965884593}{9007199254740992}}&{\frac {5309463961010963}{72057594037927936}}\end {array}\right ]
4.65411231701963
bestalpha
0.546571151829106
bestbeta
0.444880204672912
bestgamma
0.694567240425548
bestdelta
0.621310130795413
smallestcond
3.82795386162057
smallestcond < 1e8
-> rational_quotient process
\left [\begin {array}{ccc} {\frac {2913053969825901}{4503599627370496}}&{\frac {1629482232754227}{1125899906842624}}&0\\\noalign{\medskip}0&{\frac {2913053969825901}{4503599627370496}}&{\frac {1629482232754227}{1125899906842624}}\\\noalign{\medskip}{\frac {7141310845352135}{2251799813685248}}&-{\frac {3802125209759863}{1125899906842624}}&{\frac {543160744251409}{1125899906842624}}\end {array}\right ]
3.82795386162057
\left [\begin {array}{ccc} {\frac {4680475012850535}{9007199254740992}}&-{\frac {2514042913935103}{36028797018963968}}&{\frac {3771064370902655}{18014398509481984}}\\\noalign{\medskip}{\frac {4131733128033135}{9007199254740992}}&{\frac {4494398615425671}{144115188075855872}}&-{\frac {3370798961569253}{36028797018963968}}\\\noalign{\medskip}-{\frac {7386371786659109}{36028797018963968}}&{\frac {3049016261140933}{4503599627370496}}&{\frac {753254553739999}{18014398509481984}}\end {array}\right ]
i
0
following matrix
\left [\begin {array}{ccc} {\frac {2812630831727623}{9007199254740992}}&{\frac {5215523413766537}{4503599627370496}}&0\\\noalign{\medskip}0&{\frac {2812630831727623}{9007199254740992}}&{\frac {5215523413766537}{4503599627370496}}\\\noalign{\medskip}{\frac {2795551540523377}{1125899906842624}}&-{\frac {190149291126905}{70368744177664}}&{\frac {6954031218355383}{18014398509481984}}\end {array}\right ]
matrix mult
\left [\begin {array}{ccc} -{\frac {6143226768865817}{9007199254740992}}&-{\frac {129042498707599}{9007199254740992}}&-{\frac {1}{36028797018963968}}\\\noalign{\medskip}{\frac {802185481956501}{9007199254740992}}&-{\frac {7149717546115545}{9007199254740992}}&0\\\noalign{\medskip}-{\frac {1434081057024049}{36028797018963968}}&{\frac {2504031572456349}{18014398509481984}}&-{\frac {7207390430725807}{9007199254740992}}\end {array}\right ]
i
1
following matrix
\left [\begin {array}{ccc} {\frac {4168173901860261}{4503599627370496}}&{\frac {728809077247183}{281474976710656}}&0\\\noalign{\medskip}0&{\frac {4168173901860261}{4503599627370496}}&{\frac {728809077247183}{281474976710656}}\\\noalign{\medskip}{\frac {6319220694044961}{1125899906842624}}&-{\frac {3401109027153521}{562949953421312}}&{\frac {7773963490636619}{9007199254740992}}\end {array}\right ]
matrix mult
\left [\begin {array}{ccc} -{\frac {1864325633295085}{1125899906842624}}&-{\frac {72810256955173}{4503599627370496}}&-{\frac {1}{36028797018963968}}\\\noalign{\medskip}{\frac {452864452570813}{4503599627370496}}&-{\frac {501540912812687}{281474976710656}}&0\\\noalign{\medskip}-{\frac {809593725440403}{18014398509481984}}&{\frac {1412861530429113}{9007199254740992}}&-{\frac {1007149456047401}{562949953421312}}\end {array}\right ]
companionmatrix returned
\left [\begin {array}{cccccc} 0&0&0&1&0&0\\\noalign{\medskip}0&0&0&0&1&0\\\noalign{\medskip}0&0&0&0&0&1\\\noalign{\medskip}-{\frac {6143226768865817}{9007199254740992}}&-{\frac {129042498707599}{9007199254740992}}&-{\frac {1}{36028797018963968}}&-{\frac {1864325633295085}{1125899906842624}}&-{\frac {72810256955173}{4503599627370496}}&-{\frac {1}{36028797018963968}}\\\noalign{\medskip}{\frac {802185481956501}{9007199254740992}}&-{\frac {7149717546115545}{9007199254740992}}&0&{\frac {452864452570813}{4503599627370496}}&-{\frac {501540912812687}{281474976710656}}&0\\\noalign{\medskip}-{\frac {1434081057024049}{36028797018963968}}&{\frac {2504031572456349}{18014398509481984}}&-{\frac {7207390430725807}{9007199254740992}}&-{\frac {809593725440403}{18014398509481984}}&{\frac {1412861530429113}{9007199254740992}}&-{\frac {1007149456047401}{562949953421312}}\end {array}\right ]
companionmat
\left [\begin {array}{cccccc} 0&0&0&1&0&0\\\noalign{\medskip}0&0&0&0&1&0\\\noalign{\medskip}0&0&0&0&0&1\\\noalign{\medskip}-{\frac {6143226768865817}{9007199254740992}}&-{\frac {129042498707599}{9007199254740992}}&-{\frac {1}{36028797018963968}}&-{\frac {1864325633295085}{1125899906842624}}&-{\frac {72810256955173}{4503599627370496}}&-{\frac {1}{36028797018963968}}\\\noalign{\medskip}{\frac {802185481956501}{9007199254740992}}&-{\frac {7149717546115545}{9007199254740992}}&0&{\frac {452864452570813}{4503599627370496}}&-{\frac {501540912812687}{281474976710656}}&0\\\noalign{\medskip}-{\frac {1434081057024049}{36028797018963968}}&{\frac {2504031572456349}{18014398509481984}}&-{\frac {7207390430725807}{9007199254740992}}&-{\frac {809593725440403}{18014398509481984}}&{\frac {1412861530429113}{9007199254740992}}&-{\frac {1007149456047401}{562949953421312}}\end {array}\right ]
process
rational_quotient
procvals
 0.546571 0.44488 0.694567 0.62131
eigenvecs
\left [\begin {array}{cccccc} {\frac {1141163923709957}{2251799813685248}}&-{\frac {1035222019083947}{72057594037927936}}+{\frac {7886380668354835}{4611686018427387904}}\,\sqrt {-1}&-{\frac {1035222019083947}{72057594037927936}}-{\frac {7886380668354835}{4611686018427387904}}\,\sqrt {-1}&-{\frac {4956811243645047}{324518553658426726783156020576256}}-{\frac {5509035460862685}{316912650057057350374175801344}}\,\sqrt {-1}&-{\frac {4956811243645047}{324518553658426726783156020576256}}+{\frac {5509035460862685}{316912650057057350374175801344}}\,\sqrt {-1}&-{\frac {6894199748983083}{18014398509481984}}\\\noalign{\medskip}{\frac {8110497010025551}{18014398509481984}}&-{\frac {454166153071291}{4503599627370496}}+{\frac {3425009499876963}{144115188075855872}}\,\sqrt {-1}&-{\frac {454166153071291}{4503599627370496}}-{\frac {3425009499876963}{144115188075855872}}\,\sqrt {-1}&{\frac {3144163679346495}{5070602400912917605986812821504}}+{\frac {3490175125283267}{4951760157141521099596496896}}\,\sqrt {-1}&{\frac {3144163679346495}{5070602400912917605986812821504}}-{\frac {3490175125283267}{4951760157141521099596496896}}\,\sqrt {-1}&{\frac {1929381956624441}{4503599627370496}}\\\noalign{\medskip}{\frac {7205380443479631}{18014398509481984}}&-{\frac {3145221356893889}{4503599627370496}}+{\frac {4512865513294937}{18014398509481984}}\,\sqrt {-1}&-{\frac {3145221356893889}{4503599627370496}}-{\frac {4512865513294937}{18014398509481984}}\,\sqrt {-1}&{\frac {3039268677810507}{4611686018427387904}}+{\frac {3356614823974591}{4503599627370496}}\,\sqrt {-1}&{\frac {3039268677810507}{4611686018427387904}}-{\frac {3356614823974591}{4503599627370496}}\,\sqrt {-1}&-{\frac {8639180459163849}{18014398509481984}}\\\noalign{\medskip}-{\frac {3577312575961211}{9007199254740992}}&{\frac {3655037928259203}{288230376151711744}}-{\frac {237072563031931}{144115188075855872}}\,\sqrt {-1}&{\frac {3655037928259203}{288230376151711744}}+{\frac {237072563031931}{144115188075855872}}\,\sqrt {-1}&{\frac {1138586879027757}{81129638414606681695789005144064}}+{\frac {5058960210767075}{316912650057057350374175801344}}\,\sqrt {-1}&{\frac {1138586879027757}{81129638414606681695789005144064}}-{\frac {5058960210767075}{316912650057057350374175801344}}\,\sqrt {-1}&{\frac {6111235484483391}{18014398509481984}}\\\noalign{\medskip}-{\frac {6356182128711079}{18014398509481984}}&{\frac {6406175256190197}{72057594037927936}}-{\frac {3162183732295829}{144115188075855872}}\,\sqrt {-1}&{\frac {6406175256190197}{72057594037927936}}+{\frac {3162183732295829}{144115188075855872}}\,\sqrt {-1}&-{\frac {5623197503112421}{10141204801825835211973625643008}}-{\frac {6241394068191923}{9903520314283042199192993792}}\,\sqrt {-1}&-{\frac {5623197503112421}{10141204801825835211973625643008}}+{\frac {6241394068191923}{9903520314283042199192993792}}\,\sqrt {-1}&-{\frac {6841059386586229}{18014398509481984}}\\\noalign{\medskip}-{\frac {705855485009069}{2251799813685248}}&{\frac {5538356160774829}{9007199254740992}}-{\frac {1026359665474401}{4503599627370496}}\,\sqrt {-1}&{\frac {5538356160774829}{9007199254740992}}+{\frac {1026359665474401}{4503599627370496}}\,\sqrt {-1}&-{\frac {339853903753831}{576460752303423488}}-{\frac {6005174658005305}{9007199254740992}}\,\sqrt {-1}&-{\frac {339853903753831}{576460752303423488}}+{\frac {6005174658005305}{9007199254740992}}\,\sqrt {-1}&{\frac {3829020633372655}{9007199254740992}}\end {array}\right ]
eigenvals
\left [\begin {array}{cccccc} -{\frac {3529463044123859}{4503599627370496}}&0&0&0&0&0\\\noalign{\medskip}0&-{\frac {7960361743273919}{9007199254740992}}+{\frac {2682067687082117}{288230376151711744}}\,\sqrt {-1}&0&0&0&0\\\noalign{\medskip}0&0&-{\frac {7960361743273919}{9007199254740992}}-{\frac {2682067687082117}{288230376151711744}}\,\sqrt {-1}&0&0&0\\\noalign{\medskip}0&0&0&-{\frac {4028597824189623}{4503599627370496}}+{\frac {5233835525034039}{151115727451828646838272}}\,\sqrt {-1}&0&0\\\noalign{\medskip}0&0&0&0&-{\frac {4028597824189623}{4503599627370496}}-{\frac {5233835525034039}{151115727451828646838272}}\,\sqrt {-1}&0\\\noalign{\medskip}0&0&0&0&0&-{\frac {3992132350785519}{4503599627370496}}\end {array}\right ]
eigenval
-0.783698227229981
rational_quotient map
becomes root
0.214777517761954
eigenvecs
0.506778585189752
0.450223026084193
0.399978963476745
-0.397161478811327
-0.352838987400299
-0.31346280460601
corresponding to root
0.214777517761954
eigenval
-0.883777689172795 + 0.00930529156188033i
rational_quotient map
becomes root
-2.58512085523833 + 2.91867382512894i
eigenvecs
-0.0143665915148243 + 0.0017100862107356i
-0.100845144029036 + 0.0237657775395206i
-0.698379433593274 + 0.250514359994843i
0.0126809601994737 - 0.00164502136240593i
0.088903540865079 - 0.0219420574230621i
0.61488105282668 - 0.227897626431251i
corresponding to root
-2.58512085523833 + 2.91867382512894i
eigenval
-0.883777689172795 - 0.00930529156188033i
rational_quotient map
becomes root
-2.58512085523833 - 2.91867382512894i
eigenvecs
-0.0143665915148243 - 0.0017100862107356i
-0.100845144029036 - 0.0237657775395206i
-0.698379433593274 - 0.250514359994843i
0.0126809601994737 + 0.00164502136240593i
0.088903540865079 + 0.0219420574230621i
0.61488105282668 + 0.227897626431251i
corresponding to root
-2.58512085523833 - 2.91867382512894i
eigenval
-0.894528412274026 + 3.46346182047956e-008i
rational_quotient map
becomes root
1.01506447539561 + 1830856.7355098i
eigenvecs
-1.52743539244981e-017 - 1.73834508022032e-014i
6.20076951563076e-016 + 7.04835253429969e-013i
0.00065903634064986 + 0.745318212474942i
1.40341668134782e-017 + 1.59632637253712e-014i
-5.54490084067725e-016 - 6.30219747132792e-013i
-0.000589552545244133 - 0.666708317221299i
corresponding to root
1.01506447539561 + 1830856.7355098i
eigenval
-0.894528412274026 - 3.46346182047956e-008i
rational_quotient map
becomes root
1.01506447539561 - 1830856.7355098i
eigenvecs
-1.52743539244981e-017 + 1.73834508022032e-014i
6.20076951563076e-016 - 7.04835253429969e-013i
0.00065903634064986 - 0.745318212474942i
1.40341668134782e-017 - 1.59632637253712e-014i
-5.54490084067725e-016 + 6.30219747132792e-013i
-0.000589552545244133 + 0.666708317221299i
corresponding to root
1.01506447539561 - 1830856.7355098i
eigenval
-0.886431450638607
rational_quotient map
becomes root
-7.04453580733091
eigenvecs
-0.3827049648843
0.428408854308158
-0.479570852982772
0.339241717188987
-0.379755082190804
0.425106686893512
corresponding to root
-7.04453580733091
solveresultant called with only_real flag
\left [\begin {array}{cc} {\frac {7738175591682373}{36028797018963968}}&{\frac {8002012365014157}{9007199254740992}}\\\noalign{\medskip}-{\frac {727646832522441}{281474976710656}}+{\frac {3286134587816683}{1125899906842624}}\,\sqrt {-1}&{\frac {8011352869070461}{1125899906842624}}-{\frac {7271193105799951}{9007199254740992}}\,\sqrt {-1}\\\noalign{\medskip}-{\frac {727646832522441}{281474976710656}}-{\frac {3286134587816683}{1125899906842624}}\,\sqrt {-1}&{\frac {8011352869070461}{1125899906842624}}+{\frac {7271193105799951}{9007199254740992}}\,\sqrt {-1}\\\noalign{\medskip}{\frac {571430499143589}{562949953421312}}+{\frac {982933725334487}{536870912}}\,\sqrt {-1}&-{\frac {5706389628529369}{140737488355328}}+{\frac {6433644837814793}{147573952589676412928}}\,\sqrt {-1}\\\noalign{\medskip}{\frac {571430499143589}{562949953421312}}-{\frac {982933725334487}{536870912}}\,\sqrt {-1}&-{\frac {5706389628529369}{140737488355328}}-{\frac {6433644837814793}{147573952589676412928}}\,\sqrt {-1}\\\noalign{\medskip}-{\frac {7931442209223397}{1125899906842624}}&-{\frac {5041434351936711}{4503599627370496}}\end {array}\right ] removecomplex called with
removecomplex
{\it results}({\it MATRIX}([[{\frac {7738175591682373}{36028797018963968}},{\frac {8002012365014157}{9007199254740992}}],[-{\frac {727646832522441}{281474976710656}}+{\frac {3286134587816683}{1125899906842624}}\,\sqrt {-1},{\frac {8011352869070461}{1125899906842624}}-{\frac {7271193105799951}{9007199254740992}}\,\sqrt {-1}],[-{\frac {727646832522441}{281474976710656}}-{\frac {3286134587816683}{1125899906842624}}\,\sqrt {-1},{\frac {8011352869070461}{1125899906842624}}+{\frac {7271193105799951}{9007199254740992}}\,\sqrt {-1}],[{\frac {571430499143589}{562949953421312}}+{\frac {982933725334487}{536870912}}\,\sqrt {-1},-{\frac {5706389628529369}{140737488355328}}+{\frac {6433644837814793}{147573952589676412928}}\,\sqrt {-1}],[{\frac {571430499143589}{562949953421312}}-{\frac {982933725334487}{536870912}}\,\sqrt {-1},-{\frac {5706389628529369}{140737488355328}}-{\frac {6433644837814793}{147573952589676412928}}\,\sqrt {-1}],[-{\frac {7931442209223397}{1125899906842624}},-{\frac {5041434351936711}{4503599627370496}}]]))
removecomplex returned
\left [\begin {array}{cc} {\frac {7738175591682373}{36028797018963968}}&{\frac {8002012365014157}{9007199254740992}}\\\noalign{\medskip}-{\frac {7931442209223397}{1125899906842624}}&-{\frac {5041434351936711}{4503599627370496}}\end {array}\right ]
solveresultant returned
\left [\begin {array}{cc} {\frac {7738175591682373}{36028797018963968}}&{\frac {8002012365014157}{9007199254740992}}\\\noalign{\medskip}-{\frac {7931442209223397}{1125899906842624}}&-{\frac {5041434351936711}{4503599627370496}}\end {array}\right ] ans = -7.04453580733091
 0.214778 0.888401837097392 -1.11942

If we set debug_resultant to 31 (all bits except Latex) then the intermediate matrices are printed in their normal output.

>> debug_resultant=31
>> sylvester2('x*x+6*x+3*y-4','y*y+2*x-7*y+5','x','y')
mapleresultant called with
VECTOR([VECTOR([x^2+6*x+3*y-4, y^2+2*x-7*y+5]), VECTOR([y]), x, [[2, 1, 1, 1]], MATRIX([[x^2+6*x-4, 3, 0], [0, x^2+6*x-4, 3], [2*x+5, -7, 1]]), VECTOR([1, y, y^2]), 0, 0, 0, 0])
mapledecomposematpoly called with
maplematrixpolynomial
MATRIX([[x^2+6*x-4, 3, 0], [0, x^2+6*x-4, 3], [2*x+5, -7, 1]])
variable
x
maxdeg
2
maplemapcoeff(maplematrixpolynomial,variable,0)
MATRIX([[-4, 3, 0], [0, -4, 3], [5, -7, 1]])
zeromat 0 5
 -4 3 0 -4 3 -7 1
mapledecomposematpoly returned 0 5 6 0 2 1 0 0
 -4 3 0 -4 3 -7 1 0 0 6 0 0 0 0 0 1 0 0 0
mapleresultant returned fnarray: vararray: hiddenvar: hiddenvarmaxdeg: extract: numer: numerdecomposematpoly: numerrow: denom: denomrow: resultantUDim:
 numvars: 1 [1x2 sym ] [1x1 sym ] [1x1 sym ] 2 [2 1 1 1] 'not cached' [9x3 double] 'not cached' 'not cached' 'not cached' 0
solveresultant called with numvars: 1 fnarray: [1x2 sym ] vararray: [1x1 sym ] hiddenvar: [1x1 sym ] hiddenvarmaxdeg: 2 extract: [2 1 1 1] numer: 'not cached' numerdecomposematpoly: [9x3 double] numerrow: 'not cached' denom: 'not cached' denomrow: 'not cached' resultantUDim: 0 companionmatrix called with 0 5 6 0 2 1 0 0
 -4 3 0 -4 3 -7 1 0 0 6 0 0 0 0 0 1 0 0 0
matsize
3
maxdeg
2
 1 0 0 1 0 0 0
bigsize = matsize * maxdeg
6
Inf
identity transformation didnt succeed
trailing matrix 0 5
 -4 3 0 -4 3 -7 1
cond(trailingmatrix)
17.9877134220118
cond(trailingmatrix) < 1e6
-> inverse process
inversetrailing matrix -0.652173913043478 -0.869565217391304
 -0.73913 0.130435 -0.391304347826087 0.173913 -0.521739 0.565217 -0.695652
i
0
following matrix 0 0
 1 0 0 1 0 0 0
matrix mult 0.652173913043478 0.869565217391304
 0.73913 -0.130435 0 -0.173913 0 -0.565217 0
i 1 following matrix
0 2
 6 0 0 6 0 0 0
matrix mult
4.95652173913043 6.60869565217391
 5.21739 -0.782609 0 -1.04348 0 -3.3913 0
inverse transformation didnt succeed
companion matrix condition number too high
4.9977034620114e+017
inverse transformation didnt succeed
-> try random (as+b)/(cs+d) transformations
alpha
0.875741899818074
beta
0.737305988465256
gamma
0.13651874225971
delta
0.011756687353118
0 0.33229720035545
 1.40971 0.0559121 0 1.40971 0.0559121 -0.130462 0.0186374
61.6800083595098
alpha
0.893897966445253
beta
0.199138067205738
gamma
0.298723012102214
delta
0.661442576382325
 2.04428 0.267706 0 2.04428 0.267706 -0.624648 0.0892354
14.1976942871452
alpha
0.284408589749945
beta
0.469224285211001
gamma
0.0647811229632725
delta
0.988334938277631
 0.174648 0.0125898 0 0.174648 0.0125898 -0.0293762 0.00419659
29.8970674697294
alpha
0.582791681561231
beta
0.423496256851051
gamma
0.515511752140763
delta
0.333951479971759
 1.07925 0.797257 0 1.07925 0.797257 -1.86027 0.265752
3.97698037110095
bestalpha
0.582791681561231
bestbeta
0.423496256851051
bestgamma
0.515511752140763
bestdelta
0.333951479971759
smallestcond
3.97698037110095
smallestcond < 1e8
-> rational_quotient process
 1.07925 0.797257 0 1.07925 0.797257 -1.86027 0.265752
3.97698037110095
 0.564262 -0.0675463 0.202638900843983 0.0914379 -0.274314 1.13052 0.37134
i
0
following matrix 0 0.840472358352456
 0.581818 0.334571 0 0.581818 0.334571 -0.780665 0.111524
matrix mult -0.0548025420326997 0.0741865797017177
 -0.49861 0.0087072 6.93889390390723e-018 -0.431439 -6.93889e-18 -0.145732 -0.419652
i 1 following matrix 0 2.54744200963631
 1.59402 1.03294 0 1.59402 1.03294 -2.41018 0.344312
matrix mult -0.0829979082477692 0.112354841708347
 -1.41566 0.0132208 2.77555756156289e-017 -1.31351 -2.77556e-17 -0.221276 -1.29561
companionmatrix returned 0 0 -0.498610138730214 -0.0548025420326997 0.0741865797017177
 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0.00870720171846473 6.93889390390723e-018 -1.41565662486335 0.013220814011703 2.77555756156289e-017 -0.431439295737239 -6.93889390390723e-018 -0.0829979082477692 -1.31350861789077 -2.77555756156289e-017 -0.14573217617917 -0.419652296625402 0.112354841708347 -0.22127637088041 -1.29561151063952
process
rational_quotient
procvals
 0.582792 0.423496 0.515512 0.333951
eigenvecs 0.458670787642716 0.40748397036471 -0.384719331340661 -0.341785360729943 -0.303642742365487
 0.516287527208712 0.00719021104069036 + 0.0143997492651957i 0.00719021104069036 - 0.0143997492651957i -8.80466661864955e-019 + 1.17210245729081e-014i -8.80466661864955e-019 - 1.17210245729081e-014i 0.427086819441958 0.0395376159823668 + 0.108265973260912i 0.0395376159823668 - 0.108265973260912i 2.91353263563277e-018 - 3.88985240152381e-014i 2.91353263563277e-018 + 3.88985240152381e-014i -0.478090936348463 0.193931043164951 + 0.802285012294318i 0.193931043164951 - 0.802285012294318i 6.3584001502449e-005 - 0.839284116376348i 6.3584001502449e-005 + 0.839284116376348i 0.535186133144021 -0.00493239620779266 - 0.00945810485259946i -0.00493239620779266 + 0.00945810485259946i 5.68171535803886e-019 - 7.54753691251029e-015i 5.68171535803886e-019 + 7.54753691251029e-015i -0.281327001004484 -0.0274613249120986 - 0.0712809954260574i -0.0274613249120986 + 0.0712809954260574i -1.88197856396639e-018 + 2.51194172663092e-014i -1.88197856396639e-018 - 2.51194172663092e-014i 0.314923999542013 -0.137858727814382 - 0.529369243343658i -0.137858727814382 + 0.529369243343658i -4.11862446830847e-005 + 0.543693080937344i -4.11862446830847e-005 - 0.543693080937344i -0.352533262471838
eigenvals 0 0 0 0 0
 -0.745164876286342 0 0 0 0 0 -0.662644431431398 + 0.0116559599595437i 0 0 0 0 0 -0.662644431431398 - 0.0116559599595437i 0 0 0 0 0 -0.647805755319755 + 4.57227342551611e-009i 0 0 0 0 0 -0.647805755319755 - 4.57227342551611e-009i 0 0 0 0 0 -0.658711503604988
eigenval
-0.745164876286342
rational_quotient map
becomes root
0.214777517761974
eigenvecs
0.516287527208712
0.458670787642716
0.40748397036471
-0.384719331340661
-0.341785360729943
-0.303642742365487
corresponding to root
0.214777517761974
eigenval
-0.662644431431398 + 0.0116559599595437i
rational_quotient map
becomes root
-2.58512085521856 - 2.91867382513253i
eigenvecs
0.00719021104069036 + 0.0143997492651957i
0.0395376159823668 + 0.108265973260912i
0.193931043164951 + 0.802285012294318i
-0.00493239620779266 - 0.00945810485259946i
-0.0274613249120986 - 0.0712809954260574i
-0.137858727814382 - 0.529369243343658i
corresponding to root
-2.58512085521856 - 2.91867382513253i
eigenval
-0.662644431431398 - 0.0116559599595437i
rational_quotient map
becomes root
-2.58512085521856 + 2.91867382513253i
eigenvecs
0.00719021104069036 - 0.0143997492651957i
0.0395376159823668 - 0.108265973260912i
0.193931043164951 - 0.802285012294318i
-0.00493239620779266 + 0.00945810485259946i
-0.0274613249120986 + 0.0712809954260574i
-0.137858727814382 + 0.529369243343658i
corresponding to root
-2.58512085521856 + 2.91867382513253i
eigenval
-0.647805755319755 + 4.57227342551611e-009i
rational_quotient map
becomes root
13.070291357318 - 19499053.0700004i
eigenvecs
-8.80466661864955e-019 + 1.17210245729081e-014i
2.91353263563277e-018 - 3.88985240152381e-014i
6.3584001502449e-005 - 0.839284116376348i
5.68171535803886e-019 - 7.54753691251029e-015i
-1.88197856396639e-018 + 2.51194172663092e-014i
-4.11862446830847e-005 + 0.543693080937344i
corresponding to root
13.070291357318 - 19499053.0700004i
eigenval
-0.647805755319755 - 4.57227342551611e-009i
rational_quotient map
becomes root
13.070291357318 + 19499053.0700004i
eigenvecs
-8.80466661864955e-019 - 1.17210245729081e-014i
2.91353263563277e-018 + 3.88985240152381e-014i
6.3584001502449e-005 + 0.839284116376348i
5.68171535803886e-019 + 7.54753691251029e-015i
-1.88197856396639e-018 - 2.51194172663092e-014i
-4.11862446830847e-005 - 0.543693080937344i
corresponding to root
13.070291357318 + 19499053.0700004i
eigenval
-0.658711503604988
rational_quotient map
becomes root
-7.04453580732924
eigenvecs
0.427086819441958
-0.478090936348463
0.535186133144021
-0.281327001004484
0.314923999542013
-0.352533262471838
corresponding to root
-7.04453580732924
solveresultant called with only_real flag -2.58512085521856 - 2.91867382513253i -2.58512085521856 + 2.91867382513253i 13.070291357318 - 19499053.0700004i 13.070291357318 + 19499053.0700004i -7.04453580732924
 0.214777517761974 0.888401837097445 7.11551073091394 + 0.807264600314788i 7.11551073091394 - 0.807264600314788i -3.31869656723626 + 7.22552248830212e-007i -3.31869656723626 - 7.22552248830212e-007i -1.11942329892819
removecomplex called with removecomplex results(MATRIX([[3869087795841549/18014398509481984, 1000251545626829/1125899906842624], [-5821174660135003/2251799813685248-1643067293910361/562949953421312*i, 2002838217268423/281474976710656+7271193106334139/9007199254740992*i], [-5821174660135003/2251799813685248+1643067293910361/562949953421312*i, 2002838217268423/281474976710656-7271193106334139/9007199254740992*i], [459869994425321/35184372088832-5234237202413759/268435456*i, -7473040311780477/2251799813685248+3412156521997879/4722366482869645213696*i], [459869994425321/35184372088832+5234237202413759/268435456*i, -7473040311780477/2251799813685248-3412156521997879/4722366482869645213696*i], [-7931442209221525/1125899906842624, -315089646995177/281474976710656]])) removecomplex returned -7.04453580732924
 0.214778 0.888401837097445 -1.11942
solveresultant returned -7.04453580732924
 0.214778 0.888401837097445 -1.11942
ans = -7.04453580732924
 0.214778 0.888401837097445 -1.11942
>> diary off \end{verbatim}