Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why does $\frac{2}{3} t - \frac{2}{3} y$ factors only when the variables are polynomial ring over the rational numbers?

The expression $\frac{2}{3} t - \frac{2}{3} y$ can be factored as $\left(\frac{2}{3}\right) \cdot (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.