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

# discriminant(RingElement,RingElement)

- Function: discriminant
- Usage:
    `discriminant(f,x)`
- Inputs:
  - f, a ring element, a polynomial
  - x, a ring element, a variable in the same ring
- Optional inputs:
  - Algorithm (missing documentation) => ..., default value null,
- Outputs:
  - a ring element, the discriminant of f with respect to x

## Description

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

    o1 = R

    o1 : PolynomialRing

    i2 : f = x^2+a*x+b

          2
    o2 = x  + x*a + b

    o2 : R

    i3 : g = x^2+c*x+d

          2
    o3 = x  + x*c + d

    o3 : R

    i4 : time eliminate(x,ideal(f,g))
     -- used 0.00254812s (cpu); 0.00254668s (thread); 0s (gc)

                          2    2             2           2
    o4 = ideal(a*b*c - b*c  - a d + a*c*d - b  + 2b*d - d )

    o4 : Ideal of R

    i5 : time ideal resultant(f,g,x)
     -- used 0.00162786s (cpu); 0.00162831s (thread); 0s (gc)

                            2    2             2           2
    o5 = ideal(- a*b*c + b*c  + a d - a*c*d + b  - 2b*d + d )

    o5 : Ideal of R

    i6 : sylvesterMatrix(f,g,x)

    o6 = {-3} | 1 a b 0 |
         {-2} | 0 1 a b |
         {-3} | 1 c d 0 |
         {-2} | 0 1 c d |

                 4      4
    o6 : Matrix R  <-- R

    i7 : discriminant(f,x)

            2
    o7 = - a  + 4b

    o7 : R

## See also

- resultant
- eliminate
- Elimination -- eliminating specified variables, and Sylvester resultant

## Ways to use this method:

- discriminant(RingElement,RingElement)

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Elimination.m2:235:0.