Macaulay2 » Documentation
Packages » Elimination :: resultant(RingElement,RingElement,RingElement)
next | previous | forward | backward | up | index | toc

resultant(RingElement,RingElement,RingElement)

Synopsis

Description

The elements f and g should be polynomials in the same ring, and x should be a variable in that ring. The result is the determinant of the Sylvester matrix, sylvesterMatrix(f,g,x). The resultant of f and its derivative with respect to x is the discriminant, discriminant(f,x).

i1 : R = ZZ[x,a,b,c,d]	  

o1 = R

o1 : PolynomialRing
i2 : f = x^7+3*x^4+a*x+b

      7     4
o2 = x  + 3x  + x*a + b

o2 : R
i3 : g = x^8+x^5+c*x+d

      8    5
o3 = x  + x  + x*c + d

o3 : R
i4 : time eliminate(ideal(f,g),x)
 -- used 1.2949s (cpu); 1.15801s (thread); 0s (gc)

            7       8     3 5    8     6         3 4      7       3 3 2  
o4 = ideal(a b*c - a d + a b  - b  - 6a b*c - 18a b c + 7b c + 48a b c  -
     ------------------------------------------------------------------------
        6 2      3 2 3      5 3      3   4      4 4      3 5     2 6      7  
     21b c  - 46a b c  + 35b c  + 15a b*c  - 35b c  + 21b c  - 7b c  + b*c  +
     ------------------------------------------------------------------------
       7       4 3        6       4 2           5         4   2         4 2 
     6a d + 21a b d - 8a*b d - 85a b c*d + 41a*b c*d + 79a b*c d - 85a*b c d
     ------------------------------------------------------------------------
          4 3         3 3         2 4           5       6       5   2  
     - 15a c d + 90a*b c d - 50a*b c d + 13a*b*c d - a*c d + 37a b*d  -
     ------------------------------------------------------------------------
        2 4 2      5   2      2 3   2      2 2 2 2      2   3 2     2 4 2  
     20a b d  - 33a c*d  + 66a b c*d  - 78a b c d  + 38a b*c d  - 6a c d  -
     ------------------------------------------------------------------------
        3 2 3      3     3     3 2 3     4 4     2 5      5         2 4   
     16a b d  + 25a b*c*d  - 9a c d  - 2a d  - 6a b  + 12a b*c + 84a b c -
     ------------------------------------------------------------------------
         2 3 2       2 2 3       2   4      6        3 3       6   
     328a b c  + 428a b c  - 178a b*c  - 12a d - 102a b d - 10b d +
     ------------------------------------------------------------------------
         3 2         5          3   2       4 2        3 3       3 3   
     578a b c*d + 22b c*d - 710a b*c d + 12b c d + 178a c d - 68b c d +
     ------------------------------------------------------------------------
        2 4         5        4   2       4 2       4   2        3   2  
     62b c d - 18b*c d - 250a b*d  - 2a*b d  + 282a c*d  - 40a*b c*d  +
     ------------------------------------------------------------------------
           2 2 2          3 2        4 2     2 2 3      2     3      2 2 3  
     104a*b c d  - 80a*b*c d  + 18a*c d  + 4a b d  - 78a b*c*d  + 18a c d  +
     ------------------------------------------------------------------------
        3 4      3 4      2   4        2 4     3 4          5          5    7
     87a d  - 17b d  + 37b c*d  - 23b*c d  + 3c d  - 35a*b*d  + 21a*c*d  - d 
     ------------------------------------------------------------------------
            5     4            4          3 2          2 3           4     5 
     + 12a*b  - 8a b*c - 152a*b c + 656a*b c  - 1128a*b c  + 612a*b*c  + 8a d
     ------------------------------------------------------------------------
           2 3         2 2           2   2        2 3        3   2      4 2  
     + 188a b d - 1188a b c*d + 1884a b*c d - 612a c d + 532a b*d  - 88b d  -
     ------------------------------------------------------------------------
         3   2      3   2      2 2 2         2 3             3       2 4  
     756a c*d  + 64b c*d  + 24b c d  + 196a*b d  + 156a*b*c*d  - 714a d  +
     ------------------------------------------------------------------------
           5        5     5      4        3 2       2 3         4         3 
     114b*d  - 54c*d  - 8b  + 96b c - 432b c  + 864b c  - 648b*c  - 120a*b d
     ------------------------------------------------------------------------
             2               2          3        2   2       2   2       2 3
     + 792a*b c*d - 1512a*b*c d + 648a*c d - 360a b*d  + 648a c*d  - 504b d 
     ------------------------------------------------------------------------
               3          4        4
     - 216b*c*d  + 2052a*d  - 1944d )

o4 : Ideal of R
i5 : time ideal resultant(f,g,x)
 -- used 0.0109999s (cpu); 0.0112501s (thread); 0s (gc)

              7       8     3 5    8     6         3 4      7       3 3 2  
