Syl [f_, g_, var_, m_, n_] := Module [{A, i},
   A = {};
   i = n-1;
   While [i >= 0,
      A = Join [A, {Reverse [CoefficientList [x^i * f, x, m+n]]}];
      i = i - 1];
   i = m-1;   
   While [i >= 0,
      A = Join [A, {Reverse [CoefficientList [x^i * g, x, m+n]]}];
      i = i - 1];
   A];

Res [f_, g_, var_, m_, n_] := Det [Syl [f,g,var,m,n]];
      
Adj [A_] := Module [{B,i,j},
   B = Table [
          Table [
             (-1)^(i+j) * Det [Transpose [Drop [Transpose [Drop[A, {i}]],{j}]]],
             {j,1,Length[A]}
          ],
          {i,1,Length[A]}
       ];
   Transpose [B]]
