Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Type of variable is changed after using factor() function

I defined a polynomial using polynomial ring. In my program, I need to simplify expressions using factor(). But the type of variable is changed and it becomes "None". For example,

Ra=PolynomialRing(QQ,'a',6)
Fa=Ra.fraction_field()
a=Ra.gens()
r1=(a[1]^2+a[2])/(a[3]+2*a[4])
r1.subs( { a[1]:2, a[4]:2*a[2]+a[3] } )
r2=r1.factor()
print(type(r1)), print(type(r2))
print(simplify(r2))

How to use factor() inside the ring Ra=PolynomialRing(QQ,'a',6)? Thank you very much.