Using All Roots of a Polynomial

Use rootsOf to get all symbolic roots of a polynomial. The call rootsOf(p,x) returns a list of all the roots of p(x). If p(x) has a multiple root of order n, then that root appears n times in the list. Compute all the roots of x^4+1. As a side effect, the variables %x0, %x1, and %x2 are bound to the first three roots of x^4+1. Although they all satisfy x^4+1=0, %x0, %x1, and %x2 are different algebraic numbers. To find the algebraic relation that defines each of them, use definingPolynomial. We can check that the sum and product of the roots of x^4+1 are its trace and norm. Corresponding to the pair of operations rootOf and zeroOf in Solution of a Single Polynomial Equation there is an operations zerosOf that, like rootsOf, computes all the roots of a given polynomial, but which expresses some of them in terms of radicals. As you see, only one implicit algebraic number was created (%y1), and its defining equation is this. The other three roots are expressed in radicals.