Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It may be well a homework, but maybe one should give the solution, since part of it is knowing the right method to be used in the right context. The following initializes the polynomial ring $\Bbb F_{37}[X]$ in the transcendental variable $X$, an other one as the $x$ set by default, and maybe not the $x$ in the OP. Then having the polynomial over the right field we simply ask for its roots. A second solution would be to use a "polynomial expression" using the variable x, which exists by default (or create any other), then use the method roots also specifying as optional parameter the ring for the roots.

sage: var('x');
sage: R.<X> = PolynomialRing(GF(37))
sage: (x^3 + 7*x + 25).roots(ring=GF(37))
[(5, 1)]
sage: (x^3 + 7*x + 25).roots(ring=GF(37), multiplicities=False)
[5]
sage: (X^3 + 7*X + 25).roots()
[(5, 1)]
sage: (X^3 + 7*X + 25).roots(multiplicities=False)
[5]