Question: How to create the set of all possible rational zeros of a polynomial.

I am able to generate random polynomials with non-zero coefficents, and define sets of all the positive divisors of the leading coefficient and the constant terms. My question is this, how may I apply the rational zeros theorem to generate the set of all possible rational zeros of the polynomial. I basically need to form all the possible quotients (positive and negative) with numerator in one set and denominator in the other set, ignoring duplicates. The attached worksheet has what I've done so

attempt := 1; while attempt > 0 do q := randpoly(x, coeffs = rand(-9 .. 9), degree = 3, dense); if nops(q) = 4 then attempt := -2 end if; attempt := attempt+1 end do; q



NumberTheory[Divisors](coeff(q, x, 3))

{1, 5}


NumberTheory[Divisors](coeff(q, x, 0))

{1, 2, 4, 8}






Please Wait...