Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

factor() issue with second degre polynomes

Hello, In a sagenb worksheet, I'am trying to factor two 2° polynomes R and H as follow:

from sage.misc.latex import pretty_print
x=var('x')
R(x)=9*(x-5)**2-4
f3=R.factor()
H(x)=2*(x+5)**2-4
f4=H.factor()
pretty_print('R(x)=',f3)
pretty_print('H(x)=',f4)

I get :

R(x)=(3x-17)(3x-13) as waited
but H(x)=2x**2+20x+46

I can develop the factorized H as:

test=(sqrt(2)*(x+5)-2)*(sqrt(2)*(x+5)+2)
pretty_print(test.radical_simplify())

which yields:

2x**2+20x+46

Is there a kind of "radical_factor()" ? Thank you