# Revision history [back]

Your friend here is the list method, which will give you the coefficients of f as a polynomial in xbar.

Then you will be able to take its discriminant.

Let us illustrate this step by step.

To begin with, for reference, here is the Sage version used below.

sage: version()
'SageMath version 7.2, Release Date: 2016-05-15'


Let us set some values for n and r so that the code works and others can try it out.

sage: n = 13
sage: r = 7


Now define Zn, R, F, y, f as you did.

sage: Zn = Zmod(n)
sage: R = PolynomialRing(Zn, 'x')
sage: F = R.quotient(x**r-1)
sage: y = F(x+1)
sage: f = F(y**n)


We get:

sage: f
xbar^6 + 1


Get the coefficients:

sage: f.list()
[1, 0, 0, 0, 0, 0, 1]


Define the ring of polynomials over ZZ:

sage: Zx = PolynomialRing(ZZ, 'x')


The polynomial corresponding to f:

sage: ff = Zx(f.list())
sage: ff
x^6 + 1


The discriminant of this polynomial:

sage: ff.discriminant()
-46656