Ask Your Question

Stange behavior in my scmd file.

asked 2014-08-08 20:04:42 +0200

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 21:17:14 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2014-08-09 02:10:07 +0200

slelievre gravatar image

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-09 04:13:07 +0200 )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 20:04:42 +0200

Seen: 232 times

Last updated: Aug 09 '14