Ask Your Question

Stange behavior in my scmd file.

asked 2014-08-08 13:04:42 -0600

I cannot figure this out! The diff command is working fine, by why are the following two commands not working as expected?

 sage: diff(sin(x^2),x)
sage: factor(8+27*x^3)
sage: latex(factor(8+27*x^3))
edit retag flag offensive close merge delete


Hello, which version of sage are you using ? Did you type something before these lines ?

FrédéricC gravatar imageFrédéricC ( 2014-08-08 14:17:14 -0600 )edit

1 answer

Sort by » oldest newest most voted

answered 2014-08-08 19:10:07 -0600

It seems you are computing in polynomials over the finite field with two elements.

In a fresh Sage session, factor(8+27*x^3) outputs (9*x^2 - 6*x + 4)*(3*x + 2).

But if you compute in polynomials over GF(2), you would just get x^3.

sage: R = PolynomialRing(GF(2),'x')
sage: x = R.gen()
sage: factor(8+27*x^3)
edit flag offensive delete link more


Okay, I just inserted a reset() command before this call and it's now working. THANKS!

ron.bannon gravatar imageron.bannon ( 2014-08-08 21:13:07 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-08-08 13:04:42 -0600

Seen: 46 times

Last updated: Aug 08 '14