m098algebra0

696 days ago by jozefl

Sage takes an interesting approach to solving for the roots of polynomials using the roots() function. It returns a 2-tuple for each root. The first number is the root and the second is its multiplicity. So if roots() returns

[(2, 2), (-I, 1)]

that means that the polynomial has three roots, 2, 2, and -√1.

f=6+5*x+x^2 f.roots() 
       
g=x^2+1 g.roots() 
       
h=x^2+2/3*x+1 h.roots()