The expression 23t−23y can be factored as (23)⋅(y−t).
If I try to use sage in this way to do the factorization:
var('y t')
E = -2/3*y + 2/3 * t
E.factor()
The result is still E
.
On the other hand, if do it like this:
R.<y,t> = PolynomialRing(QQ)
E = -2/3*t +2/3*y
E.factor()
The result is as expected.
Why does the call to factor()
works as expected when the variable y and t are defined to be a polynomial ring in QQ and not work then they are symbolic expressions.