1 | initial version |
I don't know what I am doing wrong
Your polyx
variables have values in R1. polyx==0
means "compare value of poly1 with the integer 0", and this cannot return but False
What confuses you is that, the ==
is overloaded for symbolic expression (SR) operands, and returns a spetial type of symbolic expression, an equation. What you have in mind is something along the lines of :
sage: SR(str(poly1))==0
b0_1_2 + b1_1_1 + b1_2_1 == 0
Here, this expression can be interpreted as "Apply the (infix) ==
operator to its left and right arguments (coercible to) symbolic expressions", returning an equation.
Such an overload does not exist for polynomial rings. BTW, while the concept of an "equation" object is sometimes useful (e. g. to work separately in the left- and right-hand sides), it is more syntactic sugar than really useful for computational purposes, and exists probably for historical reasons.
As noted by @dan_fulea, a polynomial is also an implicit equation to 0.
BTW, this is true also for symbolic expressions : compare
sage: solve(log(x)==0, x)
[x == 1]
with
sage: solve(log(x), x)
[x == 1]
HTH,