o5 = ideal(- a b*c + a d - a b  + b  + 6a b*c + 18a b c - 7b c - 48a b c  +
     ------------------------------------------------------------------------
        6 2      3 2 3      5 3      3   4      4 4      3 5     2 6      7  
     21b c  + 46a b c  - 35b c  - 15a b*c  + 35b c  - 21b c  + 7b c  - b*c  -
     ------------------------------------------------------------------------
       7       4 3        6       4 2           5         4   2         4 2 
     6a d - 21a b d + 8a*b d + 85a b c*d - 41a*b c*d - 79a b*c d + 85a*b c d
     ------------------------------------------------------------------------
          4 3         3 3         2 4           5       6       5   2  
     + 15a c d - 90a*b c d + 50a*b c d - 13a*b*c d + a*c d - 37a b*d  +
     ------------------------------------------------------------------------
        2 4 2      5   2      2 3   2      2 2 2 2      2   3 2     2 4 2  
     20a b d  + 33a c*d  - 66a b c*d  + 78a b c d  - 38a b*c d  + 6a c d  +
     ------------------------------------------------------------------------
        3 2 3      3     3     3 2 3     4 4     2 5      5         2 4   
     16a b d  - 25a b*c*d  + 9a c d  + 2a d  + 6a b  - 12a b*c - 84a b c +
     ------------------------------------------------------------------------
         2 3 2       2 2 3       2   4      6        3 3       6   
     328a b c  - 428a b c  + 178a b*c  + 12a d + 102a b d + 10b d -
     ------------------------------------------------------------------------
         3 2         5          3   2       4 2        3 3       3 3   
     578a b c*d - 22b c*d + 710a b*c d - 12b c d - 178a c d + 68b c d -
     ------------------------------------------------------------------------
        2 4         5        4   2       4 2       4   2        3   2  
     62b c d + 18b*c d + 250a b*d  + 2a*b d  - 282a c*d  + 40a*b c*d  -
     ------------------------------------------------------------------------
           2 2 2          3 2        4 2     2 2 3      2     3      2 2 3  
     104a*b c d  + 80a*b*c d  - 18a*c d  - 4a b d  + 78a b*c*d  - 18a c d  -
     ------------------------------------------------------------------------
        3 4      3 4      2   4        2 4     3 4          5          5    7
     87a d  + 17b d  - 37b c*d  + 23b*c d  - 3c d  + 35a*b*d  - 21a*c*d  + d 
     ------------------------------------------------------------------------
            5     4            4          3 2          2 3           4     5 
     - 12a*b  + 8a b*c + 152a*b c - 656a*b c  + 1128a*b c  - 612a*b*c  - 8a d
     ------------------------------------------------------------------------
           2 3         2 2           2   2        2 3        3   2      4 2  
     - 188a b d + 1188a b c*d - 1884a b*c d + 612a c d - 532a b*d  + 88b d  +
     ------------------------------------------------------------------------
         3   2      3   2      2 2 2         2 3             3       2 4  
     756a c*d  - 64b c*d  - 24b c d  - 196a*b d  - 156a*b*c*d  + 714a d  -
     ------------------------------------------------------------------------
           5        5     5      4        3 2       2 3         4         3 
     114b*d  + 54c*d  + 8b  - 96b c + 432b c  - 864b c  + 648b*c  + 120a*b d
     ------------------------------------------------------------------------
             2               2          3        2   2       2   2       2 3
     - 792a*b c*d + 1512a*b*c d - 648a*c d + 360a b*d  - 648a c*d  + 504b d 
     ------------------------------------------------------------------------
               3          4        4
     + 216b*c*d  - 2052a*d  + 1944d )

o5 : Ideal of R
i6 : sylvesterMatrix(f,g,x)

o6 = {-14} | 1 0 0 3 0 0 a b 0 0 0 0 0 0 0 |
     {-13} | 0 1 0 0 3 0 0 a b 0 0 0 0 0 0 |
     {-12} | 0 0 1 0 0 3 0 0 a b 0 0 0 0 0 |
     {-11} | 0 0 0 1 0 0 3 0 0 a b 0 0 0 0 |
     {-10} | 0 0 0 0 1 0 0 3 0 0 a b 0 0 0 |
     {-9}  | 0 0 0 0 0 1 0 0 3 0 0 a b 0 0 |
     {-8}  | 0 0 0 0 0 0 1 0 0 3 0 0 a b 0 |
     {-7}  | 0 0 0 0 0 0 0 1 0 0 3 0 0 a b |
     {-14} | 1 0 0 1 0 0 0 c d 0 0 0 0 0 0 |
     {-13} | 0 1 0 0 1 0 0 0 c d 0 0 0 0 0 |
     {-12} | 0 0 1 0 0 1 0 0 0 c d 0 0 0 0 |
     {-11} | 0 0 0 1 0 0 1 0 0 0 c d 0 0 0 |
     {-10} | 0 0 0 0 1 0 0 1 0 0 0 c d 0 0 |
     {-9}  | 0 0 0 0 0 1 0 0 1 0 0 0 c d 0 |
     {-8}  | 0 0 0 0 0 0 1 0 0 1 0 0 0 c d |

             15      15
o6 : Matrix R   <-- R
i7 : discriminant(f,x)

           7          6           3 3          6          5           2 3  
o7 = 46656a  - 314928a  - 1555848a b  + 823543b  + 708588a  + 9501786a b  -
     ------------------------------------------------------------------------
            4              3            3
     531441a  - 20575296a*b  + 15116544b

o7 : R

See also

Ways to use this method: