Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Strange factoring in e = (x+1)^3*(x+2)^3*(x+3)^3*(x+4)^3

After reading a question about QUORA I had fun with Sage to test expressions factoring. If I ask to factorize e = (x+1)^3(x+2)^3(x+3)^3 everything is ok. But when I ask to factorize e = (x+1)^3(x+2)^3(x+3)^3*(x+4)^3 the result surprises me and I do not understand why! Here is my script and the results.

var('q')
e = (x+1)^3*(x+2)^3*(x+3)^3
print e
print "solve: ", solve(e,x)
#
R = ComplexField(16)['x']       # 16 donne 3 décimales et 32 donne 8 décimales   
q = R(e)
print "factor: ", factor(q)
print 

e = (x+1)^3*(x+2)^3*(x+3)^3*(x+4)^3
print e
print "solve: ", solve(e,x)
#
R = ComplexField(16)['x']       # 16 donne 3 décimales   
q = R(e)
print factor(q)
print
#
R = ComplexField(32)['x']       # 32 donne 8 décimales   
q = R(e)
print factor(q)

Now the results

(x + 3)^3*(x + 2)^3*(x + 1)^3
solve:  [
x == -3,
x == -2,
x == -1
]
factor:  (x + 1.000)^3 * (x + 2.000)^3 * (x + 3.000)^3

(x + 4)^3*(x + 3)^3*(x + 2)^3*(x + 1)^3
solve:  [
x == -4,
x == -3,
x == -2,
x == -1
]
(x + 0.8452 - 0.1196*I) * (x + 0.8452 + 0.1196*I) * (x + 1.115 - 0.4330*I) * (x + 1.115 + 0.4330*I) * (x
+ 1.764 - 1.048*I) * (x + 1.764 + 1.048*I) * (x + 2.528) * (x + 2.988 - 1.554*I) * (x + 2.988 + 1.554*I)
* (x + 4.457 - 1.231*I) * (x + 4.457 + 1.231*I) * (x + 5.134)

(x + 1.00000000)^3 * (x + 2.00000000)^3 * (x + 3.00000000)^3 * (x + 4.00000000)^3

As you can see when I the use of ComplexField(16) is totally different of ComplexField(32) Why? Thank you in advance for enlightening my lantern.

Strange factoring in e = (x+1)^3*(x+2)^3*(x+3)^3*(x+4)^3

After reading a question about QUORA I had fun with Sage to test expressions factoring. If I ask to factorize e = (x+1)^3(x+2)^3(x+3)^3 everything is ok. But when I ask to factorize e = (x+1)^3(x+2)^3(x+3)^3*(x+4)^3 the result surprises me and I do not understand why! Here is my script and the results.

var('q')
e = (x+1)^3*(x+2)^3*(x+3)^3
print e
print "solve: ", solve(e,x)
#
R = ComplexField(16)['x']       # 16 donne 3 décimales et 32 donne 8 décimales   
q = R(e)
print "factor: ", factor(q)
print 

e = (x+1)^3*(x+2)^3*(x+3)^3*(x+4)^3
print e
print "solve: ", solve(e,x)
#
R = ComplexField(16)['x']       # 16 donne 3 décimales   
q = R(e)
print factor(q)
print
#
R = ComplexField(32)['x']       # 32 donne 8 décimales   
q = R(e)
print factor(q)

Now the results

(x + 3)^3*(x + 2)^3*(x + 1)^3
solve:  [
x == -3,
x == -2,
x == -1
]
factor:  (x + 1.000)^3 * (x + 2.000)^3 * (x + 3.000)^3

(x + 4)^3*(x + 3)^3*(x + 2)^3*(x + 1)^3
solve:  [
x == -4,
x == -3,
x == -2,
x == -1
]
(x + 0.8452 - 0.1196*I) * (x + 0.8452 + 0.1196*I) * (x + 1.115 - 0.4330*I) * (x + 1.115 + 0.4330*I) * (x
+ 1.764 - 1.048*I) * (x + 1.764 + 1.048*I) * (x + 2.528) * (x + 2.988 - 1.554*I) * (x + 2.988 + 1.554*I)
* (x + 4.457 - 1.231*I) * (x + 4.457 + 1.231*I) * (x + 5.134)

(x + 1.00000000)^3 * (x + 2.00000000)^3 * (x + 3.00000000)^3 * (x + 4.00000000)^3

As you can see when I the use of ComplexField(16) give me 12 roots (10 complex ans 2 false reals for me).This is totally different of ComplexField(32) which give the right answer. Why? Thank you in advance for enlightening my lantern.