1 | initial version |
As you can see, poly
is a genuine polynomial, not a symbolic expression:
sage: poly.parent()
Univariate Polynomial Ring in x over Integer Ri
You can get its roots as follows:
sage: poly.roots()
[(-4, 1), (2, 2)]
So, you can see, that it has root -4
wirh multiplicity 1
anr roor 2
ยท with multiplicity 2
.
Note that poly. == 0
is the boolean False
, since the polynomial is not the zero polynomial:
sage: poly == 0
False
If you really want to use solve, you need to transform the polynomial into a symbolic expression as follows:
sage: SR(poly)
x^3 - 12*x + 16
sage: SR(poly).parent()
Symbolic Ring
Then, you can do:
sage: solve(SR(poly),x)
[x == -4, x == 2]